<commit_before># Ruby/WordPress

[![Build Status](https://travis-ci.org/keichan34/ruby-wordpress.png)](https://travis-ci.org/keichan34/ruby-wordpress)

Access your WordPress database with Ruby.

## Installation

Add this line to your application's Gemfile:

    gem 'ruby-wordpress', :require => 'wordpress'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install ruby-wordpress

## Usage

    require 'wordpress'
    wp = WordPress.new options

## Initialization options

A symbol hash.

See the [mysql2 connection options](https://github.com/brianmario/mysql2#connection-options).

Additional options:

* `:wordpress_prefix` (default: 'wp_')

## Changelog

### 0.0.3 (unreleased)

New features

* PHP serialization for Ruby arrays and hashes in `WordPress::Options`

### 0.0.2

* Bug fixes
* Post meta
* Taxonomy functions
* Adds post meta queries

### 0.0.1

* Initial public release
* Basic SQL functions (WordPress::Base)
* `wp_options` accessor

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request<commit_msg>updates README with bug fixes and features<commit_after># Ruby/WordPress

[![Build Status](https://travis-ci.org/keichan34/ruby-wordpress.png)](https://travis-ci.org/keichan34/ruby-wordpress)

Access your WordPress database with Ruby.

Read more: [http://keita.flagship.cc/2013/06/ruby-wordpress/](http://keita.flagship.cc/2013/06/ruby-wordpress/)

## Installation

Add this line to your application's Gemfile:

    gem 'ruby-wordpress', :require => 'wordpress'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install ruby-wordpress

## Usage

    require 'wordpress'
    wp = WordPress.new options

## Initialization options

A symbol hash.

See the [mysql2 connection options](https://github.com/brianmario/mysql2#connection-options).

Additional options:

* `:wordpress_prefix` (default: 'wp_')
* `:wordpress_wp_content` (used for uploading attachments)

## Changelog

### 0.0.3 (unreleased)

Bug fixes

* `WordPress::Post#set_post_terms` will now respect the `append` parameter, when true.

New features

* PHP serialization for Ruby arrays and hashes in `WordPress::Options`
* 1.8.7 syntax support

### 0.0.2

* Bug fixes
* Post meta
* Taxonomy functions
* Adds post meta queries

### 0.0.1

* Initial public release
* Basic SQL functions (WordPress::Base)
* `wp_options` accessor

## Hacking

Hack away! Just make sure you have your `test_configuration.yml` file set up correctly. There's an example in `test_configuration.example.yml`; you can copy this and tailor it to your environment.

Please do not use a real database for testing - it is wiped clean before the suite runs, and loads the attached WordPress default schema.

The default `rake` task will run the entire test suite.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
{'fraction_non_alphanumeric': 0.11198490091223655, 'fraction_numerical': 0.01730103806228374, 'mean_word_length': 4.221674876847291, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6449850', 'n_tokens_mistral': 1049, 'n_tokens_neox': 967, 'n_words': 344}