dicer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. data/.gitignore +17 -0
  2. data/.pryrc +2 -0
  3. data/.rbenv-version +1 -0
  4. data/.rspec +2 -0
  5. data/Gemfile +12 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +81 -0
  8. data/Rakefile +1 -0
  9. data/bench/call_only.rb +77 -0
  10. data/bench/method_call.rb +76 -0
  11. data/bench/send.rb +30 -0
  12. data/dicer.gemspec +23 -0
  13. data/examples/rails-3.2/.gitignore +15 -0
  14. data/examples/rails-3.2/.rspec +2 -0
  15. data/examples/rails-3.2/Gemfile +24 -0
  16. data/examples/rails-3.2/README.rdoc +261 -0
  17. data/examples/rails-3.2/Rakefile +7 -0
  18. data/examples/rails-3.2/app/assets/images/rails.png +0 -0
  19. data/examples/rails-3.2/app/assets/javascripts/application.js +13 -0
  20. data/examples/rails-3.2/app/assets/stylesheets/application.css +13 -0
  21. data/examples/rails-3.2/app/behaviors/book_store_customer.rb +14 -0
  22. data/examples/rails-3.2/app/behaviors/testable.rb +7 -0
  23. data/examples/rails-3.2/app/contexts/application_context.rb +5 -0
  24. data/examples/rails-3.2/app/contexts/book_store_purchase_context.rb +5 -0
  25. data/examples/rails-3.2/app/controllers/application_controller.rb +3 -0
  26. data/examples/rails-3.2/app/controllers/book_store_controller.rb +24 -0
  27. data/examples/rails-3.2/app/helpers/application_helper.rb +2 -0
  28. data/examples/rails-3.2/app/mailers/.gitkeep +0 -0
  29. data/examples/rails-3.2/app/models/.gitkeep +0 -0
  30. data/examples/rails-3.2/app/models/book.rb +6 -0
  31. data/examples/rails-3.2/app/models/book_purchase.rb +6 -0
  32. data/examples/rails-3.2/app/models/user.rb +6 -0
  33. data/examples/rails-3.2/app/views/layouts/application.html.erb +14 -0
  34. data/examples/rails-3.2/config/application.rb +70 -0
  35. data/examples/rails-3.2/config/boot.rb +6 -0
  36. data/examples/rails-3.2/config/database.yml +25 -0
  37. data/examples/rails-3.2/config/environment.rb +5 -0
  38. data/examples/rails-3.2/config/environments/development.rb +37 -0
  39. data/examples/rails-3.2/config/environments/production.rb +67 -0
  40. data/examples/rails-3.2/config/environments/test.rb +37 -0
  41. data/examples/rails-3.2/config/initializers/backtrace_silencers.rb +7 -0
  42. data/examples/rails-3.2/config/initializers/inflections.rb +15 -0
  43. data/examples/rails-3.2/config/initializers/mime_types.rb +5 -0
  44. data/examples/rails-3.2/config/initializers/secret_token.rb +7 -0
  45. data/examples/rails-3.2/config/initializers/session_store.rb +8 -0
  46. data/examples/rails-3.2/config/initializers/wrap_parameters.rb +14 -0
  47. data/examples/rails-3.2/config/locales/en.yml +5 -0
  48. data/examples/rails-3.2/config/routes.rb +7 -0
  49. data/examples/rails-3.2/config.ru +4 -0
  50. data/examples/rails-3.2/db/migrate/20130104095330_create_users.rb +10 -0
  51. data/examples/rails-3.2/db/migrate/20130104171610_create_books.rb +9 -0
  52. data/examples/rails-3.2/db/migrate/20130104172409_create_book_purchases.rb +10 -0
  53. data/examples/rails-3.2/db/schema.rb +36 -0
  54. data/examples/rails-3.2/db/seeds.rb +7 -0
  55. data/examples/rails-3.2/lib/assets/.gitkeep +0 -0
  56. data/examples/rails-3.2/lib/tasks/.gitkeep +0 -0
  57. data/examples/rails-3.2/log/.gitkeep +0 -0
  58. data/examples/rails-3.2/public/404.html +26 -0
  59. data/examples/rails-3.2/public/422.html +26 -0
  60. data/examples/rails-3.2/public/500.html +25 -0
  61. data/examples/rails-3.2/public/favicon.ico +0 -0
  62. data/examples/rails-3.2/public/index.html +241 -0
  63. data/examples/rails-3.2/public/robots.txt +5 -0
  64. data/examples/rails-3.2/script/rails +6 -0
  65. data/examples/rails-3.2/spec/controllers/book_store_controller_spec.rb +37 -0
  66. data/examples/rails-3.2/spec/factories/book_purchases.rb +8 -0
  67. data/examples/rails-3.2/spec/factories/books.rb +7 -0
  68. data/examples/rails-3.2/spec/factories/users.rb +8 -0
  69. data/examples/rails-3.2/spec/generators/behavior_generator_spec.rb +26 -0
  70. data/examples/rails-3.2/spec/generators/context_generator_spec.rb +25 -0
  71. data/examples/rails-3.2/spec/models/book_purchase_spec.rb +17 -0
  72. data/examples/rails-3.2/spec/models/book_spec.rb +15 -0
  73. data/examples/rails-3.2/spec/models/user_spec.rb +15 -0
  74. data/examples/rails-3.2/spec/spec_helper.rb +26 -0
  75. data/examples/rails-3.2/vendor/assets/javascripts/.gitkeep +0 -0
  76. data/examples/rails-3.2/vendor/assets/stylesheets/.gitkeep +0 -0
  77. data/examples/rails-3.2/vendor/plugins/.gitkeep +0 -0
  78. data/examples/rails-3.2-with-mongoid/.gitignore +15 -0
  79. data/examples/rails-3.2-with-mongoid/.rspec +2 -0
  80. data/examples/rails-3.2-with-mongoid/Gemfile +24 -0
  81. data/examples/rails-3.2-with-mongoid/README.rdoc +261 -0
  82. data/examples/rails-3.2-with-mongoid/Rakefile +7 -0
  83. data/examples/rails-3.2-with-mongoid/app/assets/images/rails.png +0 -0
  84. data/examples/rails-3.2-with-mongoid/app/assets/javascripts/application.js +13 -0
  85. data/examples/rails-3.2-with-mongoid/app/assets/stylesheets/application.css +13 -0
  86. data/examples/rails-3.2-with-mongoid/app/helpers/application_helper.rb +2 -0
  87. data/examples/rails-3.2-with-mongoid/app/mailers/.gitkeep +0 -0
  88. data/examples/rails-3.2-with-mongoid/app/models/.gitkeep +0 -0
  89. data/examples/rails-3.2-with-mongoid/app/models/book.rb +7 -0
  90. data/examples/rails-3.2-with-mongoid/app/models/book_purchase.rb +6 -0
  91. data/examples/rails-3.2-with-mongoid/app/models/user.rb +8 -0
  92. data/examples/rails-3.2-with-mongoid/app/views/layouts/application.html.erb +14 -0
  93. data/examples/rails-3.2-with-mongoid/config/application.rb +70 -0
  94. data/examples/rails-3.2-with-mongoid/config/boot.rb +6 -0
  95. data/examples/rails-3.2-with-mongoid/config/environment.rb +5 -0
  96. data/examples/rails-3.2-with-mongoid/config/environments/development.rb +31 -0
  97. data/examples/rails-3.2-with-mongoid/config/environments/production.rb +64 -0
  98. data/examples/rails-3.2-with-mongoid/config/environments/test.rb +35 -0
  99. data/examples/rails-3.2-with-mongoid/config/initializers/backtrace_silencers.rb +7 -0
  100. data/examples/rails-3.2-with-mongoid/config/initializers/inflections.rb +15 -0
  101. data/examples/rails-3.2-with-mongoid/config/initializers/mime_types.rb +5 -0
  102. data/examples/rails-3.2-with-mongoid/config/initializers/secret_token.rb +7 -0
  103. data/examples/rails-3.2-with-mongoid/config/initializers/session_store.rb +8 -0
  104. data/examples/rails-3.2-with-mongoid/config/initializers/wrap_parameters.rb +10 -0
  105. data/examples/rails-3.2-with-mongoid/config/locales/en.yml +5 -0
  106. data/examples/rails-3.2-with-mongoid/config/mongoid.yml +80 -0
  107. data/examples/rails-3.2-with-mongoid/config/routes.rb +7 -0
  108. data/examples/rails-3.2-with-mongoid/config.ru +4 -0
  109. data/examples/rails-3.2-with-mongoid/db/seeds.rb +7 -0
  110. data/examples/rails-3.2-with-mongoid/lib/assets/.gitkeep +0 -0
  111. data/examples/rails-3.2-with-mongoid/lib/tasks/.gitkeep +0 -0
  112. data/examples/rails-3.2-with-mongoid/log/.gitkeep +0 -0
  113. data/examples/rails-3.2-with-mongoid/public/404.html +26 -0
  114. data/examples/rails-3.2-with-mongoid/public/422.html +26 -0
  115. data/examples/rails-3.2-with-mongoid/public/500.html +25 -0
  116. data/examples/rails-3.2-with-mongoid/public/favicon.ico +0 -0
  117. data/examples/rails-3.2-with-mongoid/public/index.html +241 -0
  118. data/examples/rails-3.2-with-mongoid/public/robots.txt +5 -0
  119. data/examples/rails-3.2-with-mongoid/script/rails +6 -0
  120. data/examples/rails-3.2-with-mongoid/vendor/assets/javascripts/.gitkeep +0 -0
  121. data/examples/rails-3.2-with-mongoid/vendor/assets/stylesheets/.gitkeep +0 -0
  122. data/examples/rails-3.2-with-mongoid/vendor/plugins/.gitkeep +0 -0
  123. data/lib/dicer/behavior.rb +17 -0
  124. data/lib/dicer/config.rb +15 -0
  125. data/lib/dicer/context/description.rb +27 -0
  126. data/lib/dicer/context.rb +30 -0
  127. data/lib/dicer/contextable.rb +19 -0
  128. data/lib/dicer/delegator.rb +80 -0
  129. data/lib/dicer/middleware.rb +20 -0
  130. data/lib/dicer/railtie/action_controller.rb +48 -0
  131. data/lib/dicer/railtie/active_record.rb +29 -0
  132. data/lib/dicer/railtie/context.rb +30 -0
  133. data/lib/dicer/railtie/contextable.rb +10 -0
  134. data/lib/dicer/railtie.rb +65 -0
  135. data/lib/dicer/version.rb +3 -0
  136. data/lib/dicer.rb +6 -0
  137. data/lib/generators/behavior/behavior_generator.rb +20 -0
  138. data/lib/generators/behavior/template/behavior.rb +3 -0
  139. data/lib/generators/context/context_generator.rb +32 -0
  140. data/lib/generators/context/template/context.rb +2 -0
  141. data/resource/dice.png +0 -0
  142. data/resource/dicer_logo.png +0 -0
  143. data/spec/dicer/behavior_spec.rb +18 -0
  144. data/spec/dicer/context/description_spec.rb +41 -0
  145. data/spec/dicer/context_spec.rb +54 -0
  146. data/spec/dicer/contextable_spec.rb +35 -0
  147. data/spec/dicer/delegator_spec.rb +34 -0
  148. data/spec/dicer/railtie/context_spec.rb +106 -0
  149. data/spec/dicer/railtie/contextable_spec.rb +18 -0
  150. data/spec/spec_helper.rb +27 -0
  151. data/spec/support/cleaner.rb +5 -0
  152. data/spec/support/cleaning_context.rb +8 -0
  153. data/spec/support/entity.rb +31 -0
  154. data/spec/support/value.rb +22 -0
  155. metadata +250 -0
metadata ADDED
@@ -0,0 +1,250 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dicer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sho Kusano
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.12.0
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 2.12.0
46
+ description: useful DCI for Rails
47
+ email:
48
+ - rosylilly@aduca.org
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - .pryrc
55
+ - .rbenv-version
56
+ - .rspec
57
+ - Gemfile
58
+ - LICENSE.txt
59
+ - README.md
60
+ - Rakefile
61
+ - bench/call_only.rb
62
+ - bench/method_call.rb
63
+ - bench/send.rb
64
+ - dicer.gemspec
65
+ - examples/rails-3.2-with-mongoid/.gitignore
66
+ - examples/rails-3.2-with-mongoid/.rspec
67
+ - examples/rails-3.2-with-mongoid/Gemfile
68
+ - examples/rails-3.2-with-mongoid/README.rdoc
69
+ - examples/rails-3.2-with-mongoid/Rakefile
70
+ - examples/rails-3.2-with-mongoid/app/assets/images/rails.png
71
+ - examples/rails-3.2-with-mongoid/app/assets/javascripts/application.js
72
+ - examples/rails-3.2-with-mongoid/app/assets/stylesheets/application.css
73
+ - examples/rails-3.2-with-mongoid/app/helpers/application_helper.rb
74
+ - examples/rails-3.2-with-mongoid/app/mailers/.gitkeep
75
+ - examples/rails-3.2-with-mongoid/app/models/.gitkeep
76
+ - examples/rails-3.2-with-mongoid/app/models/book.rb
77
+ - examples/rails-3.2-with-mongoid/app/models/book_purchase.rb
78
+ - examples/rails-3.2-with-mongoid/app/models/user.rb
79
+ - examples/rails-3.2-with-mongoid/app/views/layouts/application.html.erb
80
+ - examples/rails-3.2-with-mongoid/config.ru
81
+ - examples/rails-3.2-with-mongoid/config/application.rb
82
+ - examples/rails-3.2-with-mongoid/config/boot.rb
83
+ - examples/rails-3.2-with-mongoid/config/environment.rb
84
+ - examples/rails-3.2-with-mongoid/config/environments/development.rb
85
+ - examples/rails-3.2-with-mongoid/config/environments/production.rb
86
+ - examples/rails-3.2-with-mongoid/config/environments/test.rb
87
+ - examples/rails-3.2-with-mongoid/config/initializers/backtrace_silencers.rb
88
+ - examples/rails-3.2-with-mongoid/config/initializers/inflections.rb
89
+ - examples/rails-3.2-with-mongoid/config/initializers/mime_types.rb
90
+ - examples/rails-3.2-with-mongoid/config/initializers/secret_token.rb
91
+ - examples/rails-3.2-with-mongoid/config/initializers/session_store.rb
92
+ - examples/rails-3.2-with-mongoid/config/initializers/wrap_parameters.rb
93
+ - examples/rails-3.2-with-mongoid/config/locales/en.yml
94
+ - examples/rails-3.2-with-mongoid/config/mongoid.yml
95
+ - examples/rails-3.2-with-mongoid/config/routes.rb
96
+ - examples/rails-3.2-with-mongoid/db/seeds.rb
97
+ - examples/rails-3.2-with-mongoid/lib/assets/.gitkeep
98
+ - examples/rails-3.2-with-mongoid/lib/tasks/.gitkeep
99
+ - examples/rails-3.2-with-mongoid/log/.gitkeep
100
+ - examples/rails-3.2-with-mongoid/public/404.html
101
+ - examples/rails-3.2-with-mongoid/public/422.html
102
+ - examples/rails-3.2-with-mongoid/public/500.html
103
+ - examples/rails-3.2-with-mongoid/public/favicon.ico
104
+ - examples/rails-3.2-with-mongoid/public/index.html
105
+ - examples/rails-3.2-with-mongoid/public/robots.txt
106
+ - examples/rails-3.2-with-mongoid/script/rails
107
+ - examples/rails-3.2-with-mongoid/vendor/assets/javascripts/.gitkeep
108
+ - examples/rails-3.2-with-mongoid/vendor/assets/stylesheets/.gitkeep
109
+ - examples/rails-3.2-with-mongoid/vendor/plugins/.gitkeep
110
+ - examples/rails-3.2/.gitignore
111
+ - examples/rails-3.2/.rspec
112
+ - examples/rails-3.2/Gemfile
113
+ - examples/rails-3.2/README.rdoc
114
+ - examples/rails-3.2/Rakefile
115
+ - examples/rails-3.2/app/assets/images/rails.png
116
+ - examples/rails-3.2/app/assets/javascripts/application.js
117
+ - examples/rails-3.2/app/assets/stylesheets/application.css
118
+ - examples/rails-3.2/app/behaviors/book_store_customer.rb
119
+ - examples/rails-3.2/app/behaviors/testable.rb
120
+ - examples/rails-3.2/app/contexts/application_context.rb
121
+ - examples/rails-3.2/app/contexts/book_store_purchase_context.rb
122
+ - examples/rails-3.2/app/controllers/application_controller.rb
123
+ - examples/rails-3.2/app/controllers/book_store_controller.rb
124
+ - examples/rails-3.2/app/helpers/application_helper.rb
125
+ - examples/rails-3.2/app/mailers/.gitkeep
126
+ - examples/rails-3.2/app/models/.gitkeep
127
+ - examples/rails-3.2/app/models/book.rb
128
+ - examples/rails-3.2/app/models/book_purchase.rb
129
+ - examples/rails-3.2/app/models/user.rb
130
+ - examples/rails-3.2/app/views/layouts/application.html.erb
131
+ - examples/rails-3.2/config.ru
132
+ - examples/rails-3.2/config/application.rb
133
+ - examples/rails-3.2/config/boot.rb
134
+ - examples/rails-3.2/config/database.yml
135
+ - examples/rails-3.2/config/environment.rb
136
+ - examples/rails-3.2/config/environments/development.rb
137
+ - examples/rails-3.2/config/environments/production.rb
138
+ - examples/rails-3.2/config/environments/test.rb
139
+ - examples/rails-3.2/config/initializers/backtrace_silencers.rb
140
+ - examples/rails-3.2/config/initializers/inflections.rb
141
+ - examples/rails-3.2/config/initializers/mime_types.rb
142
+ - examples/rails-3.2/config/initializers/secret_token.rb
143
+ - examples/rails-3.2/config/initializers/session_store.rb
144
+ - examples/rails-3.2/config/initializers/wrap_parameters.rb
145
+ - examples/rails-3.2/config/locales/en.yml
146
+ - examples/rails-3.2/config/routes.rb
147
+ - examples/rails-3.2/db/migrate/20130104095330_create_users.rb
148
+ - examples/rails-3.2/db/migrate/20130104171610_create_books.rb
149
+ - examples/rails-3.2/db/migrate/20130104172409_create_book_purchases.rb
150
+ - examples/rails-3.2/db/schema.rb
151
+ - examples/rails-3.2/db/seeds.rb
152
+ - examples/rails-3.2/lib/assets/.gitkeep
153
+ - examples/rails-3.2/lib/tasks/.gitkeep
154
+ - examples/rails-3.2/log/.gitkeep
155
+ - examples/rails-3.2/public/404.html
156
+ - examples/rails-3.2/public/422.html
157
+ - examples/rails-3.2/public/500.html
158
+ - examples/rails-3.2/public/favicon.ico
159
+ - examples/rails-3.2/public/index.html
160
+ - examples/rails-3.2/public/robots.txt
161
+ - examples/rails-3.2/script/rails
162
+ - examples/rails-3.2/spec/controllers/book_store_controller_spec.rb
163
+ - examples/rails-3.2/spec/factories/book_purchases.rb
164
+ - examples/rails-3.2/spec/factories/books.rb
165
+ - examples/rails-3.2/spec/factories/users.rb
166
+ - examples/rails-3.2/spec/generators/behavior_generator_spec.rb
167
+ - examples/rails-3.2/spec/generators/context_generator_spec.rb
168
+ - examples/rails-3.2/spec/models/book_purchase_spec.rb
169
+ - examples/rails-3.2/spec/models/book_spec.rb
170
+ - examples/rails-3.2/spec/models/user_spec.rb
171
+ - examples/rails-3.2/spec/spec_helper.rb
172
+ - examples/rails-3.2/vendor/assets/javascripts/.gitkeep
173
+ - examples/rails-3.2/vendor/assets/stylesheets/.gitkeep
174
+ - examples/rails-3.2/vendor/plugins/.gitkeep
175
+ - lib/dicer.rb
176
+ - lib/dicer/behavior.rb
177
+ - lib/dicer/config.rb
178
+ - lib/dicer/context.rb
179
+ - lib/dicer/context/description.rb
180
+ - lib/dicer/contextable.rb
181
+ - lib/dicer/delegator.rb
182
+ - lib/dicer/middleware.rb
183
+ - lib/dicer/railtie.rb
184
+ - lib/dicer/railtie/action_controller.rb
185
+ - lib/dicer/railtie/active_record.rb
186
+ - lib/dicer/railtie/context.rb
187
+ - lib/dicer/railtie/contextable.rb
188
+ - lib/dicer/version.rb
189
+ - lib/generators/behavior/behavior_generator.rb
190
+ - lib/generators/behavior/template/behavior.rb
191
+ - lib/generators/context/context_generator.rb
192
+ - lib/generators/context/template/context.rb
193
+ - resource/dice.png
194
+ - resource/dicer_logo.png
195
+ - spec/dicer/behavior_spec.rb
196
+ - spec/dicer/context/description_spec.rb
197
+ - spec/dicer/context_spec.rb
198
+ - spec/dicer/contextable_spec.rb
199
+ - spec/dicer/delegator_spec.rb
200
+ - spec/dicer/railtie/context_spec.rb
201
+ - spec/dicer/railtie/contextable_spec.rb
202
+ - spec/spec_helper.rb
203
+ - spec/support/cleaner.rb
204
+ - spec/support/cleaning_context.rb
205
+ - spec/support/entity.rb
206
+ - spec/support/value.rb
207
+ homepage: ''
208
+ licenses:
209
+ - MIT
210
+ post_install_message:
211
+ rdoc_options: []
212
+ require_paths:
213
+ - lib
214
+ required_ruby_version: !ruby/object:Gem::Requirement
215
+ none: false
216
+ requirements:
217
+ - - ! '>='
218
+ - !ruby/object:Gem::Version
219
+ version: '0'
220
+ segments:
221
+ - 0
222
+ hash: -253257026553297279
223
+ required_rubygems_version: !ruby/object:Gem::Requirement
224
+ none: false
225
+ requirements:
226
+ - - ! '>='
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ segments:
230
+ - 0
231
+ hash: -253257026553297279
232
+ requirements: []
233
+ rubyforge_project:
234
+ rubygems_version: 1.8.23
235
+ signing_key:
236
+ specification_version: 3
237
+ summary: useful DCI for Rails
238
+ test_files:
239
+ - spec/dicer/behavior_spec.rb
240
+ - spec/dicer/context/description_spec.rb
241
+ - spec/dicer/context_spec.rb
242
+ - spec/dicer/contextable_spec.rb
243
+ - spec/dicer/delegator_spec.rb
244
+ - spec/dicer/railtie/context_spec.rb
245
+ - spec/dicer/railtie/contextable_spec.rb
246
+ - spec/spec_helper.rb
247
+ - spec/support/cleaner.rb
248
+ - spec/support/cleaning_context.rb
249
+ - spec/support/entity.rb
250
+ - spec/support/value.rb