marilyne 1.0.0

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 (78) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +47 -0
  3. data/Rakefile +38 -0
  4. data/lib/generators/marilyn/presenter_generator.rb +14 -0
  5. data/lib/generators/templates/presenter.rb +2 -0
  6. data/lib/marilyn/engine.rb +9 -0
  7. data/lib/marilyn/helper.rb +50 -0
  8. data/lib/marilyn/presenter.rb +15 -0
  9. data/lib/marilyn/version.rb +3 -0
  10. data/lib/marilyn.rb +5 -0
  11. data/lib/tasks/marilyn_tasks.rake +4 -0
  12. data/test/dummy/README.rdoc +261 -0
  13. data/test/dummy/Rakefile +7 -0
  14. data/test/dummy/app/assets/javascripts/application.js +15 -0
  15. data/test/dummy/app/assets/javascripts/users.js +2 -0
  16. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  17. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  18. data/test/dummy/app/assets/stylesheets/users.css +4 -0
  19. data/test/dummy/app/controllers/application_controller.rb +3 -0
  20. data/test/dummy/app/controllers/users_controller.rb +83 -0
  21. data/test/dummy/app/helpers/application_helper.rb +2 -0
  22. data/test/dummy/app/helpers/users_helper.rb +2 -0
  23. data/test/dummy/app/models/user.rb +3 -0
  24. data/test/dummy/app/presenters/user_presenter.rb +10 -0
  25. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  26. data/test/dummy/app/views/users/_form.html.erb +25 -0
  27. data/test/dummy/app/views/users/_user.html.erb +9 -0
  28. data/test/dummy/app/views/users/edit.html.erb +6 -0
  29. data/test/dummy/app/views/users/index.html.erb +25 -0
  30. data/test/dummy/app/views/users/new.html.erb +5 -0
  31. data/test/dummy/app/views/users/show.html.erb +6 -0
  32. data/test/dummy/config/application.rb +59 -0
  33. data/test/dummy/config/boot.rb +10 -0
  34. data/test/dummy/config/database.yml +25 -0
  35. data/test/dummy/config/environment.rb +5 -0
  36. data/test/dummy/config/environments/development.rb +37 -0
  37. data/test/dummy/config/environments/production.rb +67 -0
  38. data/test/dummy/config/environments/test.rb +37 -0
  39. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  40. data/test/dummy/config/initializers/inflections.rb +15 -0
  41. data/test/dummy/config/initializers/mime_types.rb +5 -0
  42. data/test/dummy/config/initializers/secret_token.rb +7 -0
  43. data/test/dummy/config/initializers/session_store.rb +8 -0
  44. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  45. data/test/dummy/config/locales/en.yml +5 -0
  46. data/test/dummy/config/routes.rb +60 -0
  47. data/test/dummy/config.ru +4 -0
  48. data/test/dummy/db/development.sqlite3 +0 -0
  49. data/test/dummy/db/migrate/20120818172022_create_users.rb +10 -0
  50. data/test/dummy/db/schema.rb +23 -0
  51. data/test/dummy/db/test.sqlite3 +0 -0
  52. data/test/dummy/log/development.log +390 -0
  53. data/test/dummy/log/test.log +184 -0
  54. data/test/dummy/public/404.html +26 -0
  55. data/test/dummy/public/422.html +26 -0
  56. data/test/dummy/public/500.html +25 -0
  57. data/test/dummy/public/favicon.ico +0 -0
  58. data/test/dummy/script/rails +6 -0
  59. data/test/dummy/tmp/cache/assets/C75/2F0/sprockets%2F54de5b71312225e0b690248b38409a6d +0 -0
  60. data/test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212 +0 -0
  61. data/test/dummy/tmp/cache/assets/CAA/620/sprockets%2F87b209c0c9da28094a8d5581a21262c6 +0 -0
  62. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  63. data/test/dummy/tmp/cache/assets/CD8/B70/sprockets%2F4050a4e5062ab95c9f32e9b6940821ea +0 -0
  64. data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
  65. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  66. data/test/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124 +0 -0
  67. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  68. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  69. data/test/dummy/tmp/cache/assets/D67/8C0/sprockets%2Fa5ec1263c53956c2fe2ed2604e3abf55 +0 -0
  70. data/test/dummy/tmp/cache/assets/D67/B60/sprockets%2F5f1a0d05e77ca8b9a1fc2a47e17a8174 +0 -0
  71. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  72. data/test/dummy/tmp/cache/assets/DFB/320/sprockets%2F08fc5e1bf462fe1ac6f28c7e3eda4c33 +0 -0
  73. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  74. data/test/dummy/tmp/cache/assets/E45/990/sprockets%2Fc270c04a7b0ebc7a13e6bddcc5e7bdc1 +0 -0
  75. data/test/dummy/tmp/pids/server.pid +1 -0
  76. data/test/marilyn_test.rb +55 -0
  77. data/test/test_helper.rb +15 -0
  78. metadata +199 -0
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby.exe
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1 @@
1
+ 1760
@@ -0,0 +1,55 @@
1
+ require 'test_helper'
2
+
3
+ class Base
4
+ def true?
5
+ true
6
+ end
7
+
8
+ def false?
9
+ false
10
+ end
11
+ end
12
+ class BasePresenter < Marilyn::Presenter;end;
13
+
14
+ class MarilynTest < ActiveSupport::TestCase
15
+ include Marilyn::Helper
16
+
17
+ def render(options)
18
+ options
19
+ end
20
+
21
+ test "presenter_for without option" do
22
+ options = presenter_for 'base'
23
+
24
+ assert_equal options[:partial], 'base'
25
+ assert options[:object].is_a? BasePresenter
26
+ end
27
+
28
+ test "presenter_for with object" do
29
+ options = presenter_for 'base', object: Base.new
30
+
31
+ assert_equal options[:partial], 'base'
32
+ assert options[:object].is_a? BasePresenter
33
+ end
34
+
35
+ test "presenter_for with multiple objects" do
36
+ options = presenter_for 'base', objects: [Base.new, Base.new]
37
+
38
+ assert_equal options[:partial], 'base'
39
+ assert options[:object].is_a? BasePresenter
40
+ assert_equal options[:object].objects.length, 2
41
+ end
42
+
43
+ test "presenter_for with block at true" do
44
+ options = presenter_for('base', object: Base.new) { |b| b.true? }
45
+
46
+ assert_equal options[:partial], 'base'
47
+ assert options[:object].is_a? BasePresenter
48
+ end
49
+
50
+ test "presenter_for with block at false" do
51
+ options = presenter_for('base', object: Base.new) { |b| b.false? }
52
+
53
+ assert_nil options
54
+ end
55
+ end
@@ -0,0 +1,15 @@
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
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
metadata ADDED
@@ -0,0 +1,199 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: marilyne
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Anthony Laibe
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &24601980 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.7
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *24601980
25
+ description: Use presenter pattern in rails easily.
26
+ email:
27
+ - anthony.laibe@gmail.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - lib/generators/marilyn/presenter_generator.rb
33
+ - lib/generators/templates/presenter.rb
34
+ - lib/marilyn/engine.rb
35
+ - lib/marilyn/helper.rb
36
+ - lib/marilyn/presenter.rb
37
+ - lib/marilyn/version.rb
38
+ - lib/marilyn.rb
39
+ - lib/tasks/marilyn_tasks.rake
40
+ - MIT-LICENSE
41
+ - Rakefile
42
+ - README.md
43
+ - test/dummy/app/assets/javascripts/application.js
44
+ - test/dummy/app/assets/javascripts/users.js
45
+ - test/dummy/app/assets/stylesheets/application.css
46
+ - test/dummy/app/assets/stylesheets/scaffold.css
47
+ - test/dummy/app/assets/stylesheets/users.css
48
+ - test/dummy/app/controllers/application_controller.rb
49
+ - test/dummy/app/controllers/users_controller.rb
50
+ - test/dummy/app/helpers/application_helper.rb
51
+ - test/dummy/app/helpers/users_helper.rb
52
+ - test/dummy/app/models/user.rb
53
+ - test/dummy/app/presenters/user_presenter.rb
54
+ - test/dummy/app/views/layouts/application.html.erb
55
+ - test/dummy/app/views/users/edit.html.erb
56
+ - test/dummy/app/views/users/index.html.erb
57
+ - test/dummy/app/views/users/new.html.erb
58
+ - test/dummy/app/views/users/show.html.erb
59
+ - test/dummy/app/views/users/_form.html.erb
60
+ - test/dummy/app/views/users/_user.html.erb
61
+ - test/dummy/config/application.rb
62
+ - test/dummy/config/boot.rb
63
+ - test/dummy/config/database.yml
64
+ - test/dummy/config/environment.rb
65
+ - test/dummy/config/environments/development.rb
66
+ - test/dummy/config/environments/production.rb
67
+ - test/dummy/config/environments/test.rb
68
+ - test/dummy/config/initializers/backtrace_silencers.rb
69
+ - test/dummy/config/initializers/inflections.rb
70
+ - test/dummy/config/initializers/mime_types.rb
71
+ - test/dummy/config/initializers/secret_token.rb
72
+ - test/dummy/config/initializers/session_store.rb
73
+ - test/dummy/config/initializers/wrap_parameters.rb
74
+ - test/dummy/config/locales/en.yml
75
+ - test/dummy/config/routes.rb
76
+ - test/dummy/config.ru
77
+ - test/dummy/db/development.sqlite3
78
+ - test/dummy/db/migrate/20120818172022_create_users.rb
79
+ - test/dummy/db/schema.rb
80
+ - test/dummy/db/test.sqlite3
81
+ - test/dummy/log/development.log
82
+ - test/dummy/log/test.log
83
+ - test/dummy/public/404.html
84
+ - test/dummy/public/422.html
85
+ - test/dummy/public/500.html
86
+ - test/dummy/public/favicon.ico
87
+ - test/dummy/Rakefile
88
+ - test/dummy/README.rdoc
89
+ - test/dummy/script/rails
90
+ - test/dummy/tmp/cache/assets/C75/2F0/sprockets%2F54de5b71312225e0b690248b38409a6d
91
+ - test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212
92
+ - test/dummy/tmp/cache/assets/CAA/620/sprockets%2F87b209c0c9da28094a8d5581a21262c6
93
+ - test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
94
+ - test/dummy/tmp/cache/assets/CD8/B70/sprockets%2F4050a4e5062ab95c9f32e9b6940821ea
95
+ - test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2
96
+ - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
97
+ - test/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124
98
+ - test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
99
+ - test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
100
+ - test/dummy/tmp/cache/assets/D67/8C0/sprockets%2Fa5ec1263c53956c2fe2ed2604e3abf55
101
+ - test/dummy/tmp/cache/assets/D67/B60/sprockets%2F5f1a0d05e77ca8b9a1fc2a47e17a8174
102
+ - test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
103
+ - test/dummy/tmp/cache/assets/DFB/320/sprockets%2F08fc5e1bf462fe1ac6f28c7e3eda4c33
104
+ - test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
105
+ - test/dummy/tmp/cache/assets/E45/990/sprockets%2Fc270c04a7b0ebc7a13e6bddcc5e7bdc1
106
+ - test/dummy/tmp/pids/server.pid
107
+ - test/marilyn_test.rb
108
+ - test/test_helper.rb
109
+ homepage: https://github.com/alaibe/marilyn
110
+ licenses: []
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubyforge_project:
129
+ rubygems_version: 1.8.16
130
+ signing_key:
131
+ specification_version: 3
132
+ summary: Use presenter pattern in rails easily.
133
+ test_files:
134
+ - test/dummy/app/assets/javascripts/application.js
135
+ - test/dummy/app/assets/javascripts/users.js
136
+ - test/dummy/app/assets/stylesheets/application.css
137
+ - test/dummy/app/assets/stylesheets/scaffold.css
138
+ - test/dummy/app/assets/stylesheets/users.css
139
+ - test/dummy/app/controllers/application_controller.rb
140
+ - test/dummy/app/controllers/users_controller.rb
141
+ - test/dummy/app/helpers/application_helper.rb
142
+ - test/dummy/app/helpers/users_helper.rb
143
+ - test/dummy/app/models/user.rb
144
+ - test/dummy/app/presenters/user_presenter.rb
145
+ - test/dummy/app/views/layouts/application.html.erb
146
+ - test/dummy/app/views/users/edit.html.erb
147
+ - test/dummy/app/views/users/index.html.erb
148
+ - test/dummy/app/views/users/new.html.erb
149
+ - test/dummy/app/views/users/show.html.erb
150
+ - test/dummy/app/views/users/_form.html.erb
151
+ - test/dummy/app/views/users/_user.html.erb
152
+ - test/dummy/config/application.rb
153
+ - test/dummy/config/boot.rb
154
+ - test/dummy/config/database.yml
155
+ - test/dummy/config/environment.rb
156
+ - test/dummy/config/environments/development.rb
157
+ - test/dummy/config/environments/production.rb
158
+ - test/dummy/config/environments/test.rb
159
+ - test/dummy/config/initializers/backtrace_silencers.rb
160
+ - test/dummy/config/initializers/inflections.rb
161
+ - test/dummy/config/initializers/mime_types.rb
162
+ - test/dummy/config/initializers/secret_token.rb
163
+ - test/dummy/config/initializers/session_store.rb
164
+ - test/dummy/config/initializers/wrap_parameters.rb
165
+ - test/dummy/config/locales/en.yml
166
+ - test/dummy/config/routes.rb
167
+ - test/dummy/config.ru
168
+ - test/dummy/db/development.sqlite3
169
+ - test/dummy/db/migrate/20120818172022_create_users.rb
170
+ - test/dummy/db/schema.rb
171
+ - test/dummy/db/test.sqlite3
172
+ - test/dummy/log/development.log
173
+ - test/dummy/log/test.log
174
+ - test/dummy/public/404.html
175
+ - test/dummy/public/422.html
176
+ - test/dummy/public/500.html
177
+ - test/dummy/public/favicon.ico
178
+ - test/dummy/Rakefile
179
+ - test/dummy/README.rdoc
180
+ - test/dummy/script/rails
181
+ - test/dummy/tmp/cache/assets/C75/2F0/sprockets%2F54de5b71312225e0b690248b38409a6d
182
+ - test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212
183
+ - test/dummy/tmp/cache/assets/CAA/620/sprockets%2F87b209c0c9da28094a8d5581a21262c6
184
+ - test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
185
+ - test/dummy/tmp/cache/assets/CD8/B70/sprockets%2F4050a4e5062ab95c9f32e9b6940821ea
186
+ - test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2
187
+ - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
188
+ - test/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124
189
+ - test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
190
+ - test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
191
+ - test/dummy/tmp/cache/assets/D67/8C0/sprockets%2Fa5ec1263c53956c2fe2ed2604e3abf55
192
+ - test/dummy/tmp/cache/assets/D67/B60/sprockets%2F5f1a0d05e77ca8b9a1fc2a47e17a8174
193
+ - test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
194
+ - test/dummy/tmp/cache/assets/DFB/320/sprockets%2F08fc5e1bf462fe1ac6f28c7e3eda4c33
195
+ - test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
196
+ - test/dummy/tmp/cache/assets/E45/990/sprockets%2Fc270c04a7b0ebc7a13e6bddcc5e7bdc1
197
+ - test/dummy/tmp/pids/server.pid
198
+ - test/marilyn_test.rb
199
+ - test/test_helper.rb