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
@@ -3,43 +3,63 @@ require "spec_helper"
|
|
3
3
|
describe PostsController do
|
4
4
|
render_views
|
5
5
|
|
6
|
-
context "theme :
|
7
|
-
it "renders with provided theme :
|
8
|
-
get :index, theme: "
|
6
|
+
context "theme :theme_b" do
|
7
|
+
it "renders with provided theme :theme_b" do
|
8
|
+
get :index, theme: "theme_b"
|
9
9
|
|
10
|
-
expect(response.body).to match(/<h1>Listing posts:
|
10
|
+
expect(response.body).to match(/<h1>Listing posts: theme_b<\/h1>/)
|
11
11
|
end
|
12
12
|
|
13
|
-
it "renders with layout :
|
14
|
-
get :index, theme: "
|
13
|
+
it "renders with layout :theme_b" do
|
14
|
+
get :index, theme: "theme_b"
|
15
15
|
|
16
|
-
expect(response).to render_template("layouts/
|
16
|
+
expect(response).to render_template("layouts/theme_b")
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
context "theme :
|
21
|
-
it "renders with provided theme :
|
22
|
-
get :index, theme: "
|
20
|
+
context "theme :theme_a" do
|
21
|
+
it "renders with provided theme :theme_a" do
|
22
|
+
get :index, theme: "theme_a"
|
23
23
|
|
24
|
-
expect(response.body).to match(/<h1>Listing posts:
|
24
|
+
expect(response.body).to match(/<h1>Listing posts: theme_a<\/h1>/)
|
25
25
|
end
|
26
26
|
|
27
|
-
it "renders with layout :
|
28
|
-
get :index, theme: "
|
27
|
+
it "renders with layout :theme_a" do
|
28
|
+
get :index, theme: "theme_a"
|
29
29
|
|
30
|
-
expect(response).to render_template("layouts/
|
30
|
+
expect(response).to render_template("layouts/theme_a")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context "theme :theme_c" do
|
35
|
+
it "renders with provided theme :theme_c" do
|
36
|
+
get :index, theme: "theme_c"
|
37
|
+
|
38
|
+
expect(response.body).to match(/<h1>Listing posts: theme_c<\/h1>/)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "renders with layout :theme_c" do
|
42
|
+
get :index, theme: "theme_c"
|
43
|
+
|
44
|
+
expect(response).to render_template("layouts/theme_c")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "renders with partial" do
|
48
|
+
get :index, theme: "theme_c"
|
49
|
+
|
50
|
+
expect(response.body).to match(/Theme_C_Partial/)
|
31
51
|
end
|
32
52
|
end
|
33
53
|
|
34
54
|
context "default views" do
|
35
55
|
it "renders with default views" do
|
36
|
-
get :new, theme: "
|
56
|
+
get :new, theme: "theme_a"
|
37
57
|
|
38
58
|
expect(response.body).to match(/<h1>New post<\/h1>/)
|
39
59
|
end
|
40
60
|
|
41
|
-
it "renders with layout :
|
42
|
-
get :new, theme: "
|
61
|
+
it "renders with layout :theme_a" do
|
62
|
+
get :new, theme: "theme_a"
|
43
63
|
|
44
64
|
expect(response).to render_template("layouts/application")
|
45
65
|
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -9,59 +9,78 @@ describe ThemesOnRails::Generators::ThemeGenerator do
|
|
9
9
|
|
10
10
|
before do
|
11
11
|
prepare_destination
|
12
|
-
run_generator %w(
|
12
|
+
run_generator %w(theme_a)
|
13
13
|
end
|
14
14
|
|
15
15
|
it "exists `app/themes`" do
|
16
16
|
expect(file("app/themes")).to exist
|
17
17
|
end
|
18
18
|
|
19
|
-
it "exists `app/themes/
|
20
|
-
expect(file("app/themes/
|
19
|
+
it "exists `app/themes/theme_a`" do
|
20
|
+
expect(file("app/themes/theme_a")).to exist
|
21
21
|
end
|
22
22
|
|
23
|
-
it "exists `app/themes/
|
24
|
-
expect(file("app/themes/
|
23
|
+
it "exists `app/themes/theme_a/locales`" do
|
24
|
+
expect(file("app/themes/theme_a/locales")).to exist
|
25
25
|
end
|
26
26
|
|
27
|
-
it "exists `app/themes/
|
28
|
-
expect(file("app/themes/
|
27
|
+
it "exists `app/themes/theme_a/assets/images/theme_a`" do
|
28
|
+
expect(file("app/themes/theme_a/assets/images/theme_a")).to exist
|
29
29
|
end
|
30
30
|
|
31
|
-
it "exists `app/themes/
|
32
|
-
expect(file("app/themes/
|
31
|
+
it "exists `app/themes/theme_a/assets/javascripts/theme_a`" do
|
32
|
+
expect(file("app/themes/theme_a/assets/javascripts/theme_a")).to exist
|
33
33
|
end
|
34
34
|
|
35
|
-
it "exists `app/themes/
|
36
|
-
expect(file("app/themes/
|
35
|
+
it "exists `app/themes/theme_a/assets/javascripts/theme_a/all.js`" do
|
36
|
+
expect(file("app/themes/theme_a/assets/javascripts/theme_a/all.js")).to exist
|
37
37
|
end
|
38
38
|
|
39
|
-
it "exists `app/themes/
|
40
|
-
expect(file("app/themes/
|
39
|
+
it "exists `app/themes/theme_a/assets/stylesheets/theme_a`" do
|
40
|
+
expect(file("app/themes/theme_a/assets/stylesheets/theme_a")).to exist
|
41
|
+
end
|
42
|
+
|
43
|
+
it "exists `app/themes/theme_a/assets/stylesheets/theme_a/all.css`" do
|
44
|
+
expect(file("app/themes/theme_a/assets/stylesheets/theme_a/all.css")).to exist
|
45
|
+
end
|
46
|
+
|
47
|
+
context "layout file: erb" do
|
48
|
+
before(:all) {
|
49
|
+
Rails.configuration.app_generators.rails[:template_engine] = :erb
|
50
|
+
}
|
51
|
+
after(:all) {
|
52
|
+
Rails.configuration.app_generators.rails[:template_engine] = :haml
|
53
|
+
}
|
54
|
+
subject { file("app/themes/theme_a/views/layouts/theme_a.html.erb") }
|
55
|
+
|
56
|
+
it { should exist }
|
57
|
+
it { should contain(/\= stylesheet_link_tag \"theme_a\/all\"/) }
|
58
|
+
it { should contain(/\= javascript_include_tag \"theme_a\/all\"/) }
|
41
59
|
end
|
42
60
|
|
43
61
|
context "layout file: haml" do
|
44
62
|
before(:all) {
|
45
63
|
Rails.configuration.app_generators.rails[:template_engine] = :haml
|
46
64
|
}
|
47
|
-
subject { file("app/themes/
|
65
|
+
subject { file("app/themes/theme_a/views/layouts/theme_a.html.haml") }
|
48
66
|
|
49
67
|
it { should exist }
|
50
|
-
it { should contain(/\= stylesheet_link_tag \"
|
51
|
-
it { should contain(/\= javascript_include_tag \"
|
68
|
+
it { should contain(/\= stylesheet_link_tag \"theme_a\/all\"/) }
|
69
|
+
it { should contain(/\= javascript_include_tag \"theme_a\/all\"/) }
|
52
70
|
end
|
53
71
|
|
54
|
-
context "layout file:
|
72
|
+
context "layout file: liquid" do
|
55
73
|
before(:all) {
|
56
|
-
Rails.configuration.app_generators.rails[:template_engine] = :
|
74
|
+
Rails.configuration.app_generators.rails[:template_engine] = :liquid
|
57
75
|
}
|
58
76
|
after(:all) {
|
59
77
|
Rails.configuration.app_generators.rails[:template_engine] = :haml
|
60
78
|
}
|
61
|
-
subject { file("app/themes/
|
79
|
+
subject { file("app/themes/theme_a/views/layouts/theme_a.liquid") }
|
62
80
|
|
63
81
|
it { should exist }
|
64
|
-
it { should contain(
|
65
|
-
it { should contain(
|
82
|
+
it { should contain(/\{\{ \'theme_a\/all\' | asset_path | javascript_include_tag \}\}/) }
|
83
|
+
it { should contain(/\{\{ \'theme_a\/all\' | asset_path | stylesheet_link_tag \}\}/) }
|
84
|
+
it { should contain(/\{\{ content_for_layout \}\}/) }
|
66
85
|
end
|
67
86
|
end
|
@@ -5,30 +5,30 @@ describe ThemesOnRails::ActionController do
|
|
5
5
|
let(:controller_class) { Class.new }
|
6
6
|
|
7
7
|
it "initializes with theme as string" do
|
8
|
-
action_controller = ThemesOnRails::ActionController.new(controller, "
|
8
|
+
action_controller = ThemesOnRails::ActionController.new(controller, "theme_a")
|
9
9
|
|
10
|
-
expect(action_controller.theme_name).to eq("
|
10
|
+
expect(action_controller.theme_name).to eq("theme_a")
|
11
11
|
end
|
12
12
|
|
13
13
|
it "initializes with theme as symbol method" do
|
14
14
|
def controller.theme_resolver
|
15
|
-
"
|
15
|
+
"theme_a"
|
16
16
|
end
|
17
17
|
action_controller = ThemesOnRails::ActionController.new(controller, :theme_resolver)
|
18
18
|
|
19
|
-
expect(action_controller.theme_name).to eq("
|
19
|
+
expect(action_controller.theme_name).to eq("theme_a")
|
20
20
|
end
|
21
21
|
|
22
22
|
it "initializes with theme as symbol" do
|
23
|
-
action_controller = ThemesOnRails::ActionController.new(controller, :
|
23
|
+
action_controller = ThemesOnRails::ActionController.new(controller, :theme_a)
|
24
24
|
|
25
|
-
expect(action_controller.theme_name).to eq("
|
25
|
+
expect(action_controller.theme_name).to eq("theme_a")
|
26
26
|
end
|
27
27
|
|
28
28
|
it "initializes with theme as proc or lambda" do
|
29
|
-
action_controller = ThemesOnRails::ActionController.new(controller, lambda { |con| "
|
29
|
+
action_controller = ThemesOnRails::ActionController.new(controller, lambda { |con| "theme_a" })
|
30
30
|
|
31
|
-
expect(action_controller.theme_name).to eq("
|
31
|
+
expect(action_controller.theme_name).to eq("theme_a")
|
32
32
|
end
|
33
33
|
|
34
34
|
it "initializes with theme as nil" do
|
@@ -38,8 +38,8 @@ describe ThemesOnRails::ActionController do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it "#theme_view_path" do
|
41
|
-
action_controller = ThemesOnRails::ActionController.new(controller, "
|
41
|
+
action_controller = ThemesOnRails::ActionController.new(controller, "theme_a")
|
42
42
|
|
43
|
-
expect(action_controller.theme_view_path).to eq("#{Rails.root}/app/themes/
|
43
|
+
expect(action_controller.theme_view_path).to eq("#{Rails.root}/app/themes/theme_a/views")
|
44
44
|
end
|
45
45
|
end
|
@@ -9,9 +9,9 @@ describe ThemesOnRails::ControllerAdditions do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "invokes #apply_theme without options" do
|
12
|
-
ThemesOnRails::ActionController.should_receive(:apply_theme).with(controller_class, "
|
12
|
+
ThemesOnRails::ActionController.should_receive(:apply_theme).with(controller_class, "theme_a", {})
|
13
13
|
|
14
|
-
controller_class.theme "
|
14
|
+
controller_class.theme "theme_a"
|
15
15
|
end
|
16
16
|
|
17
17
|
it "invokes #apply_theme with options" do
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ThemesOnRails::Engine do
|
4
|
+
context 'assets.paths' do
|
5
|
+
it 'includes `theme_a`: images, javascripts, stylesheets' do
|
6
|
+
expect(Rails.application.config.assets.paths.to_s).to match(/theme_a\/assets\/images/)
|
7
|
+
expect(Rails.application.config.assets.paths.to_s).to match(/theme_a\/assets\/javascripts/)
|
8
|
+
expect(Rails.application.config.assets.paths.to_s).to match(/theme_a\/assets\/stylesheets/)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'includes `theme_b`: images, javascripts, stylesheets' do
|
12
|
+
expect(Rails.application.config.assets.paths.to_s).to match(/theme_b\/assets\/images/)
|
13
|
+
expect(Rails.application.config.assets.paths.to_s).to match(/theme_b\/assets\/javascripts/)
|
14
|
+
expect(Rails.application.config.assets.paths.to_s).to match(/theme_b\/assets\/stylesheets/)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'i18n.load_path' do
|
19
|
+
it 'includes `theme_c`: locales' do
|
20
|
+
expect(Rails.application.config.i18n.load_path.to_s).to match(/theme_c\/locales\/en.yml/)
|
21
|
+
expect(Rails.application.config.i18n.load_path.to_s).to match(/theme_c\/locales\/km.yml/)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
|
1
|
+
if ENV['COVERAGE'] || ENV['CI']
|
2
|
+
require 'coveralls'
|
3
|
+
require 'simplecov'
|
4
|
+
SimpleCov.add_filter 'spec'
|
5
|
+
SimpleCov.add_filter 'gemfiles'
|
6
|
+
Coveralls.wear!
|
7
|
+
end
|
5
8
|
|
6
9
|
# Configure Rails Environment
|
7
10
|
ENV["RAILS_ENV"] = "test"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: themes_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chamnap Chhorn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.1.2
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.1.2
|
41
41
|
description: Adds multi themes support to your Rails 3/4 application
|
42
42
|
email:
|
43
43
|
- chamnapchhorn@gmail.com
|
@@ -52,12 +52,12 @@ files:
|
|
52
52
|
- lib/generators/themes_on_rails/templates/all.js
|
53
53
|
- lib/generators/themes_on_rails/templates/layout.html.erb
|
54
54
|
- lib/generators/themes_on_rails/templates/layout.html.haml
|
55
|
+
- lib/generators/themes_on_rails/templates/layout.html.liquid
|
55
56
|
- lib/generators/themes_on_rails/theme_generator.rb
|
56
57
|
- lib/themes_on_rails.rb
|
57
58
|
- lib/themes_on_rails/action_controller.rb
|
58
59
|
- lib/themes_on_rails/controller_additions.rb
|
59
60
|
- lib/themes_on_rails/engine.rb
|
60
|
-
- lib/themes_on_rails/railtie.rb
|
61
61
|
- lib/themes_on_rails/version.rb
|
62
62
|
- spec/dummy/README.rdoc
|
63
63
|
- spec/dummy/Rakefile
|
@@ -71,22 +71,31 @@ files:
|
|
71
71
|
- spec/dummy/app/helpers/application_helper.rb
|
72
72
|
- spec/dummy/app/helpers/posts_helper.rb
|
73
73
|
- spec/dummy/app/models/post.rb
|
74
|
-
- spec/dummy/app/themes/
|
75
|
-
- spec/dummy/app/themes/
|
76
|
-
- spec/dummy/app/themes/
|
77
|
-
- spec/dummy/app/themes/
|
78
|
-
- spec/dummy/app/themes/
|
79
|
-
- spec/dummy/app/themes/
|
80
|
-
- spec/dummy/app/themes/
|
81
|
-
- spec/dummy/app/themes/
|
82
|
-
- spec/dummy/app/themes/
|
83
|
-
- spec/dummy/app/themes/
|
84
|
-
- spec/dummy/app/themes/
|
85
|
-
- spec/dummy/app/themes/
|
86
|
-
- spec/dummy/app/themes/
|
87
|
-
- spec/dummy/app/themes/
|
88
|
-
- spec/dummy/app/themes/
|
89
|
-
- spec/dummy/app/themes/
|
74
|
+
- spec/dummy/app/themes/theme_a/assets/javascripts/theme_a/all.js
|
75
|
+
- spec/dummy/app/themes/theme_a/assets/stylesheets/theme_a/all.css
|
76
|
+
- spec/dummy/app/themes/theme_a/views/layouts/theme_a.html.haml
|
77
|
+
- spec/dummy/app/themes/theme_a/views/posts/_form.html.erb
|
78
|
+
- spec/dummy/app/themes/theme_a/views/posts/edit.html.erb
|
79
|
+
- spec/dummy/app/themes/theme_a/views/posts/index.html.erb
|
80
|
+
- spec/dummy/app/themes/theme_a/views/posts/new.html.erb
|
81
|
+
- spec/dummy/app/themes/theme_a/views/posts/show.html.erb
|
82
|
+
- spec/dummy/app/themes/theme_b/assets/javascripts/theme_b/all.js
|
83
|
+
- spec/dummy/app/themes/theme_b/assets/stylesheets/theme_b/all.css
|
84
|
+
- spec/dummy/app/themes/theme_b/views/layouts/alternate_theme_b.html.haml
|
85
|
+
- spec/dummy/app/themes/theme_b/views/layouts/theme_b.html.haml
|
86
|
+
- spec/dummy/app/themes/theme_b/views/posts/_form.html.erb
|
87
|
+
- spec/dummy/app/themes/theme_b/views/posts/edit.html.erb
|
88
|
+
- spec/dummy/app/themes/theme_b/views/posts/index.html.erb
|
89
|
+
- spec/dummy/app/themes/theme_b/views/posts/new.html.erb
|
90
|
+
- spec/dummy/app/themes/theme_b/views/posts/show.html.erb
|
91
|
+
- spec/dummy/app/themes/theme_c/assets/images/theme_c/1.jpg
|
92
|
+
- spec/dummy/app/themes/theme_c/assets/javascripts/theme_c/all.js
|
93
|
+
- spec/dummy/app/themes/theme_c/assets/stylesheets/theme_c/all.css
|
94
|
+
- spec/dummy/app/themes/theme_c/locales/en.yml
|
95
|
+
- spec/dummy/app/themes/theme_c/locales/km.yml
|
96
|
+
- spec/dummy/app/themes/theme_c/views/layouts/theme_c.liquid
|
97
|
+
- spec/dummy/app/themes/theme_c/views/posts/_partial.liquid
|
98
|
+
- spec/dummy/app/themes/theme_c/views/posts/index.liquid
|
90
99
|
- spec/dummy/app/views/layouts/application.html.erb
|
91
100
|
- spec/dummy/app/views/posts/_form.html.erb
|
92
101
|
- spec/dummy/app/views/posts/edit.html.erb
|
@@ -125,10 +134,37 @@ files:
|
|
125
134
|
- spec/dummy/public/favicon.ico
|
126
135
|
- spec/dummy/spec/controllers/posts_controller_spec.rb
|
127
136
|
- spec/dummy/spec/spec_helper.rb
|
137
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705
|
138
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1
|
139
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/1fd9ad217474bbaee0fa43a1497b4126
|
140
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f
|
141
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af
|
142
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953
|
143
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212
|
144
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6
|
128
145
|
- spec/dummy/tmp/cache/assets/development/sprockets/50febeb9e874461719e3493c257dfff4
|
146
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5
|
147
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4
|
148
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2
|
149
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/76032e6eabf40d365a1dae7dccb36a39
|
150
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/7dc53503f61ca13fc175ac459f52ae6c
|
151
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/83e0f4bbef733c177f077762a5225f69
|
152
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/b2748190620f4b3edb4a2b4d7e9146c5
|
153
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/c66b2f58de9cb0b261cc990107adb241
|
154
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b
|
155
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/c9c47e931d0f7e4959ed2a882fb2ebe8
|
156
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994
|
157
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145
|
158
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6
|
129
159
|
- spec/dummy/tmp/cache/assets/development/sprockets/d8aa3020579fab6a91b5ef2008b98b51
|
160
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/dcd26efc7d0c0fd3e246f9cc1391c537
|
130
161
|
- spec/dummy/tmp/cache/assets/development/sprockets/de42d2a5cb4e9864f5c2f211e9b081e1
|
162
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/e4af50439f4554f9b82ec9cbb6e5463f
|
131
163
|
- spec/dummy/tmp/cache/assets/development/sprockets/e8c8b47a6d13cd06f9e8a6158eda195c
|
164
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/ef18888e878b0844df17b3a647806b8a
|
165
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
|
166
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/f97e9d28fcfdb3281202d537865677b9
|
167
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/fa7e291abdc6c5f378253d3683b11427
|
132
168
|
- spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
|
133
169
|
- spec/dummy/tmp/cache/assets/test/sprockets/1fd9ad217474bbaee0fa43a1497b4126
|
134
170
|
- spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af
|
@@ -155,8 +191,8 @@ files:
|
|
155
191
|
- spec/dummy/tmp/cache/assets/test/sprockets/fa7e291abdc6c5f378253d3683b11427
|
156
192
|
- spec/generators/themes_on_rails/theme_generator_spec.rb
|
157
193
|
- spec/lib/action_controller_spec.rb
|
158
|
-
- spec/lib/assets_path_spec.rb
|
159
194
|
- spec/lib/controller_additions_spec.rb
|
195
|
+
- spec/lib/engine_spec.rb
|
160
196
|
- spec/spec_helper.rb
|
161
197
|
homepage: https://github.com/chamnap/themes_on_rails
|
162
198
|
licenses:
|
@@ -170,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
206
|
requirements:
|
171
207
|
- - ">="
|
172
208
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
209
|
+
version: 2.0.0
|
174
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
211
|
requirements:
|
176
212
|
- - ">="
|
@@ -193,22 +229,31 @@ test_files:
|
|
193
229
|
- spec/dummy/app/helpers/application_helper.rb
|
194
230
|
- spec/dummy/app/helpers/posts_helper.rb
|
195
231
|
- spec/dummy/app/models/post.rb
|
196
|
-
- spec/dummy/app/themes/
|
197
|
-
- spec/dummy/app/themes/
|
198
|
-
- spec/dummy/app/themes/
|
199
|
-
- spec/dummy/app/themes/
|
200
|
-
- spec/dummy/app/themes/
|
201
|
-
- spec/dummy/app/themes/
|
202
|
-
- spec/dummy/app/themes/
|
203
|
-
- spec/dummy/app/themes/
|
204
|
-
- spec/dummy/app/themes/
|
205
|
-
- spec/dummy/app/themes/
|
206
|
-
- spec/dummy/app/themes/
|
207
|
-
- spec/dummy/app/themes/
|
208
|
-
- spec/dummy/app/themes/
|
209
|
-
- spec/dummy/app/themes/
|
210
|
-
- spec/dummy/app/themes/
|
211
|
-
- spec/dummy/app/themes/
|
232
|
+
- spec/dummy/app/themes/theme_a/assets/javascripts/theme_a/all.js
|
233
|
+
- spec/dummy/app/themes/theme_a/assets/stylesheets/theme_a/all.css
|
234
|
+
- spec/dummy/app/themes/theme_a/views/layouts/theme_a.html.haml
|
235
|
+
- spec/dummy/app/themes/theme_a/views/posts/_form.html.erb
|
236
|
+
- spec/dummy/app/themes/theme_a/views/posts/edit.html.erb
|
237
|
+
- spec/dummy/app/themes/theme_a/views/posts/index.html.erb
|
238
|
+
- spec/dummy/app/themes/theme_a/views/posts/new.html.erb
|
239
|
+
- spec/dummy/app/themes/theme_a/views/posts/show.html.erb
|
240
|
+
- spec/dummy/app/themes/theme_b/assets/javascripts/theme_b/all.js
|
241
|
+
- spec/dummy/app/themes/theme_b/assets/stylesheets/theme_b/all.css
|
242
|
+
- spec/dummy/app/themes/theme_b/views/layouts/alternate_theme_b.html.haml
|
243
|
+
- spec/dummy/app/themes/theme_b/views/layouts/theme_b.html.haml
|
244
|
+
- spec/dummy/app/themes/theme_b/views/posts/_form.html.erb
|
245
|
+
- spec/dummy/app/themes/theme_b/views/posts/edit.html.erb
|
246
|
+
- spec/dummy/app/themes/theme_b/views/posts/index.html.erb
|
247
|
+
- spec/dummy/app/themes/theme_b/views/posts/new.html.erb
|
248
|
+
- spec/dummy/app/themes/theme_b/views/posts/show.html.erb
|
249
|
+
- spec/dummy/app/themes/theme_c/assets/images/theme_c/1.jpg
|
250
|
+
- spec/dummy/app/themes/theme_c/assets/javascripts/theme_c/all.js
|
251
|
+
- spec/dummy/app/themes/theme_c/assets/stylesheets/theme_c/all.css
|
252
|
+
- spec/dummy/app/themes/theme_c/locales/en.yml
|
253
|
+
- spec/dummy/app/themes/theme_c/locales/km.yml
|
254
|
+
- spec/dummy/app/themes/theme_c/views/layouts/theme_c.liquid
|
255
|
+
- spec/dummy/app/themes/theme_c/views/posts/_partial.liquid
|
256
|
+
- spec/dummy/app/themes/theme_c/views/posts/index.liquid
|
212
257
|
- spec/dummy/app/views/layouts/application.html.erb
|
213
258
|
- spec/dummy/app/views/posts/_form.html.erb
|
214
259
|
- spec/dummy/app/views/posts/edit.html.erb
|
@@ -249,10 +294,37 @@ test_files:
|
|
249
294
|
- spec/dummy/README.rdoc
|
250
295
|
- spec/dummy/spec/controllers/posts_controller_spec.rb
|
251
296
|
- spec/dummy/spec/spec_helper.rb
|
297
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705
|
298
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1
|
299
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/1fd9ad217474bbaee0fa43a1497b4126
|
300
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f
|
301
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af
|
302
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953
|
303
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212
|
304
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6
|
252
305
|
- spec/dummy/tmp/cache/assets/development/sprockets/50febeb9e874461719e3493c257dfff4
|
306
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5
|
307
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4
|
308
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2
|
309
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/76032e6eabf40d365a1dae7dccb36a39
|
310
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/7dc53503f61ca13fc175ac459f52ae6c
|
311
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/83e0f4bbef733c177f077762a5225f69
|
312
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/b2748190620f4b3edb4a2b4d7e9146c5
|
313
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/c66b2f58de9cb0b261cc990107adb241
|
314
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b
|
315
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/c9c47e931d0f7e4959ed2a882fb2ebe8
|
316
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994
|
317
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145
|
318
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6
|
253
319
|
- spec/dummy/tmp/cache/assets/development/sprockets/d8aa3020579fab6a91b5ef2008b98b51
|
320
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/dcd26efc7d0c0fd3e246f9cc1391c537
|
254
321
|
- spec/dummy/tmp/cache/assets/development/sprockets/de42d2a5cb4e9864f5c2f211e9b081e1
|
322
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/e4af50439f4554f9b82ec9cbb6e5463f
|
255
323
|
- spec/dummy/tmp/cache/assets/development/sprockets/e8c8b47a6d13cd06f9e8a6158eda195c
|
324
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/ef18888e878b0844df17b3a647806b8a
|
325
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
|
326
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/f97e9d28fcfdb3281202d537865677b9
|
327
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/fa7e291abdc6c5f378253d3683b11427
|
256
328
|
- spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
|
257
329
|
- spec/dummy/tmp/cache/assets/test/sprockets/1fd9ad217474bbaee0fa43a1497b4126
|
258
330
|
- spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af
|
@@ -279,6 +351,6 @@ test_files:
|
|
279
351
|
- spec/dummy/tmp/cache/assets/test/sprockets/fa7e291abdc6c5f378253d3683b11427
|
280
352
|
- spec/generators/themes_on_rails/theme_generator_spec.rb
|
281
353
|
- spec/lib/action_controller_spec.rb
|
282
|
-
- spec/lib/assets_path_spec.rb
|
283
354
|
- spec/lib/controller_additions_spec.rb
|
355
|
+
- spec/lib/engine_spec.rb
|
284
356
|
- spec/spec_helper.rb
|