themes_on_rails 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -11
- data/Rakefile +2 -2
- data/lib/generators/themes_on_rails/templates/layout.html.liquid +14 -0
- data/lib/generators/themes_on_rails/theme_generator.rb +10 -1
- data/lib/themes_on_rails.rb +9 -6
- data/lib/themes_on_rails/action_controller.rb +10 -5
- data/lib/themes_on_rails/engine.rb +23 -1
- data/lib/themes_on_rails/version.rb +2 -2
- data/spec/dummy/app/controllers/posts_controller.rb +1 -1
- data/spec/dummy/app/themes/{basic_blue/assets/javascripts/basic_blue → theme_a/assets/javascripts/theme_a}/all.js +0 -0
- data/spec/dummy/app/themes/{basic_blue/assets/stylesheets/basic_blue → theme_a/assets/stylesheets/theme_a}/all.css +0 -0
- data/spec/dummy/app/themes/theme_a/views/layouts/theme_a.html.haml +9 -0
- data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/_form.html.erb +0 -0
- data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/edit.html.erb +1 -1
- data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/index.html.erb +1 -1
- data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/new.html.erb +1 -1
- data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/show.html.erb +1 -1
- data/spec/dummy/app/themes/{professional_blue/assets/javascripts/professional_blue → theme_b/assets/javascripts/theme_b}/all.js +0 -0
- data/spec/dummy/app/themes/{professional_blue/assets/stylesheets/professional_blue → theme_b/assets/stylesheets/theme_b}/all.css +0 -0
- data/spec/dummy/app/themes/theme_b/views/layouts/alternate_theme_b.html.haml +9 -0
- data/spec/dummy/app/themes/theme_b/views/layouts/theme_b.html.haml +9 -0
- data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/_form.html.erb +0 -0
- data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/edit.html.erb +1 -1
- data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/index.html.erb +2 -2
- data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/new.html.erb +1 -1
- data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/show.html.erb +1 -1
- data/spec/dummy/app/themes/theme_c/assets/images/theme_c/1.jpg +0 -0
- data/spec/dummy/app/themes/theme_c/assets/javascripts/theme_c/all.js +7 -0
- data/spec/dummy/app/themes/theme_c/assets/stylesheets/theme_c/all.css +9 -0
- data/spec/dummy/app/themes/theme_c/locales/en.yml +4 -0
- data/spec/dummy/app/themes/theme_c/locales/km.yml +4 -0
- data/spec/dummy/app/themes/theme_c/views/layouts/theme_c.liquid +11 -0
- data/spec/dummy/app/themes/theme_c/views/posts/_partial.liquid +1 -0
- data/spec/dummy/app/themes/theme_c/views/posts/index.liquid +3 -0
- data/spec/dummy/log/development.log +275 -0
- data/spec/dummy/log/test.log +1897 -0
- data/spec/dummy/spec/controllers/posts_controller_spec.rb +37 -17
- data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1fd9ad217474bbaee0fa43a1497b4126 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/76032e6eabf40d365a1dae7dccb36a39 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7dc53503f61ca13fc175ac459f52ae6c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/83e0f4bbef733c177f077762a5225f69 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b2748190620f4b3edb4a2b4d7e9146c5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c66b2f58de9cb0b261cc990107adb241 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c9c47e931d0f7e4959ed2a882fb2ebe8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/dcd26efc7d0c0fd3e246f9cc1391c537 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e4af50439f4554f9b82ec9cbb6e5463f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ef18888e878b0844df17b3a647806b8a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f97e9d28fcfdb3281202d537865677b9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fa7e291abdc6c5f378253d3683b11427 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1fd9ad217474bbaee0fa43a1497b4126 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/76032e6eabf40d365a1dae7dccb36a39 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7dc53503f61ca13fc175ac459f52ae6c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/83e0f4bbef733c177f077762a5225f69 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b2748190620f4b3edb4a2b4d7e9146c5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c66b2f58de9cb0b261cc990107adb241 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c9c47e931d0f7e4959ed2a882fb2ebe8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/dcd26efc7d0c0fd3e246f9cc1391c537 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e4af50439f4554f9b82ec9cbb6e5463f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ef18888e878b0844df17b3a647806b8a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f97e9d28fcfdb3281202d537865677b9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fa7e291abdc6c5f378253d3683b11427 +0 -0
- data/spec/generators/themes_on_rails/theme_generator_spec.rb +40 -21
- data/spec/lib/action_controller_spec.rb +10 -10
- data/spec/lib/controller_additions_spec.rb +2 -2
- data/spec/lib/engine_spec.rb +24 -0
- data/spec/spec_helper.rb +7 -4
- metadata +112 -40
- data/lib/themes_on_rails/railtie.rb +0 -23
- data/spec/dummy/app/themes/basic_blue/views/layouts/basic_blue.html.haml +0 -9
- data/spec/dummy/app/themes/professional_blue/views/layouts/professional_blue.html.haml +0 -9
- data/spec/lib/assets_path_spec.rb +0 -15
@@ -1,23 +0,0 @@
|
|
1
|
-
module ThemesOnRails
|
2
|
-
class Railtie < ::Rails::Railtie
|
3
|
-
|
4
|
-
initializer "themes_on_rails.action_controller" do |app|
|
5
|
-
ActiveSupport.on_load :action_controller do
|
6
|
-
include ThemesOnRails::ControllerAdditions
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
initializer "themes_on_rails.assets_path" do |app|
|
11
|
-
Dir.glob("#{Rails.root}/app/themes/*/assets/*").each do |dir|
|
12
|
-
app.config.assets.paths << dir
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
initializer "themes_on_rails.precompile" do |app|
|
17
|
-
app.config.assets.precompile += [ Proc.new { |path, fn| fn =~ /app\/themes/ && !%w(.js .css).include?(File.extname(path)) } ]
|
18
|
-
app.config.assets.precompile += Dir["app/themes/*"].map { |path| "#{path.split('/').last}/all.js" }
|
19
|
-
app.config.assets.precompile += Dir["app/themes/*"].map { |path| "#{path.split('/').last}/all.css" }
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Asset search paths" do
|
4
|
-
it "includes `basic_blue`: images, javascripts, stylesheets" do
|
5
|
-
expect(Rails.application.config.assets.paths.to_s).to match(/basic_blue\/assets\/images/)
|
6
|
-
expect(Rails.application.config.assets.paths.to_s).to match(/basic_blue\/assets\/javascripts/)
|
7
|
-
expect(Rails.application.config.assets.paths.to_s).to match(/basic_blue\/assets\/stylesheets/)
|
8
|
-
end
|
9
|
-
|
10
|
-
it "includes `professional_blue`: images, javascripts, stylesheets" do
|
11
|
-
expect(Rails.application.config.assets.paths.to_s).to match(/professional_blue\/assets\/images/)
|
12
|
-
expect(Rails.application.config.assets.paths.to_s).to match(/professional_blue\/assets\/javascripts/)
|
13
|
-
expect(Rails.application.config.assets.paths.to_s).to match(/professional_blue\/assets\/stylesheets/)
|
14
|
-
end
|
15
|
-
end
|