pliable 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/.bundle/install.log +1575 -0
  2. data/.document +3 -0
  3. data/.travis.yml +16 -0
  4. data/.yardopts +1 -0
  5. data/ChangeLog.md +4 -0
  6. data/Gemfile +7 -0
  7. data/Gemfile.lock +134 -0
  8. data/LICENSE.txt +20 -0
  9. data/README.md +287 -0
  10. data/Rakefile +39 -0
  11. data/lib/generators/pliable/model_generator.rb +40 -0
  12. data/lib/generators/pliable/templates/migration.rb +24 -0
  13. data/lib/pliable/configure.rb +12 -0
  14. data/lib/pliable/ply.rb +89 -0
  15. data/lib/pliable/ply_relation.rb +4 -0
  16. data/lib/pliable/text_helper.rb +3 -0
  17. data/lib/pliable/version.rb +4 -0
  18. data/lib/pliable.rb +17 -0
  19. data/pliable.gemspec +35 -0
  20. data/spec/.DS_Store +0 -0
  21. data/spec/dummy/README.rdoc +261 -0
  22. data/spec/dummy/Rakefile +7 -0
  23. data/spec/dummy/app/models/.gitkeep +0 -0
  24. data/spec/dummy/app/models/invoice.rb +6 -0
  25. data/spec/dummy/app/models/line_item.rb +5 -0
  26. data/spec/dummy/app/models/merchandise.rb +5 -0
  27. data/spec/dummy/app/models/ply.rb +7 -0
  28. data/spec/dummy/config/application.rb +65 -0
  29. data/spec/dummy/config/boot.rb +10 -0
  30. data/spec/dummy/config/database.yml +19 -0
  31. data/spec/dummy/config/environment.rb +5 -0
  32. data/spec/dummy/config/environments/development.rb +37 -0
  33. data/spec/dummy/config/environments/production.rb +67 -0
  34. data/spec/dummy/config/environments/test.rb +37 -0
  35. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  36. data/spec/dummy/config/initializers/inflections.rb +15 -0
  37. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  38. data/spec/dummy/config/initializers/pliable.rb +5 -0
  39. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  40. data/spec/dummy/config/initializers/session_store.rb +8 -0
  41. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  42. data/spec/dummy/config/locales/en.yml +5 -0
  43. data/spec/dummy/config/routes.rb +58 -0
  44. data/spec/dummy/config.ru +4 -0
  45. data/spec/dummy/db/migrate/.DS_Store +0 -0
  46. data/spec/dummy/db/migrate/20140117210156_create_plies_and_ply_relations.rb +23 -0
  47. data/spec/dummy/db/migration_helper.rb +42 -0
  48. data/spec/dummy/db/schema.rb +39 -0
  49. data/spec/dummy/db/seeds.rb +17 -0
  50. data/spec/dummy/db/static/bottles.csv +201 -0
  51. data/spec/dummy/db/static/varietal_aliases.csv +433 -0
  52. data/spec/dummy/db/static/varietals.csv +295 -0
  53. data/spec/dummy/lib/assets/.gitkeep +0 -0
  54. data/spec/dummy/log/.gitkeep +0 -0
  55. data/spec/dummy/log/development.log +63 -0
  56. data/spec/dummy/log/test.log +2339 -0
  57. data/spec/dummy/public/404.html +26 -0
  58. data/spec/dummy/public/422.html +26 -0
  59. data/spec/dummy/public/500.html +25 -0
  60. data/spec/dummy/public/favicon.ico +0 -0
  61. data/spec/dummy/script/rails +6 -0
  62. data/spec/dummy/spec/fixtures/varietals.yml +2135 -0
  63. data/spec/dummy/spec/models/.DS_Store +0 -0
  64. data/spec/dummy/spec/models/fake_ply_test.rb +12 -0
  65. data/spec/dummy/spec/models/ply_relation_spec.rb +12 -0
  66. data/spec/dummy/spec/pliable_integartion_spec.rb +48 -0
  67. data/spec/dummy/spec/tmp/app/models/foo_alias.rb +4 -0
  68. data/spec/spec_helper.rb +36 -0
  69. data/sub +4 -0
  70. metadata +389 -0
Binary file
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+
3
+ describe Ply do
4
+ before do
5
+ @ply = FakePly.new
6
+ end
7
+
8
+ it "must be valid" do
9
+ # @ply.valid?.must_equal true
10
+ @ply.save.must_equal true
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+
3
+ describe PlyRelation do
4
+ before do
5
+ @ply_relation = PlyRelation.new
6
+ end
7
+
8
+ it "must be valid" do
9
+ @ply_relation.save.should be_true
10
+ @ply_relation.reload.should be_true
11
+ end
12
+ end
@@ -0,0 +1,48 @@
1
+ require "spec_helper"
2
+
3
+ describe Invoice do
4
+ describe "after save and reinitializing" do
5
+ before do
6
+ @invoice = Invoice.create!(
7
+ oid: "r@nd0m1d000",
8
+ otype: "Invoice__c",
9
+ data: {
10
+ "Id"=>"r@nd0m1d111",
11
+ "IsDeleted"=>false,
12
+ "Name"=>"INV-0000"
13
+ },
14
+ last_modified: "2014-01-19 07:48:35",
15
+ last_checked: "2014-01-19 07:48:35"
16
+ )
17
+
18
+ @line_item = Ply.create!(
19
+ oid: "a01i0000007kDbrAAE",
20
+ otype: "Line_Item__c",
21
+ data: {
22
+ "Id"=>"a01i0000007kDbrAAE",
23
+ "IsDeleted"=>false,
24
+ "Name"=>"i"
25
+ },
26
+ last_modified: "2014-01-19 07:48:36",
27
+ last_checked: "2014-01-19 07:48:36"
28
+ )
29
+
30
+ @ply_relation = PlyRelation.create!(
31
+ child_id: @line_item.id,
32
+ child_type: @line_item.otype,
33
+ parent_id: @invoice.id,
34
+ parent_type: @invoice.otype
35
+ )
36
+ end
37
+
38
+ it "should have all kinds of AR jazz" do
39
+ @invoice = Invoice.first
40
+ @invoice.line_items.first.id == @line_item.id
41
+ Invoice.all.should === [@invoice]
42
+ Invoice.where(last_modified: "2014-01-19 07:48:35").should eq [@invoice]
43
+ Invoice.first.should eq @invoice
44
+ Ply.all.count.should be > Invoice.all.count
45
+ LineItem.first.should_not eq Invoice.first
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,4 @@
1
+ class FooAlias < ActiveRecord::Base
2
+ # database trigger maintains *_tsquery versions
3
+ attr_accessible :original, :substitution
4
+ end
@@ -0,0 +1,36 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+ require "active_record"
7
+ require "pry"
8
+ require "pry-debugger"
9
+ require "database_cleaner"
10
+
11
+ #grr-can't make this work quickly
12
+ Dir.glob("spec/dummy/spec/factories/*.rb").each do |file|
13
+ puts "loading #{file}"
14
+ load "#{file}"
15
+ end
16
+ Rails.backtrace_cleaner.remove_silencers!
17
+
18
+ # force include of our gem
19
+
20
+ RSpec.configure do |config|
21
+ config.treat_symbols_as_metadata_keys_with_true_values = true
22
+
23
+ config.before(:suite) do
24
+ DatabaseCleaner.strategy = :transaction
25
+ DatabaseCleaner.clean_with(:truncation)
26
+ end
27
+
28
+ config.before(:each) do
29
+ DatabaseCleaner.start
30
+ end
31
+
32
+ config.after(:each) do
33
+ DatabaseCleaner.clean
34
+ end
35
+ end
36
+
data/sub ADDED
@@ -0,0 +1,4 @@
1
+ Gemfile.lock
2
+ doc/
3
+ pkg/
4
+ vendor/cache/*.gem
metadata ADDED
@@ -0,0 +1,389 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pliable
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.1.0
6
+ platform: ruby
7
+ authors:
8
+ - Mike Piccolo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-01-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '4.0'
22
+ requirement: !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '4.0'
28
+ type: :runtime
29
+ prerelease: false
30
+ - !ruby/object:Gem::Dependency
31
+ name: pg
32
+ version_requirements: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirement: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ - !ruby/object:Gem::Dependency
47
+ name: bundler
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
54
+ requirement: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ version: '1.0'
60
+ type: :development
61
+ prerelease: false
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '0.8'
70
+ requirement: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '0.8'
76
+ type: :development
77
+ prerelease: false
78
+ - !ruby/object:Gem::Dependency
79
+ name: minitest
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: 4.7.5
86
+ requirement: !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: 4.7.5
92
+ type: :development
93
+ prerelease: false
94
+ - !ruby/object:Gem::Dependency
95
+ name: mocha
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 1.0.0
102
+ requirement: !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ~>
106
+ - !ruby/object:Gem::Version
107
+ version: 1.0.0
108
+ type: :development
109
+ prerelease: false
110
+ - !ruby/object:Gem::Dependency
111
+ name: pry
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 0.9.12
118
+ requirement: !ruby/object:Gem::Requirement
119
+ none: false
120
+ requirements:
121
+ - - ~>
122
+ - !ruby/object:Gem::Version
123
+ version: 0.9.12
124
+ type: :development
125
+ prerelease: false
126
+ - !ruby/object:Gem::Dependency
127
+ name: pry-debugger
128
+ version_requirements: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ version: '0.2'
134
+ requirement: !ruby/object:Gem::Requirement
135
+ none: false
136
+ requirements:
137
+ - - ~>
138
+ - !ruby/object:Gem::Version
139
+ version: '0.2'
140
+ type: :development
141
+ prerelease: false
142
+ - !ruby/object:Gem::Dependency
143
+ name: rubygems-tasks
144
+ version_requirements: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ~>
148
+ - !ruby/object:Gem::Version
149
+ version: '0.2'
150
+ requirement: !ruby/object:Gem::Requirement
151
+ none: false
152
+ requirements:
153
+ - - ~>
154
+ - !ruby/object:Gem::Version
155
+ version: '0.2'
156
+ type: :development
157
+ prerelease: false
158
+ - !ruby/object:Gem::Dependency
159
+ name: yard
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ~>
164
+ - !ruby/object:Gem::Version
165
+ version: '0.8'
166
+ requirement: !ruby/object:Gem::Requirement
167
+ none: false
168
+ requirements:
169
+ - - ~>
170
+ - !ruby/object:Gem::Version
171
+ version: '0.8'
172
+ type: :development
173
+ prerelease: false
174
+ - !ruby/object:Gem::Dependency
175
+ name: rails
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '4.0'
182
+ requirement: !ruby/object:Gem::Requirement
183
+ none: false
184
+ requirements:
185
+ - - ! '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '4.0'
188
+ type: :development
189
+ prerelease: false
190
+ - !ruby/object:Gem::Dependency
191
+ name: pg
192
+ version_requirements: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ~>
196
+ - !ruby/object:Gem::Version
197
+ version: 0.17.1
198
+ requirement: !ruby/object:Gem::Requirement
199
+ none: false
200
+ requirements:
201
+ - - ~>
202
+ - !ruby/object:Gem::Version
203
+ version: 0.17.1
204
+ type: :development
205
+ prerelease: false
206
+ - !ruby/object:Gem::Dependency
207
+ name: rspec
208
+ version_requirements: !ruby/object:Gem::Requirement
209
+ none: false
210
+ requirements:
211
+ - - ~>
212
+ - !ruby/object:Gem::Version
213
+ version: '2.14'
214
+ requirement: !ruby/object:Gem::Requirement
215
+ none: false
216
+ requirements:
217
+ - - ~>
218
+ - !ruby/object:Gem::Version
219
+ version: '2.14'
220
+ type: :development
221
+ prerelease: false
222
+ - !ruby/object:Gem::Dependency
223
+ name: database_cleaner
224
+ version_requirements: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ~>
228
+ - !ruby/object:Gem::Version
229
+ version: '1.0'
230
+ requirement: !ruby/object:Gem::Requirement
231
+ none: false
232
+ requirements:
233
+ - - ~>
234
+ - !ruby/object:Gem::Version
235
+ version: '1.0'
236
+ type: :development
237
+ prerelease: false
238
+ description: Pliable makes integrating a Rails project with Schemaless data not so
239
+ painful
240
+ email: mfpiccolo@gmail.com
241
+ executables: []
242
+ extensions: []
243
+ extra_rdoc_files: []
244
+ files:
245
+ - .bundle/install.log
246
+ - .document
247
+ - .travis.yml
248
+ - .yardopts
249
+ - ChangeLog.md
250
+ - Gemfile
251
+ - Gemfile.lock
252
+ - LICENSE.txt
253
+ - README.md
254
+ - Rakefile
255
+ - lib/generators/pliable/model_generator.rb
256
+ - lib/generators/pliable/templates/migration.rb
257
+ - lib/pliable.rb
258
+ - lib/pliable/configure.rb
259
+ - lib/pliable/ply.rb
260
+ - lib/pliable/ply_relation.rb
261
+ - lib/pliable/text_helper.rb
262
+ - lib/pliable/version.rb
263
+ - pliable.gemspec
264
+ - spec/.DS_Store
265
+ - spec/dummy/README.rdoc
266
+ - spec/dummy/Rakefile
267
+ - spec/dummy/app/models/.gitkeep
268
+ - spec/dummy/app/models/invoice.rb
269
+ - spec/dummy/app/models/line_item.rb
270
+ - spec/dummy/app/models/merchandise.rb
271
+ - spec/dummy/app/models/ply.rb
272
+ - spec/dummy/config.ru
273
+ - spec/dummy/config/application.rb
274
+ - spec/dummy/config/boot.rb
275
+ - spec/dummy/config/database.yml
276
+ - spec/dummy/config/environment.rb
277
+ - spec/dummy/config/environments/development.rb
278
+ - spec/dummy/config/environments/production.rb
279
+ - spec/dummy/config/environments/test.rb
280
+ - spec/dummy/config/initializers/backtrace_silencers.rb
281
+ - spec/dummy/config/initializers/inflections.rb
282
+ - spec/dummy/config/initializers/mime_types.rb
283
+ - spec/dummy/config/initializers/pliable.rb
284
+ - spec/dummy/config/initializers/secret_token.rb
285
+ - spec/dummy/config/initializers/session_store.rb
286
+ - spec/dummy/config/initializers/wrap_parameters.rb
287
+ - spec/dummy/config/locales/en.yml
288
+ - spec/dummy/config/routes.rb
289
+ - spec/dummy/db/migrate/.DS_Store
290
+ - spec/dummy/db/migrate/20140117210156_create_plies_and_ply_relations.rb
291
+ - spec/dummy/db/migration_helper.rb
292
+ - spec/dummy/db/schema.rb
293
+ - spec/dummy/db/seeds.rb
294
+ - spec/dummy/db/static/bottles.csv
295
+ - spec/dummy/db/static/varietal_aliases.csv
296
+ - spec/dummy/db/static/varietals.csv
297
+ - spec/dummy/lib/assets/.gitkeep
298
+ - spec/dummy/log/.gitkeep
299
+ - spec/dummy/log/development.log
300
+ - spec/dummy/log/test.log
301
+ - spec/dummy/public/404.html
302
+ - spec/dummy/public/422.html
303
+ - spec/dummy/public/500.html
304
+ - spec/dummy/public/favicon.ico
305
+ - spec/dummy/script/rails
306
+ - spec/dummy/spec/fixtures/varietals.yml
307
+ - spec/dummy/spec/models/.DS_Store
308
+ - spec/dummy/spec/models/fake_ply_test.rb
309
+ - spec/dummy/spec/models/ply_relation_spec.rb
310
+ - spec/dummy/spec/pliable_integartion_spec.rb
311
+ - spec/dummy/spec/tmp/app/models/foo_alias.rb
312
+ - spec/spec_helper.rb
313
+ - sub
314
+ homepage: https://rubygems.org/gems/pliable
315
+ licenses:
316
+ - MIT
317
+ post_install_message:
318
+ rdoc_options: []
319
+ require_paths:
320
+ - lib
321
+ required_ruby_version: !ruby/object:Gem::Requirement
322
+ none: false
323
+ requirements:
324
+ - - ! '>='
325
+ - !ruby/object:Gem::Version
326
+ version: '0'
327
+ required_rubygems_version: !ruby/object:Gem::Requirement
328
+ none: false
329
+ requirements:
330
+ - - ! '>='
331
+ - !ruby/object:Gem::Version
332
+ version: '0'
333
+ requirements: []
334
+ rubyforge_project:
335
+ rubygems_version: 1.8.25
336
+ signing_key:
337
+ specification_version: 3
338
+ summary: Schemaless data integration with Rails and Postgres
339
+ test_files:
340
+ - spec/.DS_Store
341
+ - spec/dummy/README.rdoc
342
+ - spec/dummy/Rakefile
343
+ - spec/dummy/app/models/.gitkeep
344
+ - spec/dummy/app/models/invoice.rb
345
+ - spec/dummy/app/models/line_item.rb
346
+ - spec/dummy/app/models/merchandise.rb
347
+ - spec/dummy/app/models/ply.rb
348
+ - spec/dummy/config.ru
349
+ - spec/dummy/config/application.rb
350
+ - spec/dummy/config/boot.rb
351
+ - spec/dummy/config/database.yml
352
+ - spec/dummy/config/environment.rb
353
+ - spec/dummy/config/environments/development.rb
354
+ - spec/dummy/config/environments/production.rb
355
+ - spec/dummy/config/environments/test.rb
356
+ - spec/dummy/config/initializers/backtrace_silencers.rb
357
+ - spec/dummy/config/initializers/inflections.rb
358
+ - spec/dummy/config/initializers/mime_types.rb
359
+ - spec/dummy/config/initializers/pliable.rb
360
+ - spec/dummy/config/initializers/secret_token.rb
361
+ - spec/dummy/config/initializers/session_store.rb
362
+ - spec/dummy/config/initializers/wrap_parameters.rb
363
+ - spec/dummy/config/locales/en.yml
364
+ - spec/dummy/config/routes.rb
365
+ - spec/dummy/db/migrate/.DS_Store
366
+ - spec/dummy/db/migrate/20140117210156_create_plies_and_ply_relations.rb
367
+ - spec/dummy/db/migration_helper.rb
368
+ - spec/dummy/db/schema.rb
369
+ - spec/dummy/db/seeds.rb
370
+ - spec/dummy/db/static/bottles.csv
371
+ - spec/dummy/db/static/varietal_aliases.csv
372
+ - spec/dummy/db/static/varietals.csv
373
+ - spec/dummy/lib/assets/.gitkeep
374
+ - spec/dummy/log/.gitkeep
375
+ - spec/dummy/log/development.log
376
+ - spec/dummy/log/test.log
377
+ - spec/dummy/public/404.html
378
+ - spec/dummy/public/422.html
379
+ - spec/dummy/public/500.html
380
+ - spec/dummy/public/favicon.ico
381
+ - spec/dummy/script/rails
382
+ - spec/dummy/spec/fixtures/varietals.yml
383
+ - spec/dummy/spec/models/.DS_Store
384
+ - spec/dummy/spec/models/fake_ply_test.rb
385
+ - spec/dummy/spec/models/ply_relation_spec.rb
386
+ - spec/dummy/spec/pliable_integartion_spec.rb
387
+ - spec/dummy/spec/tmp/app/models/foo_alias.rb
388
+ - spec/spec_helper.rb
389
+ has_rdoc: