cells 4.0.0.beta4 → 4.0.0.beta5

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 (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +19 -0
  3. data/Rakefile +11 -0
  4. data/cells.gemspec +3 -4
  5. data/gemfiles/rails4.2.gemfile +0 -7
  6. data/lib/cell.rb +19 -19
  7. data/lib/cell/abstract.rb +9 -0
  8. data/lib/cell/caching.rb +16 -17
  9. data/lib/cell/concept.rb +2 -4
  10. data/lib/cell/prefixes.rb +3 -2
  11. data/lib/cell/rails.rb +27 -4
  12. data/lib/cell/railtie.rb +47 -42
  13. data/lib/cell/testing.rb +12 -9
  14. data/lib/cell/twin.rb +2 -2
  15. data/lib/cell/util.rb +16 -0
  16. data/lib/cell/version.rb +1 -8
  17. data/lib/cell/view_model.rb +63 -90
  18. data/test/builder_test.rb +5 -5
  19. data/test/caching_test.rb +2 -2
  20. data/test/cell_test.rb +1 -1
  21. data/test/concept_test.rb +24 -10
  22. data/test/dummy/config/application.rb +1 -1
  23. data/test/public_test.rb +8 -9
  24. data/test/rails4.2/.gitignore +13 -0
  25. data/test/rails4.2/Gemfile +16 -0
  26. data/test/rails4.2/README.rdoc +3 -0
  27. data/test/rails4.2/Rakefile +6 -0
  28. data/test/rails4.2/app/assets/images/.keep +0 -0
  29. data/test/rails4.2/app/assets/stylesheets/application.css +17 -0
  30. data/test/rails4.2/app/cells/song/song.css +1 -0
  31. data/test/rails4.2/app/cells/song_cell.rb +2 -0
  32. data/test/rails4.2/app/controllers/application_controller.rb +5 -0
  33. data/test/rails4.2/app/controllers/concerns/.keep +0 -0
  34. data/test/rails4.2/app/controllers/index_controller.rb +7 -0
  35. data/test/rails4.2/app/helpers/application_helper.rb +2 -0
  36. data/test/rails4.2/app/mailers/.keep +0 -0
  37. data/test/rails4.2/app/models/.keep +0 -0
  38. data/test/rails4.2/app/models/concerns/.keep +0 -0
  39. data/test/rails4.2/app/views/index/index.html.erb +6 -0
  40. data/test/rails4.2/app/views/layouts/application.html.erb +13 -0
  41. data/test/rails4.2/bin/bundle +3 -0
  42. data/test/rails4.2/bin/rails +4 -0
  43. data/test/rails4.2/bin/rake +4 -0
  44. data/test/rails4.2/bin/setup +29 -0
  45. data/test/rails4.2/config.ru +4 -0
  46. data/test/rails4.2/config/application.rb +38 -0
  47. data/test/rails4.2/config/boot.rb +3 -0
  48. data/test/rails4.2/config/environment.rb +5 -0
  49. data/test/rails4.2/config/environments/development.rb +25 -0
  50. data/test/rails4.2/config/environments/production.rb +64 -0
  51. data/test/rails4.2/config/environments/test.rb +42 -0
  52. data/test/rails4.2/config/initializers/backtrace_silencers.rb +7 -0
  53. data/test/rails4.2/config/initializers/cookies_serializer.rb +3 -0
  54. data/test/rails4.2/config/initializers/filter_parameter_logging.rb +4 -0
  55. data/test/rails4.2/config/initializers/inflections.rb +16 -0
  56. data/test/rails4.2/config/initializers/mime_types.rb +4 -0
  57. data/test/rails4.2/config/initializers/session_store.rb +3 -0
  58. data/test/rails4.2/config/initializers/wrap_parameters.rb +9 -0
  59. data/test/rails4.2/config/locales/en.yml +23 -0
  60. data/test/rails4.2/config/routes.rb +4 -0
  61. data/test/rails4.2/config/secrets.yml +22 -0
  62. data/test/rails4.2/db/seeds.rb +7 -0
  63. data/test/rails4.2/engines/my_engine/.gitignore +3 -0
  64. data/test/rails4.2/engines/my_engine/Gemfile +15 -0
  65. data/test/rails4.2/engines/my_engine/MIT-LICENSE +20 -0
  66. data/test/rails4.2/engines/my_engine/README.rdoc +3 -0
  67. data/test/rails4.2/engines/my_engine/Rakefile +24 -0
  68. data/test/rails4.2/engines/my_engine/app/assets/images/my_engine/.keep +0 -0
  69. data/test/rails4.2/engines/my_engine/app/assets/stylesheets/my_engine/application.css +15 -0
  70. data/test/rails4.2/engines/my_engine/app/concepts/user/cell.rb +8 -0
  71. data/test/rails4.2/engines/my_engine/app/concepts/user/views/show.erb +1 -0
  72. data/test/rails4.2/engines/my_engine/app/concepts/user/views/user.scss +3 -0
  73. data/test/rails4.2/engines/my_engine/app/controllers/my_engine/application_controller.rb +4 -0
  74. data/test/rails4.2/engines/my_engine/app/controllers/my_engine/user_controller.rb +7 -0
  75. data/test/rails4.2/engines/my_engine/app/helpers/my_engine/application_helper.rb +4 -0
  76. data/test/rails4.2/engines/my_engine/app/models/my_engine/user.rb +4 -0
  77. data/test/rails4.2/engines/my_engine/app/views/layouts/my_engine/application.html.erb +14 -0
  78. data/test/rails4.2/engines/my_engine/app/views/my_engine/user/show.html.erb +3 -0
  79. data/test/rails4.2/engines/my_engine/bin/rails +12 -0
  80. data/test/rails4.2/engines/my_engine/config/routes.rb +3 -0
  81. data/test/rails4.2/engines/my_engine/db/migrate/20150530135920_create_my_engine_users.rb +8 -0
  82. data/test/rails4.2/engines/my_engine/lib/my_engine.rb +6 -0
  83. data/test/rails4.2/engines/my_engine/lib/my_engine/engine.rb +9 -0
  84. data/test/rails4.2/engines/my_engine/lib/my_engine/version.rb +3 -0
  85. data/test/rails4.2/engines/my_engine/lib/tasks/my_engine_tasks.rake +4 -0
  86. data/test/rails4.2/engines/my_engine/my_engine.gemspec +24 -0
  87. data/test/rails4.2/engines/my_engine/test/fixtures/my_engine/users.yml +11 -0
  88. data/test/rails4.2/engines/my_engine/test/models/my_engine/user_test.rb +9 -0
  89. data/test/rails4.2/lib/assets/.keep +0 -0
  90. data/test/rails4.2/lib/tasks/.keep +0 -0
  91. data/test/rails4.2/log/.keep +0 -0
  92. data/test/rails4.2/public/404.html +67 -0
  93. data/test/rails4.2/public/422.html +67 -0
  94. data/test/rails4.2/public/500.html +66 -0
  95. data/test/rails4.2/public/favicon.ico +0 -0
  96. data/test/rails4.2/public/robots.txt +5 -0
  97. data/test/rails4.2/test/integration/asset_pipeline_test.rb +17 -0
  98. data/test/rails4.2/test/test_helper.rb +14 -0
  99. data/test/rails4.2/vendor/assets/stylesheets/.keep +0 -0
  100. data/test/twin_test.rb +1 -1
  101. data/test/url_helper_test.rb +1 -1
  102. metadata +83 -19
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-agent: *
5
+ # Disallow: /
@@ -0,0 +1,17 @@
1
+ require "test_helper"
2
+ require "capybara/rails"
3
+ require "capybara/dsl"
4
+
5
+ # This blog post helped so much: http://rakeroutes.com/blog/write-a-gem-for-the-rails-asset-pipeline/
6
+ # Thanks, Stephen!!! :)
7
+
8
+ class AssetPipelineTest < ActionDispatch::IntegrationTest
9
+ include ::Capybara::DSL
10
+
11
+ it do
12
+ visit "/assets/application.css"
13
+
14
+ # both engine User::Cell and SongCell provide assets.
15
+ page.text.must_equal "user{background:green}.song{background:red}"
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
4
+
5
+ Rails.backtrace_cleaner.remove_silencers!
6
+
7
+ # MiniTest::Spec.class_eval do
8
+ # after :each do
9
+ # # DatabaseCleaner.clean
10
+ # Thing.delete_all
11
+ # Comment.delete_all
12
+ # User.delete_all
13
+ # end
14
+ # end
@@ -22,5 +22,5 @@ class TwinTest < MiniTest::Spec
22
22
 
23
23
  let (:model) { OpenStruct.new(:title => "Kenny") }
24
24
 
25
- it { SongCell.new(nil, model, :online? => true).call.must_equal "kenny is true" }
25
+ it { SongCell.new( model, :online? => true).call.must_equal "kenny is true" }
26
26
  end
@@ -6,7 +6,7 @@ end
6
6
  class UrlHelperTest < MiniTest::Spec
7
7
  controller MusiciansController
8
8
 
9
- let (:song_cell) { SongCell.new(controller) }
9
+ let (:song_cell) { SongCell.new(nil, controller: controller) }
10
10
 
11
11
  class SongCell < Cell::ViewModel
12
12
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cells
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.beta4
4
+ version: 4.0.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-29 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: actionpack
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '3.2'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '3.2'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: uber
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -128,8 +114,8 @@ dependencies:
128
114
  - - ">="
129
115
  - !ruby/object:Gem::Version
130
116
  version: 0.0.2
131
- description: Cells replace partials and helpers with OOP view models, giving you proper
132
- encapsulation, inheritance, testability and a cleaner view architecture.
117
+ description: Cells replaces partials and helpers with OOP view models, giving you
118
+ proper encapsulation, inheritance, testability and a cleaner view architecture.
133
119
  email:
134
120
  - apotonick@gmail.com
135
121
  executables: []
@@ -149,6 +135,7 @@ files:
149
135
  - gemfiles/rails4.1.gemfile
150
136
  - gemfiles/rails4.2.gemfile
151
137
  - lib/cell.rb
138
+ - lib/cell/abstract.rb
152
139
  - lib/cell/caching.rb
153
140
  - lib/cell/caching/notification.rb
154
141
  - lib/cell/concept.rb
@@ -164,6 +151,7 @@ files:
164
151
  - lib/cell/test_case.rb
165
152
  - lib/cell/testing.rb
166
153
  - lib/cell/twin.rb
154
+ - lib/cell/util.rb
167
155
  - lib/cell/version.rb
168
156
  - lib/cell/view_model.rb
169
157
  - lib/cells.rb
@@ -237,6 +225,82 @@ files:
237
225
  - test/partial_test.rb
238
226
  - test/prefixes_test.rb
239
227
  - test/public_test.rb
228
+ - test/rails4.2/.gitignore
229
+ - test/rails4.2/Gemfile
230
+ - test/rails4.2/README.rdoc
231
+ - test/rails4.2/Rakefile
232
+ - test/rails4.2/app/assets/images/.keep
233
+ - test/rails4.2/app/assets/stylesheets/application.css
234
+ - test/rails4.2/app/cells/song/song.css
235
+ - test/rails4.2/app/cells/song_cell.rb
236
+ - test/rails4.2/app/controllers/application_controller.rb
237
+ - test/rails4.2/app/controllers/concerns/.keep
238
+ - test/rails4.2/app/controllers/index_controller.rb
239
+ - test/rails4.2/app/helpers/application_helper.rb
240
+ - test/rails4.2/app/mailers/.keep
241
+ - test/rails4.2/app/models/.keep
242
+ - test/rails4.2/app/models/concerns/.keep
243
+ - test/rails4.2/app/views/index/index.html.erb
244
+ - test/rails4.2/app/views/layouts/application.html.erb
245
+ - test/rails4.2/bin/bundle
246
+ - test/rails4.2/bin/rails
247
+ - test/rails4.2/bin/rake
248
+ - test/rails4.2/bin/setup
249
+ - test/rails4.2/config.ru
250
+ - test/rails4.2/config/application.rb
251
+ - test/rails4.2/config/boot.rb
252
+ - test/rails4.2/config/environment.rb
253
+ - test/rails4.2/config/environments/development.rb
254
+ - test/rails4.2/config/environments/production.rb
255
+ - test/rails4.2/config/environments/test.rb
256
+ - test/rails4.2/config/initializers/backtrace_silencers.rb
257
+ - test/rails4.2/config/initializers/cookies_serializer.rb
258
+ - test/rails4.2/config/initializers/filter_parameter_logging.rb
259
+ - test/rails4.2/config/initializers/inflections.rb
260
+ - test/rails4.2/config/initializers/mime_types.rb
261
+ - test/rails4.2/config/initializers/session_store.rb
262
+ - test/rails4.2/config/initializers/wrap_parameters.rb
263
+ - test/rails4.2/config/locales/en.yml
264
+ - test/rails4.2/config/routes.rb
265
+ - test/rails4.2/config/secrets.yml
266
+ - test/rails4.2/db/seeds.rb
267
+ - test/rails4.2/engines/my_engine/.gitignore
268
+ - test/rails4.2/engines/my_engine/Gemfile
269
+ - test/rails4.2/engines/my_engine/MIT-LICENSE
270
+ - test/rails4.2/engines/my_engine/README.rdoc
271
+ - test/rails4.2/engines/my_engine/Rakefile
272
+ - test/rails4.2/engines/my_engine/app/assets/images/my_engine/.keep
273
+ - test/rails4.2/engines/my_engine/app/assets/stylesheets/my_engine/application.css
274
+ - test/rails4.2/engines/my_engine/app/concepts/user/cell.rb
275
+ - test/rails4.2/engines/my_engine/app/concepts/user/views/show.erb
276
+ - test/rails4.2/engines/my_engine/app/concepts/user/views/user.scss
277
+ - test/rails4.2/engines/my_engine/app/controllers/my_engine/application_controller.rb
278
+ - test/rails4.2/engines/my_engine/app/controllers/my_engine/user_controller.rb
279
+ - test/rails4.2/engines/my_engine/app/helpers/my_engine/application_helper.rb
280
+ - test/rails4.2/engines/my_engine/app/models/my_engine/user.rb
281
+ - test/rails4.2/engines/my_engine/app/views/layouts/my_engine/application.html.erb
282
+ - test/rails4.2/engines/my_engine/app/views/my_engine/user/show.html.erb
283
+ - test/rails4.2/engines/my_engine/bin/rails
284
+ - test/rails4.2/engines/my_engine/config/routes.rb
285
+ - test/rails4.2/engines/my_engine/db/migrate/20150530135920_create_my_engine_users.rb
286
+ - test/rails4.2/engines/my_engine/lib/my_engine.rb
287
+ - test/rails4.2/engines/my_engine/lib/my_engine/engine.rb
288
+ - test/rails4.2/engines/my_engine/lib/my_engine/version.rb
289
+ - test/rails4.2/engines/my_engine/lib/tasks/my_engine_tasks.rake
290
+ - test/rails4.2/engines/my_engine/my_engine.gemspec
291
+ - test/rails4.2/engines/my_engine/test/fixtures/my_engine/users.yml
292
+ - test/rails4.2/engines/my_engine/test/models/my_engine/user_test.rb
293
+ - test/rails4.2/lib/assets/.keep
294
+ - test/rails4.2/lib/tasks/.keep
295
+ - test/rails4.2/log/.keep
296
+ - test/rails4.2/public/404.html
297
+ - test/rails4.2/public/422.html
298
+ - test/rails4.2/public/500.html
299
+ - test/rails4.2/public/favicon.ico
300
+ - test/rails4.2/public/robots.txt
301
+ - test/rails4.2/test/integration/asset_pipeline_test.rb
302
+ - test/rails4.2/test/test_helper.rb
303
+ - test/rails4.2/vendor/assets/stylesheets/.keep
240
304
  - test/rails_extensions_test.rb
241
305
  - test/render_test.rb
242
306
  - test/templates_test.rb
@@ -267,5 +331,5 @@ rubyforge_project:
267
331
  rubygems_version: 2.2.2
268
332
  signing_key:
269
333
  specification_version: 4
270
- summary: View Models for Rails.
334
+ summary: View Models for Ruby and Rails.
271
335
  test_files: []