themes_for_rails 0.5.1 → 1.0.0rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile.lock +82 -60
- data/README.textile +235 -11
- data/Rakefile +31 -11
- data/init.rb +1 -0
- data/lib/generators/themes_for_rails/install_generator.rb +21 -6
- data/lib/generators/themes_for_rails/templates/README +11 -0
- data/lib/generators/themes_for_rails/templates/theme/{images → assets/images}/.gitkeep +0 -0
- data/lib/generators/themes_for_rails/templates/theme/{javascripts → assets/javascripts}/.gitkeep +0 -0
- data/lib/generators/themes_for_rails/templates/theme/assets/javascripts/application.js +9 -0
- data/lib/generators/themes_for_rails/templates/theme/{stylesheets → assets/stylesheets}/.gitkeep +0 -0
- data/lib/generators/themes_for_rails/templates/theme/assets/stylesheets/application.css +7 -0
- data/lib/generators/themes_for_rails/theme_generator.rb +2 -3
- data/lib/themes_for_rails.rb +15 -40
- data/lib/themes_for_rails/assets_finder.rb +44 -0
- data/lib/themes_for_rails/common_methods.rb +26 -34
- data/lib/themes_for_rails/config.rb +8 -59
- data/lib/themes_for_rails/{action_controller.rb → controller_methods.rb} +7 -13
- data/lib/themes_for_rails/logging.rb +14 -0
- data/lib/themes_for_rails/mailer_methods.rb +22 -0
- data/lib/themes_for_rails/railtie.rb +10 -21
- data/lib/themes_for_rails/routes.rb +3 -15
- data/lib/themes_for_rails/version.rb +1 -2
- data/lib/themes_for_rails/view_helpers.rb +52 -0
- data/spec/controllers/my_controller_spec.rb +99 -0
- data/{test/dummy_app → spec/dummy}/.gitignore +2 -1
- data/spec/dummy/Gemfile +35 -0
- data/spec/dummy/Gemfile.lock +127 -0
- data/spec/dummy/README +261 -0
- data/{test/dummy_app → spec/dummy}/Rakefile +1 -1
- data/{test/dummy_app/public → spec/dummy/app/assets}/images/rails.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/{test/dummy_app → spec/dummy}/app/controllers/application_controller.rb +0 -0
- data/{test/dummy_app → spec/dummy}/app/helpers/application_helper.rb +0 -0
- data/{test/dummy_app/empty_themes → spec/dummy/app/mailers}/.gitkeep +0 -0
- data/{test/dummy_app/lib/tasks → spec/dummy/app/models}/.gitkeep +0 -0
- data/spec/dummy/app/themes/default/assets/images/rails.png +0 -0
- data/spec/dummy/app/themes/default/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/themes/default/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/themes/default/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/{test/dummy_app → spec/dummy}/config.ru +0 -0
- data/{test/dummy_app → spec/dummy}/config/application.rb +12 -6
- data/spec/dummy/config/boot.rb +6 -0
- data/{test/dummy_app → spec/dummy}/config/database.yml +10 -3
- data/{test/dummy_app → spec/dummy}/config/environment.rb +0 -0
- data/{test/dummy_app → spec/dummy}/config/environments/development.rb +8 -4
- data/{test/dummy_app → spec/dummy}/config/environments/production.rb +24 -13
- data/{test/dummy_app → spec/dummy}/config/environments/test.rb +9 -2
- data/{test/dummy_app → spec/dummy}/config/initializers/backtrace_silencers.rb +0 -0
- data/{test/dummy_app → spec/dummy}/config/initializers/inflections.rb +0 -0
- data/{test/dummy_app → spec/dummy}/config/initializers/mime_types.rb +0 -0
- data/{test/dummy_app → spec/dummy}/config/initializers/secret_token.rb +1 -1
- data/{test/dummy_app → spec/dummy}/config/initializers/session_store.rb +2 -2
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/{test/dummy_app → spec/dummy}/config/locales/en.yml +1 -1
- data/spec/dummy/config/routes.rb +3 -0
- data/{test/dummy_app → spec/dummy}/db/seeds.rb +2 -2
- data/spec/dummy/doc/README_FOR_APP +2 -0
- data/{test/dummy_app/public/stylesheets → spec/dummy/lib/assets}/.gitkeep +0 -0
- data/{doc/REVIEW_NOTES → spec/dummy/lib/tasks/.gitkeep} +0 -0
- data/{test/dummy_app/another_themes/another_default/images/logo.png → spec/dummy/log/.gitkeep} +0 -0
- data/{test/dummy_app → spec/dummy}/public/404.html +0 -0
- data/{test/dummy_app → spec/dummy}/public/422.html +0 -0
- data/{test/dummy_app → spec/dummy}/public/500.html +0 -0
- data/{test/dummy_app → spec/dummy}/public/favicon.ico +0 -0
- data/{test/dummy_app → spec/dummy}/public/index.html +10 -8
- data/{test/dummy_app → spec/dummy}/public/robots.txt +0 -0
- data/{test/dummy_app → spec/dummy}/script/rails +0 -0
- data/{test/dummy_app/another_themes/another_default/images/nested/logo.png → spec/dummy/test/fixtures/.gitkeep} +0 -0
- data/{test/dummy_app/another_themes/another_default/stylesheets/style.css → spec/dummy/test/functional/.gitkeep} +0 -0
- data/{test/dummy_app/another_themes/another_default/views/products/index.html.erb → spec/dummy/test/integration/.gitkeep} +0 -0
- data/spec/dummy/test/performance/browsing_test.rb +12 -0
- data/spec/dummy/test/test_helper.rb +13 -0
- data/{test/dummy_app/themes/default/images/logo.png → spec/dummy/test/unit/.gitkeep} +0 -0
- data/{test/dummy_app/themes/default/images/nested/logo.png → spec/dummy/vendor/assets/stylesheets/.gitkeep} +0 -0
- data/{test/dummy_app/themes/default/javascripts/app.min.js → spec/dummy/vendor/plugins/.gitkeep} +0 -0
- data/spec/lib/assets_finder_spec.rb +10 -0
- data/spec/lib/common_methods_spec.rb +30 -0
- data/spec/lib/config_spec.rb +19 -0
- data/spec/lib/controller_methods_spec.rb +19 -0
- data/spec/lib/view_helpers_spec.rb +38 -0
- data/spec/mailers/mailer_methods_spec.rb +39 -0
- data/spec/spec_helper.rb +15 -0
- data/test/dummy_app/Gemfile.lock +91 -0
- data/test/dummy_app/{themes/default/stylesheets/images/logo.png → log/development.log} +0 -0
- data/test/dummy_app/log/test.log +6 -0
- data/themes_for_rails.gemspec +140 -20
- metadata +112 -183
- data/.gitignore +0 -7
- data/.travis.yml +0 -2
- data/LICENSE +0 -21
- data/doc/README.textile +0 -363
- data/doc/RMU_REVIEW +0 -26
- data/doc/TODO.textile +0 -3
- data/lib/themes_for_rails/action_mailer.rb +0 -22
- data/lib/themes_for_rails/action_view.rb +0 -62
- data/lib/themes_for_rails/assets_controller.rb +0 -66
- data/lib/themes_for_rails/interpolation.rb +0 -11
- data/lib/themes_for_rails/url_helpers.rb +0 -27
- data/test/dummy_app/Gemfile +0 -30
- data/test/dummy_app/another_themes/another_default/javascripts/app.js +0 -1
- data/test/dummy_app/another_themes/another_default/stylesheets/style2.css +0 -3
- data/test/dummy_app/another_themes/another_default/views/layouts/default.html.erb +0 -10
- data/test/dummy_app/app/views/layouts/application.html.erb +0 -14
- data/test/dummy_app/config/boot.rb +0 -13
- data/test/dummy_app/config/routes.rb +0 -4
- data/test/dummy_app/public/javascripts/application.js +0 -2
- data/test/dummy_app/public/javascripts/controls.js +0 -965
- data/test/dummy_app/public/javascripts/dragdrop.js +0 -974
- data/test/dummy_app/public/javascripts/effects.js +0 -1123
- data/test/dummy_app/public/javascripts/prototype.js +0 -6001
- data/test/dummy_app/public/javascripts/rails.js +0 -175
- data/test/dummy_app/themes/default/javascripts/app.js +0 -1
- data/test/dummy_app/themes/default/stylesheets/style.css +0 -0
- data/test/dummy_app/themes/default/stylesheets/style2.css +0 -3
- data/test/dummy_app/themes/default/views/layouts/default.html.erb +0 -10
- data/test/dummy_app/themes/default/views/products/index.html.erb +0 -0
- data/test/lib/action_controller_test.rb +0 -170
- data/test/lib/action_mailer_test.rb +0 -35
- data/test/lib/action_view_test.rb +0 -54
- data/test/lib/assets_controller_test.rb +0 -73
- data/test/lib/common_methods_test.rb +0 -28
- data/test/lib/config_test.rb +0 -26
- data/test/lib/integration_test.rb +0 -12
- data/test/lib/routes_test.rb +0 -40
- data/test/lib/themes_for_rails_test.rb +0 -18
- data/test/support/extensions.rb +0 -19
- data/test/test_helper.rb +0 -12
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: themes_for_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0rc1
|
5
|
+
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Lucas Florio
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2011-11-16 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: themes_for_rails
|
16
|
+
requirement: &70366842408880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70366842408880
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement: &
|
26
|
+
name: rails
|
27
|
+
requirement: &70366842408240 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
|
-
- -
|
30
|
+
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '3.1'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70366842408240
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement: &
|
37
|
+
name: sqlite3
|
38
|
+
requirement: &70366842407580 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70366842407580
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: &
|
48
|
+
name: rspec
|
49
|
+
requirement: &70366842406900 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70366842406900
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
60
|
-
requirement: &
|
59
|
+
name: rspec-rails
|
60
|
+
requirement: &70366842406220 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,125 +65,120 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70366842406220
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rails
|
71
|
-
requirement: &
|
71
|
+
requirement: &70366842405560 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 3.0
|
77
|
-
type: :
|
76
|
+
version: 3.1.0
|
77
|
+
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70366842405560
|
80
80
|
description: It allows an application to have many different ways of rendering static
|
81
81
|
assets and dynamic views.
|
82
|
-
email:
|
83
|
-
- lucasefe@gmail.com
|
82
|
+
email: lucasefe@gmail.com
|
84
83
|
executables: []
|
85
84
|
extensions: []
|
86
|
-
extra_rdoc_files:
|
85
|
+
extra_rdoc_files:
|
86
|
+
- README.textile
|
87
87
|
files:
|
88
|
-
- .gitignore
|
89
88
|
- .rspec
|
90
|
-
- .
|
89
|
+
- .rvmrc
|
91
90
|
- Gemfile
|
92
91
|
- Gemfile.lock
|
93
|
-
- LICENSE
|
94
92
|
- README.textile
|
95
93
|
- Rakefile
|
96
|
-
-
|
97
|
-
- doc/REVIEW_NOTES
|
98
|
-
- doc/RMU_REVIEW
|
99
|
-
- doc/TODO.textile
|
94
|
+
- init.rb
|
100
95
|
- lib/generators/themes_for_rails/install_generator.rb
|
101
|
-
- lib/generators/themes_for_rails/templates/
|
102
|
-
- lib/generators/themes_for_rails/templates/theme/
|
103
|
-
- lib/generators/themes_for_rails/templates/theme/
|
96
|
+
- lib/generators/themes_for_rails/templates/README
|
97
|
+
- lib/generators/themes_for_rails/templates/theme/assets/images/.gitkeep
|
98
|
+
- lib/generators/themes_for_rails/templates/theme/assets/javascripts/.gitkeep
|
99
|
+
- lib/generators/themes_for_rails/templates/theme/assets/javascripts/application.js
|
100
|
+
- lib/generators/themes_for_rails/templates/theme/assets/stylesheets/.gitkeep
|
101
|
+
- lib/generators/themes_for_rails/templates/theme/assets/stylesheets/application.css
|
104
102
|
- lib/generators/themes_for_rails/templates/theme/views/layouts/.gitkeep
|
105
103
|
- lib/generators/themes_for_rails/theme_generator.rb
|
106
104
|
- lib/tasks/themes_for_rails.rake
|
107
105
|
- lib/themes_for_rails.rb
|
108
|
-
- lib/themes_for_rails/
|
109
|
-
- lib/themes_for_rails/action_mailer.rb
|
110
|
-
- lib/themes_for_rails/action_view.rb
|
111
|
-
- lib/themes_for_rails/assets_controller.rb
|
106
|
+
- lib/themes_for_rails/assets_finder.rb
|
112
107
|
- lib/themes_for_rails/common_methods.rb
|
113
108
|
- lib/themes_for_rails/config.rb
|
114
|
-
- lib/themes_for_rails/
|
109
|
+
- lib/themes_for_rails/controller_methods.rb
|
110
|
+
- lib/themes_for_rails/logging.rb
|
111
|
+
- lib/themes_for_rails/mailer_methods.rb
|
115
112
|
- lib/themes_for_rails/railtie.rb
|
116
113
|
- lib/themes_for_rails/routes.rb
|
117
|
-
- lib/themes_for_rails/url_helpers.rb
|
118
114
|
- lib/themes_for_rails/version.rb
|
119
|
-
-
|
120
|
-
-
|
121
|
-
-
|
122
|
-
-
|
123
|
-
-
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
150
|
-
-
|
151
|
-
-
|
152
|
-
-
|
153
|
-
-
|
154
|
-
-
|
155
|
-
-
|
156
|
-
-
|
157
|
-
-
|
158
|
-
-
|
159
|
-
-
|
160
|
-
-
|
161
|
-
-
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
166
|
-
-
|
167
|
-
-
|
168
|
-
-
|
169
|
-
-
|
170
|
-
-
|
171
|
-
-
|
172
|
-
-
|
173
|
-
-
|
174
|
-
-
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
178
|
-
-
|
179
|
-
-
|
180
|
-
-
|
181
|
-
- test/
|
182
|
-
- test/
|
183
|
-
- test/
|
184
|
-
- test/test_helper.rb
|
115
|
+
- lib/themes_for_rails/view_helpers.rb
|
116
|
+
- spec/controllers/my_controller_spec.rb
|
117
|
+
- spec/dummy/.gitignore
|
118
|
+
- spec/dummy/Gemfile
|
119
|
+
- spec/dummy/Gemfile.lock
|
120
|
+
- spec/dummy/README
|
121
|
+
- spec/dummy/Rakefile
|
122
|
+
- spec/dummy/app/assets/images/rails.png
|
123
|
+
- spec/dummy/app/assets/javascripts/application.js
|
124
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
125
|
+
- spec/dummy/app/controllers/application_controller.rb
|
126
|
+
- spec/dummy/app/helpers/application_helper.rb
|
127
|
+
- spec/dummy/app/mailers/.gitkeep
|
128
|
+
- spec/dummy/app/models/.gitkeep
|
129
|
+
- spec/dummy/app/themes/default/assets/images/rails.png
|
130
|
+
- spec/dummy/app/themes/default/assets/javascripts/application.js
|
131
|
+
- spec/dummy/app/themes/default/assets/stylesheets/application.css
|
132
|
+
- spec/dummy/app/themes/default/views/layouts/application.html.erb
|
133
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
134
|
+
- spec/dummy/config.ru
|
135
|
+
- spec/dummy/config/application.rb
|
136
|
+
- spec/dummy/config/boot.rb
|
137
|
+
- spec/dummy/config/database.yml
|
138
|
+
- spec/dummy/config/environment.rb
|
139
|
+
- spec/dummy/config/environments/development.rb
|
140
|
+
- spec/dummy/config/environments/production.rb
|
141
|
+
- spec/dummy/config/environments/test.rb
|
142
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
143
|
+
- spec/dummy/config/initializers/inflections.rb
|
144
|
+
- spec/dummy/config/initializers/mime_types.rb
|
145
|
+
- spec/dummy/config/initializers/secret_token.rb
|
146
|
+
- spec/dummy/config/initializers/session_store.rb
|
147
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
148
|
+
- spec/dummy/config/locales/en.yml
|
149
|
+
- spec/dummy/config/routes.rb
|
150
|
+
- spec/dummy/db/seeds.rb
|
151
|
+
- spec/dummy/doc/README_FOR_APP
|
152
|
+
- spec/dummy/lib/assets/.gitkeep
|
153
|
+
- spec/dummy/lib/tasks/.gitkeep
|
154
|
+
- spec/dummy/log/.gitkeep
|
155
|
+
- spec/dummy/public/404.html
|
156
|
+
- spec/dummy/public/422.html
|
157
|
+
- spec/dummy/public/500.html
|
158
|
+
- spec/dummy/public/favicon.ico
|
159
|
+
- spec/dummy/public/index.html
|
160
|
+
- spec/dummy/public/robots.txt
|
161
|
+
- spec/dummy/script/rails
|
162
|
+
- spec/dummy/test/fixtures/.gitkeep
|
163
|
+
- spec/dummy/test/functional/.gitkeep
|
164
|
+
- spec/dummy/test/integration/.gitkeep
|
165
|
+
- spec/dummy/test/performance/browsing_test.rb
|
166
|
+
- spec/dummy/test/test_helper.rb
|
167
|
+
- spec/dummy/test/unit/.gitkeep
|
168
|
+
- spec/dummy/vendor/assets/stylesheets/.gitkeep
|
169
|
+
- spec/dummy/vendor/plugins/.gitkeep
|
170
|
+
- spec/lib/assets_finder_spec.rb
|
171
|
+
- spec/lib/common_methods_spec.rb
|
172
|
+
- spec/lib/config_spec.rb
|
173
|
+
- spec/lib/controller_methods_spec.rb
|
174
|
+
- spec/lib/view_helpers_spec.rb
|
175
|
+
- spec/mailers/mailer_methods_spec.rb
|
176
|
+
- spec/spec_helper.rb
|
177
|
+
- test/dummy_app/Gemfile.lock
|
178
|
+
- test/dummy_app/log/development.log
|
179
|
+
- test/dummy_app/log/test.log
|
185
180
|
- themes_for_rails.gemspec
|
186
|
-
homepage:
|
181
|
+
homepage: http://github.com/lucasefe/themes_for_rails
|
187
182
|
licenses: []
|
188
183
|
post_install_message:
|
189
184
|
rdoc_options: []
|
@@ -198,79 +193,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
198
193
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
194
|
none: false
|
200
195
|
requirements:
|
201
|
-
- - ! '
|
196
|
+
- - ! '>'
|
202
197
|
- !ruby/object:Gem::Version
|
203
|
-
version:
|
198
|
+
version: 1.3.1
|
204
199
|
requirements: []
|
205
200
|
rubyforge_project:
|
206
|
-
rubygems_version: 1.8.
|
201
|
+
rubygems_version: 1.8.10
|
207
202
|
signing_key:
|
208
203
|
specification_version: 3
|
209
|
-
summary:
|
210
|
-
test_files:
|
211
|
-
- test/dummy_app/.gitignore
|
212
|
-
- test/dummy_app/Gemfile
|
213
|
-
- test/dummy_app/Rakefile
|
214
|
-
- test/dummy_app/another_themes/another_default/images/logo.png
|
215
|
-
- test/dummy_app/another_themes/another_default/images/nested/logo.png
|
216
|
-
- test/dummy_app/another_themes/another_default/javascripts/app.js
|
217
|
-
- test/dummy_app/another_themes/another_default/stylesheets/style.css
|
218
|
-
- test/dummy_app/another_themes/another_default/stylesheets/style2.css
|
219
|
-
- test/dummy_app/another_themes/another_default/views/layouts/default.html.erb
|
220
|
-
- test/dummy_app/another_themes/another_default/views/products/index.html.erb
|
221
|
-
- test/dummy_app/app/controllers/application_controller.rb
|
222
|
-
- test/dummy_app/app/helpers/application_helper.rb
|
223
|
-
- test/dummy_app/app/views/layouts/application.html.erb
|
224
|
-
- test/dummy_app/config.ru
|
225
|
-
- test/dummy_app/config/application.rb
|
226
|
-
- test/dummy_app/config/boot.rb
|
227
|
-
- test/dummy_app/config/database.yml
|
228
|
-
- test/dummy_app/config/environment.rb
|
229
|
-
- test/dummy_app/config/environments/development.rb
|
230
|
-
- test/dummy_app/config/environments/production.rb
|
231
|
-
- test/dummy_app/config/environments/test.rb
|
232
|
-
- test/dummy_app/config/initializers/backtrace_silencers.rb
|
233
|
-
- test/dummy_app/config/initializers/inflections.rb
|
234
|
-
- test/dummy_app/config/initializers/mime_types.rb
|
235
|
-
- test/dummy_app/config/initializers/secret_token.rb
|
236
|
-
- test/dummy_app/config/initializers/session_store.rb
|
237
|
-
- test/dummy_app/config/locales/en.yml
|
238
|
-
- test/dummy_app/config/routes.rb
|
239
|
-
- test/dummy_app/db/seeds.rb
|
240
|
-
- test/dummy_app/empty_themes/.gitkeep
|
241
|
-
- test/dummy_app/lib/tasks/.gitkeep
|
242
|
-
- test/dummy_app/public/404.html
|
243
|
-
- test/dummy_app/public/422.html
|
244
|
-
- test/dummy_app/public/500.html
|
245
|
-
- test/dummy_app/public/favicon.ico
|
246
|
-
- test/dummy_app/public/images/rails.png
|
247
|
-
- test/dummy_app/public/index.html
|
248
|
-
- test/dummy_app/public/javascripts/application.js
|
249
|
-
- test/dummy_app/public/javascripts/controls.js
|
250
|
-
- test/dummy_app/public/javascripts/dragdrop.js
|
251
|
-
- test/dummy_app/public/javascripts/effects.js
|
252
|
-
- test/dummy_app/public/javascripts/prototype.js
|
253
|
-
- test/dummy_app/public/javascripts/rails.js
|
254
|
-
- test/dummy_app/public/robots.txt
|
255
|
-
- test/dummy_app/public/stylesheets/.gitkeep
|
256
|
-
- test/dummy_app/script/rails
|
257
|
-
- test/dummy_app/themes/default/images/logo.png
|
258
|
-
- test/dummy_app/themes/default/images/nested/logo.png
|
259
|
-
- test/dummy_app/themes/default/javascripts/app.js
|
260
|
-
- test/dummy_app/themes/default/javascripts/app.min.js
|
261
|
-
- test/dummy_app/themes/default/stylesheets/images/logo.png
|
262
|
-
- test/dummy_app/themes/default/stylesheets/style.css
|
263
|
-
- test/dummy_app/themes/default/stylesheets/style2.css
|
264
|
-
- test/dummy_app/themes/default/views/layouts/default.html.erb
|
265
|
-
- test/dummy_app/themes/default/views/products/index.html.erb
|
266
|
-
- test/lib/action_controller_test.rb
|
267
|
-
- test/lib/action_mailer_test.rb
|
268
|
-
- test/lib/action_view_test.rb
|
269
|
-
- test/lib/assets_controller_test.rb
|
270
|
-
- test/lib/common_methods_test.rb
|
271
|
-
- test/lib/config_test.rb
|
272
|
-
- test/lib/integration_test.rb
|
273
|
-
- test/lib/routes_test.rb
|
274
|
-
- test/lib/themes_for_rails_test.rb
|
275
|
-
- test/support/extensions.rb
|
276
|
-
- test/test_helper.rb
|
204
|
+
summary: Themes support for rails (3)
|
205
|
+
test_files: []
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License
|
2
|
-
|
3
|
-
Copyright (c) Lucas Florio
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/doc/README.textile
DELETED
@@ -1,363 +0,0 @@
|
|
1
|
-
h1. Theme For Rails (3 and hopefully later)
|
2
|
-
|
3
|
-
h2. Features list / Wish list
|
4
|
-
|
5
|
-
* Support for adding themes which includes stylesheets, javascripts, views and layouts.
|
6
|
-
* add a theme-image-url sass helper method for asset pipeline based themes
|
7
|
-
* update the generators and rake tasks to support asset pipeline based themes
|
8
|
-
|
9
|
-
<pre>
|
10
|
-
$app_root
|
11
|
-
themes/
|
12
|
-
[theme_name]
|
13
|
-
images/
|
14
|
-
stylesheets/
|
15
|
-
javascripts/
|
16
|
-
views/ <- you can override application views
|
17
|
-
layouts/ <- layout .rhtml or .liquid templates
|
18
|
-
</pre>
|
19
|
-
|
20
|
-
h2. Instructions
|
21
|
-
|
22
|
-
Add themes_for_rails to your Gemfile.
|
23
|
-
|
24
|
-
<pre>
|
25
|
-
gem 'themes_for_rails'
|
26
|
-
</pre>
|
27
|
-
|
28
|
-
Add themes_for_rails to your config/routes.rb
|
29
|
-
|
30
|
-
<pre>
|
31
|
-
MySuperDuperApp::Application.routes.draw do
|
32
|
-
# ...
|
33
|
-
themes_for_rails
|
34
|
-
# ...
|
35
|
-
end
|
36
|
-
</pre>
|
37
|
-
|
38
|
-
h3. Additional Instructions for using the Rails Asset Pipeline
|
39
|
-
|
40
|
-
In order to use themes_for_rails with the asset pipeline, you will need to configure a few settings and place your themes in the asset pipeline directory.
|
41
|
-
|
42
|
-
First, move your assets into the asset pipeline. For example:
|
43
|
-
|
44
|
-
<pre>
|
45
|
-
$app_root
|
46
|
-
app/
|
47
|
-
assets/
|
48
|
-
images/ <-- default asset pipeline folder
|
49
|
-
javascripts/ <-- default asset pipeline folder
|
50
|
-
stylesheets/ <-- default asset pipeline folder
|
51
|
-
themes/ <-- your themes root
|
52
|
-
[theme_name]
|
53
|
-
images/
|
54
|
-
stylesheets/
|
55
|
-
javascripts/
|
56
|
-
views/ <- you can override application views
|
57
|
-
layouts/ <- layout .rhtml or .liquid templates
|
58
|
-
</pre>
|
59
|
-
|
60
|
-
Create an initializer for themes in your {Rails.root}/config/initializers directory and set the themes_dir and assets_dir settings appropriately.
|
61
|
-
|
62
|
-
<pre>
|
63
|
-
# Rails.root/config/initializers/themes_for_rails.rb (for instance)
|
64
|
-
ThemesForRails.config do |config|
|
65
|
-
#
|
66
|
-
# If you have placed your themes like the example path above within the asset pipeline:
|
67
|
-
config.themes_dir = 'assets'
|
68
|
-
config.assets_dir = 'app/assets/themes'
|
69
|
-
# ...
|
70
|
-
end
|
71
|
-
</pre>
|
72
|
-
|
73
|
-
In your theme stylesheets directory, you can create an application.css file using the Sprockets require methods:
|
74
|
-
|
75
|
-
<pre>
|
76
|
-
/*
|
77
|
-
*= require global_stylesheet_name
|
78
|
-
*= require theme_name/stylesheets/stylesheet_name
|
79
|
-
*/
|
80
|
-
</pre>
|
81
|
-
|
82
|
-
As you can see, if you do not preface with the theme_name/stylesheets it will reference the root /app/assets/stylesheets path for global stylesheets (great for mixins and reset styles)
|
83
|
-
|
84
|
-
Currently, one unresolved issue with this setup is that you must pass the theme_name/images path into your sass image-url helper methods. For example, if you are including an image in the 'default' theme: <pre>image-url('default/images/background.png')</pre>
|
85
|
-
|
86
|
-
If you do not want to have your views inside the asset pipeline dir, you can alternatively configure your application like this:
|
87
|
-
|
88
|
-
<pre>
|
89
|
-
$app_root
|
90
|
-
app/
|
91
|
-
assets/
|
92
|
-
images/ <-- default asset pipeline folder
|
93
|
-
javascripts/ <-- default asset pipeline folder
|
94
|
-
stylesheets/ <-- default asset pipeline folder
|
95
|
-
themes/ <-- your themes root
|
96
|
-
[theme_name]
|
97
|
-
images/
|
98
|
-
stylesheets/
|
99
|
-
javascripts/
|
100
|
-
views/
|
101
|
-
themes/ <-- note themes folder lives under views in this scenario
|
102
|
-
[theme_name]
|
103
|
-
layouts/ <- layout .rhtml or .liquid templates
|
104
|
-
</pre>
|
105
|
-
|
106
|
-
and in your initializer, you will need to set the views_dir config setting like so:
|
107
|
-
|
108
|
-
<pre>
|
109
|
-
# Rails.root/config/initializers/themes_for_rails.rb (for instance)
|
110
|
-
ThemesForRails.config do |config|
|
111
|
-
#
|
112
|
-
# If you have placed your themes like the example path above within the asset pipeline:
|
113
|
-
config.themes_dir = 'assets'
|
114
|
-
config.assets_dir = 'app/assets/themes'
|
115
|
-
config.views_dir = 'app/views/themes'
|
116
|
-
# ...
|
117
|
-
end
|
118
|
-
</pre>
|
119
|
-
|
120
|
-
After that, the rest of the config for asset pipeline styles and whatnot mentioned above will work.
|
121
|
-
|
122
|
-
h3. And then?
|
123
|
-
|
124
|
-
Now you'll be able to use themes like this:
|
125
|
-
|
126
|
-
Inside method, for some explicit action:
|
127
|
-
|
128
|
-
<pre>
|
129
|
-
class MyController < ApplicationController
|
130
|
-
def show
|
131
|
-
theme "purple"
|
132
|
-
end
|
133
|
-
end
|
134
|
-
</pre>
|
135
|
-
|
136
|
-
Or at class level definition, in order to set a theme for more than one action. I think this is is prettier, and less invasive.
|
137
|
-
|
138
|
-
<pre>
|
139
|
-
class MyController < ApplicationController
|
140
|
-
theme "purple" # all actions will use this theme
|
141
|
-
def show
|
142
|
-
...
|
143
|
-
end
|
144
|
-
end
|
145
|
-
</pre>
|
146
|
-
|
147
|
-
You could also enable a theme for some actions only
|
148
|
-
|
149
|
-
<pre>
|
150
|
-
class MyController < ApplicationController
|
151
|
-
theme "purple", :only => :show
|
152
|
-
def show
|
153
|
-
# with theme
|
154
|
-
end
|
155
|
-
def edit
|
156
|
-
# no theme
|
157
|
-
end
|
158
|
-
end
|
159
|
-
</pre>
|
160
|
-
|
161
|
-
As a plus, you could do this to defer theme name resolution to a method:
|
162
|
-
|
163
|
-
<pre>
|
164
|
-
class MyController < ApplicationController
|
165
|
-
theme :theme_resolver
|
166
|
-
# ...
|
167
|
-
private
|
168
|
-
def theme_resolver
|
169
|
-
current_user.theme # or anything else that return a string.
|
170
|
-
end
|
171
|
-
end
|
172
|
-
</pre>
|
173
|
-
|
174
|
-
As a general rule, when passing a String, that becomes the theme name, but when a Symbol is sent, it gets treated as method message.
|
175
|
-
|
176
|
-
|
177
|
-
h3. Action Mailer integration:
|
178
|
-
|
179
|
-
As a plus, you can use it from Action Mailer too (thanks to rafaelss) like this:
|
180
|
-
|
181
|
-
<pre>
|
182
|
-
class MyMailer < ActionMailer::Base
|
183
|
-
|
184
|
-
def notify_someone
|
185
|
-
mail :theme => "blue" , :to => "some@one.com"
|
186
|
-
end
|
187
|
-
|
188
|
-
end
|
189
|
-
</pre>
|
190
|
-
|
191
|
-
Or set the theme by default like this (thanks to maxjgon):
|
192
|
-
|
193
|
-
<pre>
|
194
|
-
class MyMailer < ActionMailer::Base
|
195
|
-
|
196
|
-
default :theme => "blue"
|
197
|
-
|
198
|
-
def notify_someone
|
199
|
-
mail :to => "some@one.com"
|
200
|
-
end
|
201
|
-
|
202
|
-
end
|
203
|
-
</pre>
|
204
|
-
|
205
|
-
h3. Url Helpers
|
206
|
-
|
207
|
-
In your views you should be able to access your assets like this (given the theme 'default' is set):
|
208
|
-
|
209
|
-
<pre>
|
210
|
-
current_theme_image_path('logo.png') # => /themes/default/images/logo.png
|
211
|
-
current_theme_stylesheet_path('style') # => /themes/default/stylesheets/logo.css
|
212
|
-
current_theme_javascript_path('app') # => /themes/default/stylesheets/app.js
|
213
|
-
</pre>
|
214
|
-
|
215
|
-
Or a given theme:
|
216
|
-
|
217
|
-
<pre>
|
218
|
-
current_theme_image_path('logo.png', 'purple') # => /themes/purple/images/logo.png
|
219
|
-
</pre>
|
220
|
-
|
221
|
-
In your application views, there are theme specific helper tags
|
222
|
-
available to you. For ERb templates they are:
|
223
|
-
|
224
|
-
<pre>
|
225
|
-
theme_image_tag
|
226
|
-
theme_image_path
|
227
|
-
theme_javascript_include_tag
|
228
|
-
theme_javascript_path
|
229
|
-
theme_stylesheet_link_tag
|
230
|
-
theme_stylesheet_path
|
231
|
-
</pre>
|
232
|
-
|
233
|
-
h2. Generators
|
234
|
-
|
235
|
-
For now, it only creates the theme folder and add the "themes_for_rails" route in the routes.rb.
|
236
|
-
|
237
|
-
<pre>
|
238
|
-
rails generate themes_for_rails:install
|
239
|
-
</pre>
|
240
|
-
|
241
|
-
Inside the themes folder, it create a structure for my_theme.
|
242
|
-
|
243
|
-
<pre>
|
244
|
-
rails generate themes_for_rails:theme my_theme
|
245
|
-
</pre>
|
246
|
-
|
247
|
-
h2. Changing things
|
248
|
-
|
249
|
-
At least for now, you can change the ThemesForRails base dir in your app, in the corresponding environment file, or in your application.rb file. Do it like this:
|
250
|
-
|
251
|
-
<pre>
|
252
|
-
KillerApp::Application.configure do
|
253
|
-
#
|
254
|
-
|
255
|
-
config.themes_for_rails.base_dir = File.join(Rails.root, "tmp")
|
256
|
-
|
257
|
-
#...
|
258
|
-
end
|
259
|
-
</pre>
|
260
|
-
|
261
|
-
Thanks to matheusca, now you can change the name of the theme's dir.
|
262
|
-
|
263
|
-
<pre>
|
264
|
-
KillerApp::Application.configure do
|
265
|
-
#
|
266
|
-
|
267
|
-
config.themes_for_rails.themes_dir = "another_themes"
|
268
|
-
|
269
|
-
#...
|
270
|
-
end
|
271
|
-
</pre>
|
272
|
-
|
273
|
-
h2. Sass support
|
274
|
-
|
275
|
-
ThemesForRails will automatically add the themes paths to Sass, if sass is available.
|
276
|
-
|
277
|
-
For instance, everything you put inside themes/my_theme/stylesheets/sass will get compiled into themes/my_theme/stylesheets (duh, right?)
|
278
|
-
|
279
|
-
To bypass sass configuration, do this:
|
280
|
-
<pre>
|
281
|
-
KillerApp::Application.configure do
|
282
|
-
#
|
283
|
-
|
284
|
-
config.themes_for_rails.use_sass = false
|
285
|
-
|
286
|
-
#...
|
287
|
-
end
|
288
|
-
</pre>
|
289
|
-
|
290
|
-
h2. Another way to change things
|
291
|
-
|
292
|
-
If you don't like this approach and prefer something more like an initializer file, you could create one an put something like this.
|
293
|
-
|
294
|
-
<pre>
|
295
|
-
# Rails.root/config/initializers/themes_for_rails.rb (for instance)
|
296
|
-
ThemesForRails.config do |config|
|
297
|
-
#
|
298
|
-
config.themes_dir = 'another_themes'
|
299
|
-
# ...
|
300
|
-
end
|
301
|
-
</pre>
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
h2. Notes and Warnings.
|
306
|
-
|
307
|
-
If you are running an app in production mode, and you get the static files with no content, is because you don't have X-senfile enabled at your web server.
|
308
|
-
|
309
|
-
You can do two things:
|
310
|
-
|
311
|
-
comment out this line in your production.rb file:
|
312
|
-
|
313
|
-
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
314
|
-
|
315
|
-
or
|
316
|
-
|
317
|
-
configure your web server to use it. :)
|
318
|
-
|
319
|
-
|
320
|
-
h2. Documentation
|
321
|
-
|
322
|
-
"Read it here":http://rubydoc.info/github/lucasefe/themes_for_rails/master/frames
|
323
|
-
|
324
|
-
h2. Ideas
|
325
|
-
|
326
|
-
* Add ThemesForRails::Railtie for configuration, so we selectively set the plugin on or off. Also to be able to change several settings.
|
327
|
-
* -Add routes to allow access to the theme's static resources (js and cs), unless cached on public folder by capistrano / rake.-
|
328
|
-
* -Extend Action View path in order to make the views accessible. Same for the layouts.-
|
329
|
-
* More tests ford edge cases. Now I am only testing the happy paths.
|
330
|
-
|
331
|
-
h2. Things to remember.
|
332
|
-
|
333
|
-
* -Final version should be a gem. Initialization hooks doesn't work when using this as a plugin (vendor/plugins).-
|
334
|
-
* -Research about testing this kind of gem. I really don't have a clue.- Testing in place!
|
335
|
-
* I should probably load the theme list at start time, to be able to consult it as needed. I am gonna need that when dealing with runtime theme selection. Many themes are going to be used simultaneously, so I have to be able to switch view paths as fast as I can.
|
336
|
-
|
337
|
-
h2. Rails 2 Support
|
338
|
-
|
339
|
-
This gem only works with Rails 3 (duh). If you want the same exactly behavior, but for Rails 2.x, go "here":http://github.com/jystewart/theme_support .
|
340
|
-
|
341
|
-
|
342
|
-
h2. Running tests
|
343
|
-
|
344
|
-
<pre>
|
345
|
-
gem install bundler
|
346
|
-
bundle install
|
347
|
-
rake
|
348
|
-
</pre>
|
349
|
-
|
350
|
-
h2. Authors and contributors
|
351
|
-
|
352
|
-
* lucasefe
|
353
|
-
* jbarreneche
|
354
|
-
* kule
|
355
|
-
* matheusmoreira
|
356
|
-
* rafaelss
|
357
|
-
* maxjgon
|
358
|
-
|
359
|
-
h2. Last but not least
|
360
|
-
|
361
|
-
If you are using this gem, please, take a minute to recommend me at Working With Rails.
|
362
|
-
|
363
|
-
<a href="http://www.workingwithrails.com/recommendation/new/person/7277-lucas-florio"><img alt="Recommend Me" src="http://workingwithrails.com/images/tools/compact-small.jpg" /></a>
|