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.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -11
  3. data/Rakefile +2 -2
  4. data/lib/generators/themes_on_rails/templates/layout.html.liquid +14 -0
  5. data/lib/generators/themes_on_rails/theme_generator.rb +10 -1
  6. data/lib/themes_on_rails.rb +9 -6
  7. data/lib/themes_on_rails/action_controller.rb +10 -5
  8. data/lib/themes_on_rails/engine.rb +23 -1
  9. data/lib/themes_on_rails/version.rb +2 -2
  10. data/spec/dummy/app/controllers/posts_controller.rb +1 -1
  11. data/spec/dummy/app/themes/{basic_blue/assets/javascripts/basic_blue → theme_a/assets/javascripts/theme_a}/all.js +0 -0
  12. data/spec/dummy/app/themes/{basic_blue/assets/stylesheets/basic_blue → theme_a/assets/stylesheets/theme_a}/all.css +0 -0
  13. data/spec/dummy/app/themes/theme_a/views/layouts/theme_a.html.haml +9 -0
  14. data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/_form.html.erb +0 -0
  15. data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/edit.html.erb +1 -1
  16. data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/index.html.erb +1 -1
  17. data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/new.html.erb +1 -1
  18. data/spec/dummy/app/themes/{basic_blue → theme_a}/views/posts/show.html.erb +1 -1
  19. data/spec/dummy/app/themes/{professional_blue/assets/javascripts/professional_blue → theme_b/assets/javascripts/theme_b}/all.js +0 -0
  20. data/spec/dummy/app/themes/{professional_blue/assets/stylesheets/professional_blue → theme_b/assets/stylesheets/theme_b}/all.css +0 -0
  21. data/spec/dummy/app/themes/theme_b/views/layouts/alternate_theme_b.html.haml +9 -0
  22. data/spec/dummy/app/themes/theme_b/views/layouts/theme_b.html.haml +9 -0
  23. data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/_form.html.erb +0 -0
  24. data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/edit.html.erb +1 -1
  25. data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/index.html.erb +2 -2
  26. data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/new.html.erb +1 -1
  27. data/spec/dummy/app/themes/{professional_blue → theme_b}/views/posts/show.html.erb +1 -1
  28. data/spec/dummy/app/themes/theme_c/assets/images/theme_c/1.jpg +0 -0
  29. data/spec/dummy/app/themes/theme_c/assets/javascripts/theme_c/all.js +7 -0
  30. data/spec/dummy/app/themes/theme_c/assets/stylesheets/theme_c/all.css +9 -0
  31. data/spec/dummy/app/themes/theme_c/locales/en.yml +4 -0
  32. data/spec/dummy/app/themes/theme_c/locales/km.yml +4 -0
  33. data/spec/dummy/app/themes/theme_c/views/layouts/theme_c.liquid +11 -0
  34. data/spec/dummy/app/themes/theme_c/views/posts/_partial.liquid +1 -0
  35. data/spec/dummy/app/themes/theme_c/views/posts/index.liquid +3 -0
  36. data/spec/dummy/log/development.log +275 -0
  37. data/spec/dummy/log/test.log +1897 -0
  38. data/spec/dummy/spec/controllers/posts_controller_spec.rb +37 -17
  39. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  40. data/spec/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1 +0 -0
  41. data/spec/dummy/tmp/cache/assets/development/sprockets/1fd9ad217474bbaee0fa43a1497b4126 +0 -0
  42. data/spec/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f +0 -0
  43. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  44. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  45. data/spec/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  46. data/spec/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
  47. data/spec/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5 +0 -0
  48. data/spec/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  49. data/spec/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  50. data/spec/dummy/tmp/cache/assets/development/sprockets/76032e6eabf40d365a1dae7dccb36a39 +0 -0
  51. data/spec/dummy/tmp/cache/assets/development/sprockets/7dc53503f61ca13fc175ac459f52ae6c +0 -0
  52. data/spec/dummy/tmp/cache/assets/development/sprockets/83e0f4bbef733c177f077762a5225f69 +0 -0
  53. data/spec/dummy/tmp/cache/assets/development/sprockets/b2748190620f4b3edb4a2b4d7e9146c5 +0 -0
  54. data/spec/dummy/tmp/cache/assets/development/sprockets/c66b2f58de9cb0b261cc990107adb241 +0 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/c9c47e931d0f7e4959ed2a882fb2ebe8 +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  58. data/spec/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
  59. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  60. data/spec/dummy/tmp/cache/assets/development/sprockets/dcd26efc7d0c0fd3e246f9cc1391c537 +0 -0
  61. data/spec/dummy/tmp/cache/assets/development/sprockets/e4af50439f4554f9b82ec9cbb6e5463f +0 -0
  62. data/spec/dummy/tmp/cache/assets/development/sprockets/ef18888e878b0844df17b3a647806b8a +0 -0
  63. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  64. data/spec/dummy/tmp/cache/assets/development/sprockets/f97e9d28fcfdb3281202d537865677b9 +0 -0
  65. data/spec/dummy/tmp/cache/assets/development/sprockets/fa7e291abdc6c5f378253d3683b11427 +0 -0
  66. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  67. data/spec/dummy/tmp/cache/assets/test/sprockets/1fd9ad217474bbaee0fa43a1497b4126 +0 -0
  68. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  69. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  70. data/spec/dummy/tmp/cache/assets/test/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  71. data/spec/dummy/tmp/cache/assets/test/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
  72. data/spec/dummy/tmp/cache/assets/test/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  73. data/spec/dummy/tmp/cache/assets/test/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  74. data/spec/dummy/tmp/cache/assets/test/sprockets/76032e6eabf40d365a1dae7dccb36a39 +0 -0
  75. data/spec/dummy/tmp/cache/assets/test/sprockets/7dc53503f61ca13fc175ac459f52ae6c +0 -0
  76. data/spec/dummy/tmp/cache/assets/test/sprockets/83e0f4bbef733c177f077762a5225f69 +0 -0
  77. data/spec/dummy/tmp/cache/assets/test/sprockets/b2748190620f4b3edb4a2b4d7e9146c5 +0 -0
  78. data/spec/dummy/tmp/cache/assets/test/sprockets/c66b2f58de9cb0b261cc990107adb241 +0 -0
  79. data/spec/dummy/tmp/cache/assets/test/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
  80. data/spec/dummy/tmp/cache/assets/test/sprockets/c9c47e931d0f7e4959ed2a882fb2ebe8 +0 -0
  81. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  82. data/spec/dummy/tmp/cache/assets/test/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
  83. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  84. data/spec/dummy/tmp/cache/assets/test/sprockets/dcd26efc7d0c0fd3e246f9cc1391c537 +0 -0
  85. data/spec/dummy/tmp/cache/assets/test/sprockets/e4af50439f4554f9b82ec9cbb6e5463f +0 -0
  86. data/spec/dummy/tmp/cache/assets/test/sprockets/ef18888e878b0844df17b3a647806b8a +0 -0
  87. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  88. data/spec/dummy/tmp/cache/assets/test/sprockets/f97e9d28fcfdb3281202d537865677b9 +0 -0
  89. data/spec/dummy/tmp/cache/assets/test/sprockets/fa7e291abdc6c5f378253d3683b11427 +0 -0
  90. data/spec/generators/themes_on_rails/theme_generator_spec.rb +40 -21
  91. data/spec/lib/action_controller_spec.rb +10 -10
  92. data/spec/lib/controller_additions_spec.rb +2 -2
  93. data/spec/lib/engine_spec.rb +24 -0
  94. data/spec/spec_helper.rb +7 -4
  95. metadata +112 -40
  96. data/lib/themes_on_rails/railtie.rb +0 -23
  97. data/spec/dummy/app/themes/basic_blue/views/layouts/basic_blue.html.haml +0 -9
  98. data/spec/dummy/app/themes/professional_blue/views/layouts/professional_blue.html.haml +0 -9
  99. 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,9 +0,0 @@
1
- !!!
2
- %html
3
- %head
4
- %title Basic blue
5
- = stylesheet_link_tag "basic_blue/all", media: "all", "data-turbolinks-track" => true
6
- = javascript_include_tag "basic_blue/all", "data-turbolinks-track" => true
7
- = csrf_meta_tags
8
- %body
9
- = yield
@@ -1,9 +0,0 @@
1
- !!!
2
- %html
3
- %head
4
- %title Professional blue
5
- = stylesheet_link_tag "professional_blue/all", media: "all", "data-turbolinks-track" => true
6
- = javascript_include_tag "professional_blue/all", "data-turbolinks-track" => true
7
- = csrf_meta_tags
8
- %body
9
- = yield
@@ -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