active_press 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. data/.gitignore +5 -0
  2. data/.rspec +1 -0
  3. data/.rvmrc +1 -0
  4. data/.travis.yml +3 -0
  5. data/Gemfile +14 -0
  6. data/Guardfile +9 -0
  7. data/README.md +3 -0
  8. data/Rakefile +12 -0
  9. data/active_press.gemspec +30 -0
  10. data/lib/active_press/models/base.rb +3 -0
  11. data/lib/active_press/models/category.rb +6 -0
  12. data/lib/active_press/models/comment.rb +15 -0
  13. data/lib/active_press/models/commentmeta.rb +6 -0
  14. data/lib/active_press/models/link.rb +0 -0
  15. data/lib/active_press/models/option.rb +0 -0
  16. data/lib/active_press/models/post.rb +30 -0
  17. data/lib/active_press/models/postmeta.rb +6 -0
  18. data/lib/active_press/models/tag.rb +5 -0
  19. data/lib/active_press/models/term.rb +6 -0
  20. data/lib/active_press/models/term_relationship.rb +8 -0
  21. data/lib/active_press/models/term_taxonomy.rb +4 -0
  22. data/lib/active_press/models/user.rb +15 -0
  23. data/lib/active_press/models/usermeta.rb +6 -0
  24. data/lib/active_press/taxonomy.rb +18 -0
  25. data/lib/active_press/version.rb +3 -0
  26. data/lib/active_press.rb +21 -0
  27. data/spec/factories/post_factory.rb +14 -0
  28. data/spec/factories/term_factory.rb +6 -0
  29. data/spec/factories/term_taxonomy_factory.rb +5 -0
  30. data/spec/models/base_spec.rb +9 -0
  31. data/spec/models/category_spec.rb +5 -0
  32. data/spec/models/comment_spec.rb +7 -0
  33. data/spec/models/commentmeta_spec.rb +5 -0
  34. data/spec/models/post_spec.rb +50 -0
  35. data/spec/models/postmeta_spec.rb +5 -0
  36. data/spec/models/tag_spec.rb +5 -0
  37. data/spec/models/term_relationship_spec.rb +8 -0
  38. data/spec/models/term_spec.rb +5 -0
  39. data/spec/models/term_taxonomy_spec.rb +23 -0
  40. data/spec/models/user_spec.rb +7 -0
  41. data/spec/models/usermeta_spec.rb +5 -0
  42. data/spec/spec_helper.rb +16 -0
  43. data/spec/support/taxonomy_shared_example.rb +5 -0
  44. data/spec/test_schema.rb +151 -0
  45. metadata +163 -0
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.3-rc1@active_press --create
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ gem 'rake'
6
+
7
+ require 'rbconfig'
8
+
9
+ if RbConfig::CONFIG['target_os'] =~ /darwin/i
10
+ gem 'rb-fsevent', '>= 0.4.0', :require => false
11
+ gem 'growl_notify', :require => false
12
+ gem 'guard', '~> 0.6.0', :require => false
13
+ gem 'guard-rspec', '~> 0.4.0', :require => false
14
+ end
data/Guardfile ADDED
@@ -0,0 +1,9 @@
1
+ guard 'rspec', :version => 2 do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^spec/factories/.+\.rb$}) { "spec/" }
4
+ watch(%r{^spec/support/.+\.rb$}) { "spec/" }
5
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
6
+ watch('spec/spec_helper.rb') { "spec/" }
7
+ watch('spec/test_schema.rb') { "spec/" }
8
+ end
9
+
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # ActivePress [![Build Status](http://travis-ci.org/robwilliams/active_press.png)](http://travis-ci.org/robwilliams/active_press)
2
+
3
+ ActivePress is a set of tools that help with accessing and manipulating the contents of a Wordpress database using Ruby.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ task :default => :spec
5
+
6
+ desc "Run specs"
7
+ RSpec::Core::RakeTask.new
8
+
9
+ desc "Open an IRB session preloaded with ActivePress"
10
+ task :console do
11
+ sh "irb -rubygems -I lib -r active_press.rb"
12
+ end
@@ -0,0 +1,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "active_press/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "active_press"
7
+ s.version = ActivePress::VERSION
8
+ s.authors = ["Robert Williams"]
9
+ s.email = ["rob@r-williams.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{ActivePress gives you access to Wordpress from Ruby}
12
+ s.description = %q{
13
+ ActivePress is a set of tools that help with accessing and
14
+ manipulating the contents of a Wordpress database using Ruby.
15
+ }
16
+
17
+ s.rubyforge_project = "active_press"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+
24
+ s.add_dependency('activerecord', '> 3.0.0')
25
+
26
+ s.add_development_dependency('rspec', '~> 2.6.0')
27
+ s.add_development_dependency('shoulda-matchers')
28
+ s.add_development_dependency('factory_girl')
29
+ s.add_development_dependency('sqlite3')
30
+ end
@@ -0,0 +1,3 @@
1
+ class ActivePress::Base < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,6 @@
1
+ class ActivePress::Category < ActivePress::Base
2
+
3
+ include ActivePress::Taxonomy
4
+
5
+ default_scope where(:taxonomy => 'category')
6
+ end
@@ -0,0 +1,15 @@
1
+ class ActivePress::Comment < ActivePress::Base
2
+ set_table_name "wp_comments"
3
+ set_primary_key "comment_ID"
4
+
5
+ belongs_to :post, :foreign_key => "comment_post_ID"
6
+ belongs_to :user, :foreign_key => "user_id"
7
+ has_many :commentmetas, :foreign_key => "comment_id"
8
+
9
+ def meta
10
+ commentmetas.inject({}) do |hash, commentmeta|
11
+ hash[commentmeta.meta_key.to_sym] = commentmeta.meta_value
12
+ hash
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ class ActivePress::Commentmeta < ActivePress::Base
2
+ set_table_name "wp_commentmeta"
3
+ set_primary_key "meta_id"
4
+
5
+ belongs_to :comment, :foreign_key => "comment_id"
6
+ end
File without changes
File without changes
@@ -0,0 +1,30 @@
1
+ class ActivePress::Post < ActivePress::Base
2
+ set_table_name "wp_posts"
3
+ set_primary_key "ID"
4
+
5
+ has_many :comments, :foreign_key => "comment_post_ID"
6
+ has_many :postmetas, :foreign_key => "post_id"
7
+ has_many :term_relationships, :foreign_key => "object_id"
8
+ has_many :term_taxonomies, :through => :term_relationships
9
+ has_many :categories, :through => :term_relationships
10
+ has_many :tags, :through => :term_relationships
11
+
12
+ belongs_to :user, :foreign_key => "post_author"
13
+
14
+ scope :by_post_status, lambda {|status| where(:post_status => status) }
15
+ scope :by_post_type, lambda {|type| where(:post_type => type) }
16
+ scope :before_now, lambda { where("post_date_gmt < ?", Time.now.to_s(:db)) }
17
+ scope :published, by_post_status('publish').before_now
18
+ scope :most_recent, order("post_date_gmt DESC")
19
+
20
+ def to_param
21
+ post_name
22
+ end
23
+
24
+ def meta
25
+ postmetas.inject({}) do |hash, postmeta|
26
+ hash[postmeta.meta_key.to_sym] = postmeta.meta_value
27
+ hash
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,6 @@
1
+ class ActivePress::Postmeta < ActivePress::Base
2
+ set_table_name "wp_postmeta"
3
+ set_primary_key "meta_id"
4
+
5
+ belongs_to :post, :foreign_key => "post_id"
6
+ end
@@ -0,0 +1,5 @@
1
+ class ActivePress::Tag < ActivePress::Base
2
+ include ActivePress::Taxonomy
3
+
4
+ default_scope where(:taxonomy => 'post_tag')
5
+ end
@@ -0,0 +1,6 @@
1
+ class ActivePress::Term < ActivePress::Base
2
+ set_table_name "wp_terms"
3
+ set_primary_key "term_id"
4
+
5
+ has_one :term_taxonomy, :foreign_key => "term_id"
6
+ end
@@ -0,0 +1,8 @@
1
+ class ActivePress::TermRelationship < ActivePress::Base
2
+ set_table_name "wp_term_relationships"
3
+
4
+ belongs_to :post, :foreign_key => "object_id"
5
+ belongs_to :term_taxonomy, :foreign_key => "term_taxonomy_id"
6
+ belongs_to :category, :foreign_key => "term_taxonomy_id"
7
+ belongs_to :tag, :foreign_key => "term_taxonomy_id"
8
+ end
@@ -0,0 +1,4 @@
1
+ class ActivePress::TermTaxonomy < ActivePress::Base
2
+
3
+ include ActivePress::Taxonomy
4
+ end
@@ -0,0 +1,15 @@
1
+ class ActivePress::User < ActivePress::Base
2
+ set_table_name "wp_users"
3
+ set_primary_key "ID"
4
+
5
+ has_many :posts, :foreign_key => "post_author"
6
+ has_many :comments, :foreign_key => "user_id"
7
+ has_many :usermetas, :foreign_key => "user_id"
8
+
9
+ def meta
10
+ usermetas.inject({}) do |hash, usermeta|
11
+ hash[usermeta.meta_key.to_sym] = usermeta.meta_value
12
+ hash
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ class ActivePress::Usermeta < ActivePress::Base
2
+ set_table_name "wp_usermeta"
3
+ set_primary_key "umeta_id"
4
+
5
+ belongs_to :user, :foreign_key => "user_id"
6
+ end
@@ -0,0 +1,18 @@
1
+ module ActivePress
2
+ module Taxonomy
3
+
4
+ def self.included(base)
5
+ base.instance_eval do
6
+ set_table_name "wp_term_taxonomy"
7
+ set_primary_key "term_taxonomy_id"
8
+
9
+ belongs_to :term, :foreign_key => "term_id"
10
+ has_many :term_relationships, :foreign_key => "term_taxonomy_id"
11
+ has_many :posts, :through => :term_relationships
12
+
13
+ delegate :name, :to => :term
14
+ delegate :slug, :to => :term
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ module ActivePress
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,21 @@
1
+ require 'active_record'
2
+ require 'active_press/version'
3
+
4
+ module ActivePress
5
+ autoload :Taxonomy, 'active_press/taxonomy'
6
+
7
+ autoload :Base, 'active_press/models/base'
8
+ autoload :Category, 'active_press/models/category'
9
+ autoload :Comment, 'active_press/models/comment'
10
+ autoload :Commentmeta, 'active_press/models/commentmeta'
11
+ autoload :Link, 'active_press/models/link'
12
+ autoload :Option, 'active_press/models/option'
13
+ autoload :Post, 'active_press/models/post'
14
+ autoload :Postmeta, 'active_press/models/postmeta'
15
+ autoload :Tag, 'active_press/models/tag'
16
+ autoload :Term, 'active_press/models/term'
17
+ autoload :TermRelationship, 'active_press/models/term_relationship'
18
+ autoload :TermTaxonomy, 'active_press/models/term_taxonomy'
19
+ autoload :User, 'active_press/models/user'
20
+ autoload :Usermeta, 'active_press/models/usermeta'
21
+ end
@@ -0,0 +1,14 @@
1
+ FactoryGirl.define do
2
+ factory :post, :class => ActivePress::Post do
3
+ post_title 'Title of the post'
4
+ post_content 'Content of the post'
5
+ post_content_filtered 'Content of the post filtered'
6
+ post_excerpt 'Excerpt of the post'
7
+ to_ping false
8
+ pinged false
9
+ post_date Time.now
10
+ post_date_gmt Time.now
11
+ post_modified Time.now
12
+ post_modified_gmt Time.now
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :term, :class => ActivePress::Term do
3
+ sequence(:name) {|n| "Name #{n}" }
4
+ sequence(:slug) {|n| "slug-#{n}" }
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ FactoryGirl.define do
2
+ factory :term_taxonomy, :class => ActivePress::TermTaxonomy do
3
+ description "term taxonomy description"
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Base do
4
+
5
+ describe :superclass do
6
+ subject { ActivePress::Base.superclass }
7
+ specify { should be(ActiveRecord::Base) }
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Category do
4
+ it_should_behave_like "a Taxonomy"
5
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Comment do
4
+ it { should belong_to(:post) }
5
+ it { should belong_to(:user) }
6
+ it { should have_many(:commentmetas) }
7
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Commentmeta do
4
+ it { should belong_to(:comment) }
5
+ end
@@ -0,0 +1,50 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Post do
4
+
5
+ it { should have_many(:comments) }
6
+ it { should belong_to(:user) }
7
+ it { should have_many(:postmetas) }
8
+ it { should have_many(:term_relationships) }
9
+ it { should have_many(:term_taxonomies).through(:term_relationships) }
10
+ it { should have_many(:categories).through(:term_relationships) }
11
+ it { should have_many(:tags).through(:term_relationships) }
12
+
13
+ context :scope do
14
+
15
+ describe :by_post_status do
16
+ subject { ActivePress::Post.by_post_status('draft') }
17
+
18
+ it "should only return posts that have the same post_status" do
19
+ subject.to_sql.should include("\"post_status\" = 'draft'")
20
+ end
21
+ end
22
+
23
+ describe :by_post_type do
24
+ subject { ActivePress::Post.by_post_type('post') }
25
+
26
+ it "should only return posts that have the same post_type" do
27
+ subject.to_sql.should include("\"post_type\" = 'post'")
28
+ end
29
+ end
30
+
31
+ describe :before_now do
32
+ subject { ActivePress::Post.before_now.to_sql }
33
+ it "should only return posts that have a post_date_gmt before now" do
34
+ should include("post_date_gmt < '#{Time.now.to_s(:db)}")
35
+ end
36
+ end
37
+
38
+ describe :published do
39
+ subject { ActivePress::Post.published }
40
+
41
+ it "should only return posts that have a post_status of 'publish'" do
42
+ subject.to_sql.should include("\"post_status\" = 'publish'")
43
+ end
44
+
45
+ it "should only return posts that have a post_date before now" do
46
+ subject.to_sql.should include("post_date_gmt < '#{Time.now.to_s(:db)}'")
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Postmeta do
4
+ it { should belong_to(:post) }
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Tag do
4
+ it_should_behave_like "a Taxonomy"
5
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::TermRelationship do
4
+ it { should belong_to(:post) }
5
+ it { should belong_to(:term_taxonomy) }
6
+ it { should belong_to(:category) }
7
+ it { should belong_to(:tag) }
8
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Term do
4
+ it { should have_one(:term_taxonomy) }
5
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::TermTaxonomy do
4
+
5
+ it { should belong_to(:term) }
6
+ it { should have_many(:term_relationships) }
7
+
8
+ context "with a term" do
9
+
10
+ before(:all) {@term_taxonomy = FactoryGirl.build(:term_taxonomy, :term => FactoryGirl.build(:term))}
11
+ subject {@term_taxonomy}
12
+
13
+ describe :name do
14
+ subject {@term_taxonomy.name}
15
+ specify { should eql(@term_taxonomy.term.name) }
16
+ end
17
+
18
+ describe :slug do
19
+ subject {@term_taxonomy.slug}
20
+ specify { should eql(@term_taxonomy.term.slug) }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::User do
4
+ it { should have_many(:posts) }
5
+ it { should have_many(:comments) }
6
+ it { should have_many(:usermetas) }
7
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivePress::Usermeta do
4
+ it { should belong_to(:user) }
5
+ end
@@ -0,0 +1,16 @@
1
+ require 'active_record'
2
+ require 'logger'
3
+ require 'shoulda/matchers'
4
+ require 'factory_girl'
5
+
6
+
7
+ Dir.glob(File.dirname(__FILE__) + '/support/*') {|file| require file}
8
+
9
+ #ActiveRecord::Base.logger = Logger.new(STDOUT)
10
+ ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ":memory:")
11
+ ActiveRecord::Migration.verbose = false
12
+ load 'test_schema.rb'
13
+
14
+ require 'active_press' # always load active_press after establishing connection for tests
15
+
16
+ FactoryGirl.find_definitions
@@ -0,0 +1,5 @@
1
+ shared_examples_for "a Taxonomy" do
2
+ it { should belong_to(:term) }
3
+ it { should have_many(:term_relationships) }
4
+ it { should have_many(:posts).through(:term_relationships) }
5
+ end
@@ -0,0 +1,151 @@
1
+ ActiveRecord::Schema.define(:version => 0) do
2
+
3
+ create_table "wp_commentmeta", :primary_key => "meta_id", :force => true do |t|
4
+ t.integer "comment_id", :limit => 8, :default => 0, :null => false
5
+ t.string "meta_key"
6
+ t.text "meta_value", :limit => 2147483647
7
+ end
8
+
9
+ add_index "wp_commentmeta", ["comment_id"]
10
+ add_index "wp_commentmeta", ["meta_key"]
11
+
12
+ create_table "wp_comments", :primary_key => "comment_ID", :force => true do |t|
13
+ t.integer "comment_post_ID", :limit => 8, :default => 0, :null => false
14
+ t.text "comment_author", :limit => 255, :null => false
15
+ t.string "comment_author_email", :limit => 100, :default => "", :null => false
16
+ t.string "comment_author_url", :limit => 200, :default => "", :null => false
17
+ t.string "comment_author_IP", :limit => 100, :default => "", :null => false
18
+ t.datetime "comment_date", :null => false
19
+ t.datetime "comment_date_gmt", :null => false
20
+ t.text "comment_content", :null => false
21
+ t.integer "comment_karma", :default => 0, :null => false
22
+ t.string "comment_approved", :limit => 20, :default => "1", :null => false
23
+ t.string "comment_agent", :default => "", :null => false
24
+ t.string "comment_type", :limit => 20, :default => "", :null => false
25
+ t.integer "comment_parent", :limit => 8, :default => 0, :null => false
26
+ t.integer "user_id", :limit => 8, :default => 0, :null => false
27
+ end
28
+
29
+ add_index "wp_comments", ["comment_approved", "comment_date_gmt"]
30
+ add_index "wp_comments", ["comment_approved"]
31
+ add_index "wp_comments", ["comment_date_gmt"]
32
+ add_index "wp_comments", ["comment_parent"]
33
+ add_index "wp_comments", ["comment_post_ID"]
34
+
35
+ create_table "wp_links", :primary_key => "link_id", :force => true do |t|
36
+ t.string "link_url", :default => "", :null => false
37
+ t.string "link_name", :default => "", :null => false
38
+ t.string "link_image", :default => "", :null => false
39
+ t.string "link_target", :limit => 25, :default => "", :null => false
40
+ t.string "link_description", :default => "", :null => false
41
+ t.string "link_visible", :limit => 20, :default => "Y", :null => false
42
+ t.integer "link_owner", :limit => 8, :default => 1, :null => false
43
+ t.integer "link_rating", :default => 0, :null => false
44
+ t.datetime "link_updated", :null => false
45
+ t.string "link_rel", :default => "", :null => false
46
+ t.text "link_notes", :limit => 16777215, :null => false
47
+ t.string "link_rss", :default => "", :null => false
48
+ end
49
+
50
+ add_index "wp_links", ["link_visible"]
51
+
52
+ create_table "wp_options", :primary_key => "option_id", :force => true do |t|
53
+ t.integer "blog_id", :default => 0, :null => false
54
+ t.string "option_name", :limit => 64, :default => "", :null => false
55
+ t.text "option_value", :limit => 2147483647, :null => false
56
+ t.string "autoload", :limit => 20, :default => "yes", :null => false
57
+ end
58
+
59
+ add_index "wp_options", ["option_name"], :unique => true
60
+
61
+ create_table "wp_postmeta", :primary_key => "meta_id", :force => true do |t|
62
+ t.integer "post_id", :limit => 8, :default => 0, :null => false
63
+ t.string "meta_key"
64
+ t.text "meta_value", :limit => 2147483647
65
+ end
66
+
67
+ add_index "wp_postmeta", ["meta_key"]
68
+ add_index "wp_postmeta", ["post_id"]
69
+
70
+ create_table "wp_posts", :primary_key => "ID", :force => true do |t|
71
+ t.integer "post_author", :limit => 8, :default => 0, :null => false
72
+ t.datetime "post_date", :null => false
73
+ t.datetime "post_date_gmt", :null => false
74
+ t.text "post_content", :limit => 2147483647, :null => false
75
+ t.text "post_title", :null => false
76
+ t.text "post_excerpt", :null => false
77
+ t.string "post_status", :limit => 20, :default => "publish", :null => false
78
+ t.string "comment_status", :limit => 20, :default => "open", :null => false
79
+ t.string "ping_status", :limit => 20, :default => "open", :null => false
80
+ t.string "post_password", :limit => 20, :default => "", :null => false
81
+ t.string "post_name", :limit => 200, :default => "", :null => false
82
+ t.text "to_ping", :null => false
83
+ t.text "pinged", :null => false
84
+ t.datetime "post_modified", :null => false
85
+ t.datetime "post_modified_gmt", :null => false
86
+ t.text "post_content_filtered", :null => false
87
+ t.integer "post_parent", :limit => 8, :default => 0, :null => false
88
+ t.string "guid", :default => "", :null => false
89
+ t.integer "menu_order", :default => 0, :null => false
90
+ t.string "post_type", :limit => 20, :default => "post", :null => false
91
+ t.string "post_mime_type", :limit => 100, :default => "", :null => false
92
+ t.integer "comment_count", :limit => 8, :default => 0, :null => false
93
+ end
94
+
95
+ add_index "wp_posts", ["post_author"]
96
+ add_index "wp_posts", ["post_name"]
97
+ add_index "wp_posts", ["post_parent"]
98
+ add_index "wp_posts", ["post_type", "post_status", "post_date", "ID"]
99
+
100
+ create_table "wp_term_relationships", :id => false, :force => true do |t|
101
+ t.integer "object_id", :limit => 8, :default => 0, :null => false
102
+ t.integer "term_taxonomy_id", :limit => 8, :default => 0, :null => false
103
+ t.integer "term_order", :default => 0, :null => false
104
+ end
105
+
106
+ add_index "wp_term_relationships", ["term_taxonomy_id"]
107
+
108
+ create_table "wp_term_taxonomy", :primary_key => "term_taxonomy_id", :force => true do |t|
109
+ t.integer "term_id", :limit => 8, :default => 0, :null => false
110
+ t.string "taxonomy", :limit => 32, :default => "", :null => false
111
+ t.text "description", :limit => 2147483647, :null => false
112
+ t.integer "parent", :limit => 8, :default => 0, :null => false
113
+ t.integer "count", :limit => 8, :default => 0, :null => false
114
+ end
115
+
116
+ add_index "wp_term_taxonomy", ["taxonomy"]
117
+ add_index "wp_term_taxonomy", ["term_id", "taxonomy"], :unique => true
118
+
119
+ create_table "wp_terms", :primary_key => "term_id", :force => true do |t|
120
+ t.string "name", :limit => 200, :default => "", :null => false
121
+ t.string "slug", :limit => 200, :default => "", :null => false
122
+ t.integer "term_group", :limit => 8, :default => 0, :null => false
123
+ end
124
+
125
+ add_index "wp_terms", ["name"]
126
+ add_index "wp_terms", ["slug"], :unique => true
127
+
128
+ create_table "wp_usermeta", :primary_key => "umeta_id", :force => true do |t|
129
+ t.integer "user_id", :limit => 8, :default => 0, :null => false
130
+ t.string "meta_key"
131
+ t.text "meta_value", :limit => 2147483647
132
+ end
133
+
134
+ add_index "wp_usermeta", ["meta_key"]
135
+ add_index "wp_usermeta", ["user_id"]
136
+
137
+ create_table "wp_users", :primary_key => "ID", :force => true do |t|
138
+ t.string "user_login", :limit => 60, :default => "", :null => false
139
+ t.string "user_pass", :limit => 64, :default => "", :null => false
140
+ t.string "user_nicename", :limit => 50, :default => "", :null => false
141
+ t.string "user_email", :limit => 100, :default => "", :null => false
142
+ t.string "user_url", :limit => 100, :default => "", :null => false
143
+ t.datetime "user_registered", :null => false
144
+ t.string "user_activation_key", :limit => 60, :default => "", :null => false
145
+ t.integer "user_status", :default => 0, :null => false
146
+ t.string "display_name", :limit => 250, :default => "", :null => false
147
+ end
148
+
149
+ add_index "wp_users", ["user_login"]
150
+ add_index "wp_users", ["user_nicename"]
151
+ end
metadata ADDED
@@ -0,0 +1,163 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: active_press
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Robert Williams
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-10-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activerecord
16
+ requirement: &70279569484140 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>'
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70279569484140
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ requirement: &70279569483340 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 2.6.0
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70279569483340
36
+ - !ruby/object:Gem::Dependency
37
+ name: shoulda-matchers
38
+ requirement: &70279569482800 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70279569482800
47
+ - !ruby/object:Gem::Dependency
48
+ name: factory_girl
49
+ requirement: &70279569481960 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70279569481960
58
+ - !ruby/object:Gem::Dependency
59
+ name: sqlite3
60
+ requirement: &70279569481360 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70279569481360
69
+ description: ! "\n ActivePress is a set of tools that help with accessing and\n
70
+ \ manipulating the contents of a Wordpress database using Ruby.\n "
71
+ email:
72
+ - rob@r-williams.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - .rspec
79
+ - .rvmrc
80
+ - .travis.yml
81
+ - Gemfile
82
+ - Guardfile
83
+ - README.md
84
+ - Rakefile
85
+ - active_press.gemspec
86
+ - lib/active_press.rb
87
+ - lib/active_press/models/base.rb
88
+ - lib/active_press/models/category.rb
89
+ - lib/active_press/models/comment.rb
90
+ - lib/active_press/models/commentmeta.rb
91
+ - lib/active_press/models/link.rb
92
+ - lib/active_press/models/option.rb
93
+ - lib/active_press/models/post.rb
94
+ - lib/active_press/models/postmeta.rb
95
+ - lib/active_press/models/tag.rb
96
+ - lib/active_press/models/term.rb
97
+ - lib/active_press/models/term_relationship.rb
98
+ - lib/active_press/models/term_taxonomy.rb
99
+ - lib/active_press/models/user.rb
100
+ - lib/active_press/models/usermeta.rb
101
+ - lib/active_press/taxonomy.rb
102
+ - lib/active_press/version.rb
103
+ - spec/factories/post_factory.rb
104
+ - spec/factories/term_factory.rb
105
+ - spec/factories/term_taxonomy_factory.rb
106
+ - spec/models/base_spec.rb
107
+ - spec/models/category_spec.rb
108
+ - spec/models/comment_spec.rb
109
+ - spec/models/commentmeta_spec.rb
110
+ - spec/models/post_spec.rb
111
+ - spec/models/postmeta_spec.rb
112
+ - spec/models/tag_spec.rb
113
+ - spec/models/term_relationship_spec.rb
114
+ - spec/models/term_spec.rb
115
+ - spec/models/term_taxonomy_spec.rb
116
+ - spec/models/user_spec.rb
117
+ - spec/models/usermeta_spec.rb
118
+ - spec/spec_helper.rb
119
+ - spec/support/taxonomy_shared_example.rb
120
+ - spec/test_schema.rb
121
+ homepage: ''
122
+ licenses: []
123
+ post_install_message:
124
+ rdoc_options: []
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ requirements: []
140
+ rubyforge_project: active_press
141
+ rubygems_version: 1.8.6
142
+ signing_key:
143
+ specification_version: 3
144
+ summary: ActivePress gives you access to Wordpress from Ruby
145
+ test_files:
146
+ - spec/factories/post_factory.rb
147
+ - spec/factories/term_factory.rb
148
+ - spec/factories/term_taxonomy_factory.rb
149
+ - spec/models/base_spec.rb
150
+ - spec/models/category_spec.rb
151
+ - spec/models/comment_spec.rb
152
+ - spec/models/commentmeta_spec.rb
153
+ - spec/models/post_spec.rb
154
+ - spec/models/postmeta_spec.rb
155
+ - spec/models/tag_spec.rb
156
+ - spec/models/term_relationship_spec.rb
157
+ - spec/models/term_spec.rb
158
+ - spec/models/term_taxonomy_spec.rb
159
+ - spec/models/user_spec.rb
160
+ - spec/models/usermeta_spec.rb
161
+ - spec/spec_helper.rb
162
+ - spec/support/taxonomy_shared_example.rb
163
+ - spec/test_schema.rb