rails_wordpress 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +7 -0
  2. data/Guardfile +77 -0
  3. data/LICENSE +22 -0
  4. data/Rakefile +28 -0
  5. data/app/assets/javascripts/wordpress/application.js +13 -0
  6. data/app/assets/stylesheets/wordpress/application.css +15 -0
  7. data/app/controllers/wordpress/application_controller.rb +4 -0
  8. data/app/helpers/wordpress/application_helper.rb +4 -0
  9. data/app/models/wordpress/attachment.rb +7 -0
  10. data/app/models/wordpress/category.rb +18 -0
  11. data/app/models/wordpress/link_category.rb +4 -0
  12. data/app/models/wordpress/page.rb +4 -0
  13. data/app/models/wordpress/post.rb +4 -0
  14. data/app/models/wordpress/post_tag.rb +14 -0
  15. data/app/models/wordpress/relationship.rb +26 -0
  16. data/app/models/wordpress/revision.rb +4 -0
  17. data/app/models/wordpress/taxonomy.rb +56 -0
  18. data/app/models/wordpress/term.rb +19 -0
  19. data/app/models/wordpress/user.rb +7 -0
  20. data/app/models/wordpress/wp_post.rb +195 -0
  21. data/app/views/layouts/wordpress/application.html.erb +14 -0
  22. data/config/routes.rb +2 -0
  23. data/lib/rails_wordpress/engine.rb +18 -0
  24. data/lib/rails_wordpress/version.rb +3 -0
  25. data/lib/rails_wordpress.rb +4 -0
  26. data/lib/tasks/word_press_tasks.rake +4 -0
  27. data/spec/dummy/README.rdoc +28 -0
  28. data/spec/dummy/Rakefile +6 -0
  29. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  30. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  31. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  32. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  33. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  34. data/spec/dummy/bin/bundle +3 -0
  35. data/spec/dummy/bin/rails +4 -0
  36. data/spec/dummy/bin/rake +4 -0
  37. data/spec/dummy/bin/setup +29 -0
  38. data/spec/dummy/config/application.rb +26 -0
  39. data/spec/dummy/config/boot.rb +5 -0
  40. data/spec/dummy/config/database.yml +24 -0
  41. data/spec/dummy/config/environment.rb +5 -0
  42. data/spec/dummy/config/environments/development.rb +41 -0
  43. data/spec/dummy/config/environments/production.rb +79 -0
  44. data/spec/dummy/config/environments/test.rb +42 -0
  45. data/spec/dummy/config/initializers/assets.rb +11 -0
  46. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  48. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  49. data/spec/dummy/config/initializers/inflections.rb +16 -0
  50. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  51. data/spec/dummy/config/initializers/session_store.rb +3 -0
  52. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  53. data/spec/dummy/config/locales/en.yml +23 -0
  54. data/spec/dummy/config/routes.rb +3 -0
  55. data/spec/dummy/config/secrets.yml +22 -0
  56. data/spec/dummy/config.ru +4 -0
  57. data/spec/dummy/db/schema.rb +164 -0
  58. data/spec/dummy/db/test.sqlite3 +0 -0
  59. data/spec/dummy/log/development.log +636 -0
  60. data/spec/dummy/log/test.log +6427 -0
  61. data/spec/dummy/public/404.html +67 -0
  62. data/spec/dummy/public/422.html +67 -0
  63. data/spec/dummy/public/500.html +66 -0
  64. data/spec/dummy/public/favicon.ico +0 -0
  65. data/spec/factories/attachment_factory.rb +11 -0
  66. data/spec/factories/category_factory.rb +9 -0
  67. data/spec/factories/link_category_factory.rb +6 -0
  68. data/spec/factories/page_factory.rb +11 -0
  69. data/spec/factories/post_factory.rb +19 -0
  70. data/spec/factories/post_tag_factory.rb +9 -0
  71. data/spec/factories/relationship_factory.rb +4 -0
  72. data/spec/factories/revision_factory.rb +12 -0
  73. data/spec/factories/taxonomy_factory.rb +6 -0
  74. data/spec/factories/term_factory.rb +5 -0
  75. data/spec/factories/user_factory.rb +6 -0
  76. data/spec/factories/wp_post_factory.rb +11 -0
  77. data/spec/models/wordpress/attachment_spec.rb +7 -0
  78. data/spec/models/wordpress/category_spec.rb +32 -0
  79. data/spec/models/wordpress/link_category_spec.rb +7 -0
  80. data/spec/models/wordpress/page_spec.rb +31 -0
  81. data/spec/models/wordpress/post_spec.rb +88 -0
  82. data/spec/models/wordpress/post_tag_spec.rb +21 -0
  83. data/spec/models/wordpress/relationship_spec.rb +38 -0
  84. data/spec/models/wordpress/revision_spec.rb +87 -0
  85. data/spec/models/wordpress/taxonomy_spec.rb +13 -0
  86. data/spec/models/wordpress/term_spec.rb +11 -0
  87. data/spec/models/wordpress/user_spec.rb +25 -0
  88. data/spec/models/wordpress/wp_post_spec.rb +9 -0
  89. data/spec/rails_helper.rb +15 -0
  90. data/spec/spec_helper.rb +19 -0
  91. data/spec/support/database_cleaner.rb +25 -0
  92. metadata +313 -0
@@ -0,0 +1,25 @@
1
+ require 'rails_helper'
2
+
3
+ module Wordpress
4
+ RSpec.describe User, type: :model do
5
+ let(:user) { create :post_author }
6
+ let(:post1) { create :post }
7
+ let(:post2) { create :post }
8
+
9
+ it "can instantiate" do
10
+ expect(user.user_login).to eq "snoopy"
11
+ end
12
+
13
+ it "has an author for a post" do
14
+ user
15
+ expect(post1.author).to eq user
16
+ end
17
+
18
+ it "has many posts for the user" do
19
+ user
20
+ post1
21
+ post2
22
+ expect(user.posts).to eq [post1, post2]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ require 'rails_helper'
2
+
3
+ module Wordpress
4
+ RSpec.describe Wordpress::WpPost, type: :model do
5
+ it "instantiates" do
6
+ expect(create :wp_post).to be_kind_of Wordpress::WpPost
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV['RAILS_ENV'] ||= 'test'
3
+ require 'spec_helper'
4
+
5
+ ActiveRecord::Migration.maintain_test_schema!
6
+
7
+ RSpec.configure do |config|
8
+ config.include FactoryGirl::Syntax::Methods
9
+ config.before(:suite) do
10
+ # FactoryGirl.lint
11
+ end
12
+
13
+ config.use_transactional_fixtures = false
14
+ config.infer_spec_type_from_file_location!
15
+ end
@@ -0,0 +1,19 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+
3
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
+ require 'rspec/rails'
5
+ require 'rspec/its'
6
+ require 'factory_girl'
7
+
8
+ Rails.backtrace_cleaner.remove_silencers!
9
+
10
+ RSpec.configure do |config|
11
+ config.mock_with :rspec
12
+ config.use_transactional_fixtures = true
13
+ config.infer_base_class_for_anonymous_controllers = false
14
+ config.order = "random"
15
+ end
16
+
17
+ Dir["#{File.dirname(__FILE__)}/support/*.rb"].each { |f| require f }
18
+ Dir["#{File.dirname(__FILE__)}/factories/*.rb"].each { |f| require f }
19
+
@@ -0,0 +1,25 @@
1
+ require 'database_cleaner'
2
+
3
+ RSpec.configure do |config|
4
+
5
+ config.before(:suite) do
6
+ DatabaseCleaner.clean_with(:deletion)
7
+ end
8
+
9
+ config.before(:each) do
10
+ DatabaseCleaner.strategy = :transaction
11
+ end
12
+
13
+ config.before(:each, :js => true) do
14
+ DatabaseCleaner.strategy = :truncation
15
+ end
16
+
17
+ config.before(:each) do
18
+ DatabaseCleaner.start
19
+ end
20
+
21
+ config.after(:each) do
22
+ DatabaseCleaner.clean
23
+ end
24
+
25
+ end
metadata ADDED
@@ -0,0 +1,313 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_wordpress
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Michael Lang
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: mysql2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.2'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-its
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: factory_girl
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '4.5'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '4.5'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.7'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.7'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '4.5'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '4.5'
111
+ - !ruby/object:Gem::Dependency
112
+ name: database_cleaner
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.4'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.4'
125
+ description: A Rails Engine that enables you to easily wire up a Rails app to an existing
126
+ Wordpress database
127
+ email:
128
+ - mwlang@cybrains.net
129
+ executables: []
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - Guardfile
134
+ - LICENSE
135
+ - Rakefile
136
+ - app/assets/javascripts/wordpress/application.js
137
+ - app/assets/stylesheets/wordpress/application.css
138
+ - app/controllers/wordpress/application_controller.rb
139
+ - app/helpers/wordpress/application_helper.rb
140
+ - app/models/wordpress/attachment.rb
141
+ - app/models/wordpress/category.rb
142
+ - app/models/wordpress/link_category.rb
143
+ - app/models/wordpress/page.rb
144
+ - app/models/wordpress/post.rb
145
+ - app/models/wordpress/post_tag.rb
146
+ - app/models/wordpress/relationship.rb
147
+ - app/models/wordpress/revision.rb
148
+ - app/models/wordpress/taxonomy.rb
149
+ - app/models/wordpress/term.rb
150
+ - app/models/wordpress/user.rb
151
+ - app/models/wordpress/wp_post.rb
152
+ - app/views/layouts/wordpress/application.html.erb
153
+ - config/routes.rb
154
+ - lib/rails_wordpress.rb
155
+ - lib/rails_wordpress/engine.rb
156
+ - lib/rails_wordpress/version.rb
157
+ - lib/tasks/word_press_tasks.rake
158
+ - spec/dummy/README.rdoc
159
+ - spec/dummy/Rakefile
160
+ - spec/dummy/app/assets/javascripts/application.js
161
+ - spec/dummy/app/assets/stylesheets/application.css
162
+ - spec/dummy/app/controllers/application_controller.rb
163
+ - spec/dummy/app/helpers/application_helper.rb
164
+ - spec/dummy/app/views/layouts/application.html.erb
165
+ - spec/dummy/bin/bundle
166
+ - spec/dummy/bin/rails
167
+ - spec/dummy/bin/rake
168
+ - spec/dummy/bin/setup
169
+ - spec/dummy/config.ru
170
+ - spec/dummy/config/application.rb
171
+ - spec/dummy/config/boot.rb
172
+ - spec/dummy/config/database.yml
173
+ - spec/dummy/config/environment.rb
174
+ - spec/dummy/config/environments/development.rb
175
+ - spec/dummy/config/environments/production.rb
176
+ - spec/dummy/config/environments/test.rb
177
+ - spec/dummy/config/initializers/assets.rb
178
+ - spec/dummy/config/initializers/backtrace_silencers.rb
179
+ - spec/dummy/config/initializers/cookies_serializer.rb
180
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
181
+ - spec/dummy/config/initializers/inflections.rb
182
+ - spec/dummy/config/initializers/mime_types.rb
183
+ - spec/dummy/config/initializers/session_store.rb
184
+ - spec/dummy/config/initializers/wrap_parameters.rb
185
+ - spec/dummy/config/locales/en.yml
186
+ - spec/dummy/config/routes.rb
187
+ - spec/dummy/config/secrets.yml
188
+ - spec/dummy/db/schema.rb
189
+ - spec/dummy/db/test.sqlite3
190
+ - spec/dummy/log/development.log
191
+ - spec/dummy/log/test.log
192
+ - spec/dummy/public/404.html
193
+ - spec/dummy/public/422.html
194
+ - spec/dummy/public/500.html
195
+ - spec/dummy/public/favicon.ico
196
+ - spec/factories/attachment_factory.rb
197
+ - spec/factories/category_factory.rb
198
+ - spec/factories/link_category_factory.rb
199
+ - spec/factories/page_factory.rb
200
+ - spec/factories/post_factory.rb
201
+ - spec/factories/post_tag_factory.rb
202
+ - spec/factories/relationship_factory.rb
203
+ - spec/factories/revision_factory.rb
204
+ - spec/factories/taxonomy_factory.rb
205
+ - spec/factories/term_factory.rb
206
+ - spec/factories/user_factory.rb
207
+ - spec/factories/wp_post_factory.rb
208
+ - spec/models/wordpress/attachment_spec.rb
209
+ - spec/models/wordpress/category_spec.rb
210
+ - spec/models/wordpress/link_category_spec.rb
211
+ - spec/models/wordpress/page_spec.rb
212
+ - spec/models/wordpress/post_spec.rb
213
+ - spec/models/wordpress/post_tag_spec.rb
214
+ - spec/models/wordpress/relationship_spec.rb
215
+ - spec/models/wordpress/revision_spec.rb
216
+ - spec/models/wordpress/taxonomy_spec.rb
217
+ - spec/models/wordpress/term_spec.rb
218
+ - spec/models/wordpress/user_spec.rb
219
+ - spec/models/wordpress/wp_post_spec.rb
220
+ - spec/rails_helper.rb
221
+ - spec/spec_helper.rb
222
+ - spec/support/database_cleaner.rb
223
+ homepage: https://github.com/mwlang/rails_wordpress
224
+ licenses:
225
+ - MIT
226
+ metadata: {}
227
+ post_install_message:
228
+ rdoc_options: []
229
+ require_paths:
230
+ - lib
231
+ required_ruby_version: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: '0'
236
+ required_rubygems_version: !ruby/object:Gem::Requirement
237
+ requirements:
238
+ - - ">="
239
+ - !ruby/object:Gem::Version
240
+ version: '0'
241
+ requirements: []
242
+ rubyforge_project:
243
+ rubygems_version: 2.4.6
244
+ signing_key:
245
+ specification_version: 4
246
+ summary: A Rails Engine to connect to Wordpress tables with ActiveRecord modeling
247
+ test_files:
248
+ - spec/dummy/app/assets/javascripts/application.js
249
+ - spec/dummy/app/assets/stylesheets/application.css
250
+ - spec/dummy/app/controllers/application_controller.rb
251
+ - spec/dummy/app/helpers/application_helper.rb
252
+ - spec/dummy/app/views/layouts/application.html.erb
253
+ - spec/dummy/bin/bundle
254
+ - spec/dummy/bin/rails
255
+ - spec/dummy/bin/rake
256
+ - spec/dummy/bin/setup
257
+ - spec/dummy/config/application.rb
258
+ - spec/dummy/config/boot.rb
259
+ - spec/dummy/config/database.yml
260
+ - spec/dummy/config/environment.rb
261
+ - spec/dummy/config/environments/development.rb
262
+ - spec/dummy/config/environments/production.rb
263
+ - spec/dummy/config/environments/test.rb
264
+ - spec/dummy/config/initializers/assets.rb
265
+ - spec/dummy/config/initializers/backtrace_silencers.rb
266
+ - spec/dummy/config/initializers/cookies_serializer.rb
267
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
268
+ - spec/dummy/config/initializers/inflections.rb
269
+ - spec/dummy/config/initializers/mime_types.rb
270
+ - spec/dummy/config/initializers/session_store.rb
271
+ - spec/dummy/config/initializers/wrap_parameters.rb
272
+ - spec/dummy/config/locales/en.yml
273
+ - spec/dummy/config/routes.rb
274
+ - spec/dummy/config/secrets.yml
275
+ - spec/dummy/config.ru
276
+ - spec/dummy/db/schema.rb
277
+ - spec/dummy/db/test.sqlite3
278
+ - spec/dummy/log/development.log
279
+ - spec/dummy/log/test.log
280
+ - spec/dummy/public/404.html
281
+ - spec/dummy/public/422.html
282
+ - spec/dummy/public/500.html
283
+ - spec/dummy/public/favicon.ico
284
+ - spec/dummy/Rakefile
285
+ - spec/dummy/README.rdoc
286
+ - spec/factories/attachment_factory.rb
287
+ - spec/factories/category_factory.rb
288
+ - spec/factories/link_category_factory.rb
289
+ - spec/factories/page_factory.rb
290
+ - spec/factories/post_factory.rb
291
+ - spec/factories/post_tag_factory.rb
292
+ - spec/factories/relationship_factory.rb
293
+ - spec/factories/revision_factory.rb
294
+ - spec/factories/taxonomy_factory.rb
295
+ - spec/factories/term_factory.rb
296
+ - spec/factories/user_factory.rb
297
+ - spec/factories/wp_post_factory.rb
298
+ - spec/models/wordpress/attachment_spec.rb
299
+ - spec/models/wordpress/category_spec.rb
300
+ - spec/models/wordpress/link_category_spec.rb
301
+ - spec/models/wordpress/page_spec.rb
302
+ - spec/models/wordpress/post_spec.rb
303
+ - spec/models/wordpress/post_tag_spec.rb
304
+ - spec/models/wordpress/relationship_spec.rb
305
+ - spec/models/wordpress/revision_spec.rb
306
+ - spec/models/wordpress/taxonomy_spec.rb
307
+ - spec/models/wordpress/term_spec.rb
308
+ - spec/models/wordpress/user_spec.rb
309
+ - spec/models/wordpress/wp_post_spec.rb
310
+ - spec/rails_helper.rb
311
+ - spec/spec_helper.rb
312
+ - spec/support/database_cleaner.rb
313
+ has_rdoc: