parcels 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.rspec-local +4 -0
  4. data/.travis.yml +54 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +29 -0
  8. data/Rakefile +6 -0
  9. data/lib/parcels/dependency_parcel_list.rb +50 -0
  10. data/lib/parcels/environment.rb +60 -0
  11. data/lib/parcels/fortitude/alongside_engine.rb +37 -0
  12. data/lib/parcels/fortitude/assets.rb +212 -0
  13. data/lib/parcels/fortitude/enabling.rb +72 -0
  14. data/lib/parcels/fortitude/fortitude_engine.rb +35 -0
  15. data/lib/parcels/fortitude/fortitude_loader.rb +27 -0
  16. data/lib/parcels/fortitude/widget_engine.rb +31 -0
  17. data/lib/parcels/fortitude_alongside_parcel.rb +38 -0
  18. data/lib/parcels/fortitude_inline_parcel.rb +31 -0
  19. data/lib/parcels/fortitude_parcel.rb +102 -0
  20. data/lib/parcels/fragments/css_fragment.rb +107 -0
  21. data/lib/parcels/index.rb +16 -0
  22. data/lib/parcels/rails/rails_loader.rb +23 -0
  23. data/lib/parcels/rails/railtie.rb +16 -0
  24. data/lib/parcels/sprockets.rb +153 -0
  25. data/lib/parcels/utils/path_utils.rb +32 -0
  26. data/lib/parcels/version.rb +3 -0
  27. data/lib/parcels/widget_tree.rb +158 -0
  28. data/lib/parcels.rb +21 -0
  29. data/parcels.gemspec +48 -0
  30. data/spec/helpers/content_in_helpers.rb +21 -0
  31. data/spec/helpers/file_structure_helpers.rb +79 -0
  32. data/spec/helpers/global_helper.rb +34 -0
  33. data/spec/helpers/new_asset_helpers.rb +31 -0
  34. data/spec/helpers/new_rails_helpers.rb +31 -0
  35. data/spec/helpers/parcels_rails_helpers.rb +20 -0
  36. data/spec/helpers/per_example_helpers.rb +15 -0
  37. data/spec/helpers/sprockets_helpers.rb +23 -0
  38. data/spec/lib/spec/expected/base_expected_asset.rb +35 -0
  39. data/spec/lib/spec/expected/expected_asset.rb +135 -0
  40. data/spec/lib/spec/expected/expected_asset_set.rb +45 -0
  41. data/spec/lib/spec/expected/must_not_be_present_asset.rb +17 -0
  42. data/spec/lib/spec/fixtures/file_set.rb +80 -0
  43. data/spec/lib/spec/fixtures/widget_base.rb +13 -0
  44. data/spec/lib/spec/fixtures/widget_file.rb +108 -0
  45. data/spec/lib/spec/parsing/compiled_asset.rb +94 -0
  46. data/spec/lib/spec/parsing/compiled_asset_fragment.rb +38 -0
  47. data/spec/lib/spec/parsing/parsed_css_asset.rb +34 -0
  48. data/spec/lib/spec/parsing/precompiled_rails_asset.rb +52 -0
  49. data/spec/lib/spec/parsing/rails_asset.rb +30 -0
  50. data/spec/lib/spec/parsing/sprockets_asset.rb +40 -0
  51. data/spec/rails/basic_rails_spec.rb +102 -0
  52. data/spec/rails/compression_rails_spec.rb +11 -0
  53. data/spec/rails/development_mode_rails_spec.rb +321 -0
  54. data/spec/rails/sass_rails_spec.rb +125 -0
  55. data/spec/rails/sets_rails_spec.rb +85 -0
  56. data/spec/rails/templates/base/app/assets/stylesheets/application.css +16 -0
  57. data/spec/rails/templates/base/app/views/widgets/base.rb +4 -0
  58. data/spec/rails/templates/base/config/environments/production.rb +92 -0
  59. data/spec/rails/templates/base/lib/null_compressor.rb +5 -0
  60. data/spec/rails/templates/basic_rails_spec/app/controllers/basic_rails_spec_controller.rb +21 -0
  61. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_and_inline.pcss +1 -0
  62. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_and_inline.rb +9 -0
  63. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_and_inline_html.html.pcss +1 -0
  64. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_and_inline_html.html.rb +9 -0
  65. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_erb.pcss +1 -0
  66. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_erb.rb +7 -0
  67. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/inline_erb.rb +9 -0
  68. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/multiple_engines.pcss +1 -0
  69. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/multiple_engines.rb +9 -0
  70. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/no_corresponding_widget.pcss +1 -0
  71. data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/simple_css.rb +9 -0
  72. data/spec/rails/templates/compression_rails_spec/app/controllers/compression_rails_spec_controller.rb +5 -0
  73. data/spec/rails/templates/compression_rails_spec/app/views/compression_rails_spec/inline_and_alongside_css.pcss +1 -0
  74. data/spec/rails/templates/compression_rails_spec/app/views/compression_rails_spec/inline_and_alongside_css.rb +9 -0
  75. data/spec/rails/templates/compression_rails_spec/config/environments/production.rb +91 -0
  76. data/spec/rails/templates/development_mode_rails_spec/app/assets/stylesheets/changingone.scss +1 -0
  77. data/spec/rails/templates/development_mode_rails_spec/app/assets/stylesheets/changingtwo.scss +1 -0
  78. data/spec/rails/templates/development_mode_rails_spec/app/assets/stylesheets/import_dir/import_dir_ss_1.scss +1 -0
  79. data/spec/rails/templates/development_mode_rails_spec/app/controllers/development_mode_rails_spec_controller.rb +45 -0
  80. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/adding_alongside_css.rb +5 -0
  81. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/adding_inline_css.rb +7 -0
  82. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/adding_widget.rb +5 -0
  83. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/basic_widget_with_inline_and_alongside_parcels.pcss +3 -0
  84. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/basic_widget_with_inline_and_alongside_parcels.rb +9 -0
  85. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_alongside_css.pcss +1 -0
  86. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_alongside_css.rb +5 -0
  87. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_import_file.pcss +2 -0
  88. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_import_file.rb +10 -0
  89. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_inline_css.rb +9 -0
  90. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_prefix_imported_file.pcss +1 -0
  91. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_prefix_imported_file.rb +7 -0
  92. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_alongside_css.pcss +1 -0
  93. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_alongside_css.rb +5 -0
  94. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_inline_css.rb +7 -0
  95. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_widget.pcss +1 -0
  96. data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_widget.rb +9 -0
  97. data/spec/rails/templates/development_mode_rails_spec/app/views/import_base.rb +5 -0
  98. data/spec/rails/templates/development_mode_rails_spec/config/environments/development.rb +37 -0
  99. data/spec/rails/templates/development_mode_rails_spec/vendor/assets/stylesheets/one.scss +1 -0
  100. data/spec/rails/templates/development_mode_rails_spec/vendor/assets/stylesheets/two.scss +1 -0
  101. data/spec/rails/templates/sass_rails_spec/app/assets/foobar/the_import_dir_2/id2ss1.scss +1 -0
  102. data/spec/rails/templates/sass_rails_spec/app/assets/foobar/the_import_dir_2/id2ss2.scss +1 -0
  103. data/spec/rails/templates/sass_rails_spec/app/assets/foobar/twelve.scss +1 -0
  104. data/spec/rails/templates/sass_rails_spec/app/assets/foobar/two.scss +1 -0
  105. data/spec/rails/templates/sass_rails_spec/app/assets/images/quux/foo.png +0 -0
  106. data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/eleven.scss +1 -0
  107. data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/one.scss +1 -0
  108. data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/shared_import_dir/sid1ss1.scss +1 -0
  109. data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/shared_import_dir/sid1ss2.scss +1 -0
  110. data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/the_import_dir_1/id1ss1.scss +1 -0
  111. data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/the_import_dir_1/id1ss2.scss +1 -0
  112. data/spec/rails/templates/sass_rails_spec/app/controllers/sass_rails_spec_controller.rb +29 -0
  113. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/added_asset_path.pcss +2 -0
  114. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/added_asset_path.rb +10 -0
  115. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/asset_url.pcss +2 -0
  116. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/asset_url.rb +17 -0
  117. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/default_sass_import.pcss +6 -0
  118. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/default_sass_import.rb +14 -0
  119. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/import_directory.pcss +3 -0
  120. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/import_directory.rb +11 -0
  121. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/import_view_relative_directory.pcss +3 -0
  122. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/import_view_relative_directory.rb +11 -0
  123. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/other_features.pcss +1 -0
  124. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/other_features.rb +9 -0
  125. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/shared_imports.rb +10 -0
  126. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/vr_import_dir_1/vr1ss1.scss +1 -0
  127. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/vr_import_dir_1/vr1ss2.scss +1 -0
  128. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/vr_import_dir_2/vr2ss1.scss +1 -0
  129. data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/vr_import_dir_2/vr2ss2.scss +1 -0
  130. data/spec/rails/templates/sass_rails_spec/app/views/widgets/import_base.rb +5 -0
  131. data/spec/rails/templates/sass_rails_spec/config/application.rb +25 -0
  132. data/spec/rails/templates/sass_rails_spec/lib/more_assets/twenty.scss +1 -0
  133. data/spec/rails/templates/sass_rails_spec/vendor/assets/stylesheets/thirteen.scss +1 -0
  134. data/spec/rails/templates/sass_rails_spec/vendor/assets/stylesheets/three.scss +1 -0
  135. data/spec/rails/templates/sets_rails_spec/app/assets/stylesheets/admin.css.scss +1 -0
  136. data/spec/rails/templates/sets_rails_spec/app/assets/stylesheets/all.css.scss +1 -0
  137. data/spec/rails/templates/sets_rails_spec/app/assets/stylesheets/normal.css.scss +1 -0
  138. data/spec/rails/templates/sets_rails_spec/app/controllers/sets_rails_spec_controller.rb +3 -0
  139. data/spec/rails/templates/sets_rails_spec/app/views/admin/admin_one.pcss +1 -0
  140. data/spec/rails/templates/sets_rails_spec/app/views/admin/admin_one.rb +3 -0
  141. data/spec/rails/templates/sets_rails_spec/app/views/admin/admin_two.pcss +1 -0
  142. data/spec/rails/templates/sets_rails_spec/app/views/admin/admin_two.rb +3 -0
  143. data/spec/rails/templates/sets_rails_spec/app/views/admin/base.rb +3 -0
  144. data/spec/rails/templates/sets_rails_spec/app/views/root.rb +9 -0
  145. data/spec/rails/templates/sets_rails_spec/app/views/sets_base.rb +3 -0
  146. data/spec/rails/templates/sets_rails_spec/app/views/sets_rails_spec/normal_one.pcss +1 -0
  147. data/spec/rails/templates/sets_rails_spec/app/views/sets_rails_spec/normal_one.rb +3 -0
  148. data/spec/rails/templates/sets_rails_spec/app/views/sets_rails_spec/normal_two.pcss +1 -0
  149. data/spec/rails/templates/sets_rails_spec/app/views/sets_rails_spec/normal_two.rb +3 -0
  150. data/spec/system/alongside_file_spec.rb +193 -0
  151. data/spec/system/autogenerated_class_application_spec.rb +240 -0
  152. data/spec/system/basic_system_spec.rb +75 -0
  153. data/spec/system/dependency_sorting_spec.rb +48 -0
  154. data/spec/system/engines_spec.rb +245 -0
  155. data/spec/system/prefix_spec.rb +108 -0
  156. data/spec/system/sass_features_spec.rb +109 -0
  157. data/spec/system/sets_spec.rb +405 -0
  158. metadata +477 -0
@@ -0,0 +1,9 @@
1
+ class Views::BasicRailsSpec::AlongsideAndInlineHtml < Views::Widgets::Base
2
+ css %{
3
+ p { color: yellow; }
4
+ }
5
+
6
+ def content
7
+ p "hello, world"
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ p { background-image: url("foo-<%= 3 * 7 %>"); }
@@ -0,0 +1,7 @@
1
+ class Views::BasicRailsSpec::AlongsideErb < Views::Widgets::Base
2
+ css_options :engines => '.erb'
3
+
4
+ def content
5
+ p "hello, world"
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ class Views::BasicRailsSpec::InlineErb < Views::Widgets::Base
2
+ css %{
3
+ p { background-image: url("foo-<%= 3 * 7 %>"); }
4
+ }, :engines => '.erb'
5
+
6
+ def content
7
+ p "hello, world"
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ div { background-image: url("<#{'%'}= 7 * 3 %>"); }
@@ -0,0 +1,9 @@
1
+ class Views::BasicRailsSpec::MultipleEngines < Views::Widgets::Base
2
+ css_options :engines => '.erb.str'
3
+
4
+ css 'p { background-image: url("<#{"%"}= 7 * 3 %>"); }'
5
+
6
+ def content
7
+ p "hello, world"
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class Views::BasicRailsSpec::SimpleCss < Views::Widgets::Base
2
+ css %{
3
+ color: green;
4
+ }
5
+
6
+ def content
7
+ p "hello, world"
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class CompressionRailsSpecController < ApplicationController
2
+ def inline_and_alongside_css
3
+ # nothing here
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class Views::CompressionRailsSpec::InlineAndAlongsideCss < Views::Widgets::Base
2
+ css %{
3
+ p { color: green; }
4
+ }
5
+
6
+ def content
7
+ p "hello, world"
8
+ end
9
+ end
@@ -0,0 +1,91 @@
1
+ root_dir = File.basename(File.dirname(File.dirname(File.dirname(__FILE__))))
2
+ module_name = root_dir.camelize
3
+ app_outer_module = module_name.constantize
4
+ app_class = app_outer_module.const_get(:Application)
5
+
6
+ app_class.configure do
7
+ # Settings specified here will take precedence over those in config/application.rb.
8
+
9
+ # Code is not reloaded between requests.
10
+ config.cache_classes = true
11
+
12
+ # Eager load code on boot. This eager loads most of Rails and
13
+ # your application in memory, allowing both threaded web servers
14
+ # and those relying on copy on write to perform better.
15
+ # Rake tasks automatically ignore this option for performance.
16
+ config.eager_load = true
17
+
18
+ # Full error reports are disabled and caching is turned on.
19
+ config.consider_all_requests_local = false
20
+ config.action_controller.perform_caching = true
21
+
22
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
23
+ # Add `rack-cache` to your Gemfile before enabling this.
24
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
25
+ # config.action_dispatch.rack_cache = true
26
+
27
+ # Disable Rails's static asset server (Apache or nginx will already do this).
28
+ config.serve_static_assets = true
29
+
30
+ # Compress JavaScripts and CSS.
31
+ if ::Rails.version =~ /^4/
32
+ config.assets.js_compressor = :uglifier
33
+ config.assets.css_compressor = :sass
34
+ else
35
+ config.assets.compress = true
36
+ end
37
+
38
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
39
+ config.assets.compile = true
40
+
41
+ # Generate digests for assets URLs.
42
+ config.assets.digest = true
43
+
44
+ # `config.assets.precompile` has moved to config/initializers/assets.rb
45
+
46
+ # Specifies the header that your server uses for sending files.
47
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
48
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
49
+
50
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
51
+ # config.force_ssl = true
52
+
53
+ # Set to :debug to see everything in the log.
54
+ config.log_level = :info
55
+
56
+ # Prepend all log lines with the following tags.
57
+ # config.log_tags = [ :subdomain, :uuid ]
58
+
59
+ # Use a different logger for distributed setups.
60
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
61
+
62
+ # Use a different cache store in production.
63
+ # config.cache_store = :mem_cache_store
64
+
65
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
66
+ # config.action_controller.asset_host = "http://assets.example.com"
67
+
68
+ # Precompile additional assets.
69
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
70
+ # config.assets.precompile += %w( search.js )
71
+
72
+ # Ignore bad email addresses and do not raise email delivery errors.
73
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
74
+ # config.action_mailer.raise_delivery_errors = false
75
+
76
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
77
+ # the I18n.default_locale when a translation cannot be found).
78
+ config.i18n.fallbacks = true
79
+
80
+ # Send deprecation notices to registered listeners.
81
+ config.active_support.deprecation = :notify
82
+
83
+ # Disable automatic flushing of the log to improve performance.
84
+ # config.autoflush_log = false
85
+
86
+ # Use default logging formatter so that PID and timestamp are not suppressed.
87
+ config.log_formatter = ::Logger::Formatter.new
88
+
89
+ # Do not dump schema after migrations.
90
+ # config.active_record.dump_schema_after_migration = false
91
+ end
@@ -0,0 +1,45 @@
1
+ class DevelopmentModeRailsSpecController < ApplicationController
2
+ def basic_widget_with_inline_and_alongside_parcels
3
+ # nothing here
4
+ end
5
+
6
+ def changing_inline_css
7
+ # nothing here
8
+ end
9
+
10
+ def changing_alongside_css
11
+ # nothing here
12
+ end
13
+
14
+ def adding_inline_css
15
+ # nothing here
16
+ end
17
+
18
+ def removing_inline_css
19
+ # nothing here
20
+ end
21
+
22
+ def adding_alongside_css
23
+ # nothing here
24
+ end
25
+
26
+ def removing_alongside_css
27
+ # nothing here
28
+ end
29
+
30
+ def changing_import_file
31
+ # nothing here
32
+ end
33
+
34
+ def adding_widget
35
+ # nothing here
36
+ end
37
+
38
+ def removing_widget
39
+ # nothing here
40
+ end
41
+
42
+ def changing_prefix_imported_file
43
+ # nothing here
44
+ end
45
+ end
@@ -0,0 +1,5 @@
1
+ class Views::DevelopmentModeRailsSpec::AddingAlongsideCss < Views::Widgets::Base
2
+ def content
3
+ p "hello, world!"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ class Views::DevelopmentModeRailsSpec::AddingInlineCss < Views::Widgets::Base
2
+ # CSS_WILL_GO_HERE
3
+
4
+ def content
5
+ p "hello, world!"
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class Views::DevelopmentModeRailsSpec::AddingWidget < Views::Widgets::Base
2
+ def content
3
+ p "hello, world!"
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class Views::DevelopmentModeRailsSpec::BasicWidgetWithInlineAndAlongsideParcels < Views::Widgets::Base
2
+ css %{
3
+ p { color: green; }
4
+ }
5
+
6
+ def content
7
+ p "hello, world!"
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class Views::DevelopmentModeRailsSpec::ChangingAlongsideCss < Views::Widgets::Base
2
+ def content
3
+ p "hello, world!"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ @import "changingtwo";
2
+ div { color: $changing2; }
@@ -0,0 +1,10 @@
1
+ class Views::DevelopmentModeRailsSpec::ChangingImportFile < Views::Widgets::Base
2
+ css %{
3
+ @import "changingone";
4
+ p { color: $changing1; }
5
+ }
6
+
7
+ def content
8
+ p "hello, world!"
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ class Views::DevelopmentModeRailsSpec::ChangingInlineCss < Views::Widgets::Base
2
+ css %{
3
+ p { color: green; }
4
+ }
5
+
6
+ def content
7
+ p "hello, world!"
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ class Views::DevelopmentModeRailsSpec::ChangingPrefixImportedFile < Views::ImportBase
2
+ css %{p { color: $import_dir_color_1; }}
3
+
4
+ def content
5
+ p "hello, world!"
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class Views::DevelopmentModeRailsSpec::RemovingAlongsideCss < Views::Widgets::Base
2
+ def content
3
+ p "hello, world!"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ class Views::DevelopmentModeRailsSpec::RemovingInlineCss < Views::Widgets::Base
2
+ css %{p { color: magenta; }}
3
+
4
+ def content
5
+ p "hello, world!"
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ class Views::DevelopmentModeRailsSpec::RemovingWidget < Views::Widgets::Base
2
+ css %{
3
+ p { color: cyan; }
4
+ }
5
+
6
+ def content
7
+ p "hello, world!"
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class Views::ImportBase < Views::Widgets::Base
2
+ css_prefix %{
3
+ @import "import_dir/*";
4
+ }
5
+ end
@@ -0,0 +1,37 @@
1
+ root_dir = File.basename(File.dirname(File.dirname(File.dirname(__FILE__))))
2
+ module_name = root_dir.camelize
3
+ app_outer_module = module_name.constantize
4
+ app_class = app_outer_module.const_get(:Application)
5
+
6
+ app_class.configure do
7
+ # Settings specified here will take precedence over those in config/application.rb
8
+
9
+ # In the development environment your application's code is reloaded on
10
+ # every request. This slows down response time but is perfect for development
11
+ # since you don't have to restart the web server when you make code changes.
12
+ config.cache_classes = false
13
+
14
+ config.assets.enabled = true
15
+
16
+ # Log error messages when you accidentally call methods on nil.
17
+ config.whiny_nils = true
18
+
19
+ # Show full error reports and disable caching
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Don't care if the mailer can't send
24
+ config.action_mailer.raise_delivery_errors = false
25
+
26
+ # Print deprecation notices to the Rails logger
27
+ config.active_support.deprecation = :log
28
+
29
+ # Only use best-standards-support built into browsers
30
+ config.action_dispatch.best_standards_support = :builtin
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1 @@
1
+ $the_import_dir_2_color_1: #b1b1b1;
@@ -0,0 +1 @@
1
+ $the_import_dir_2_color_2: #b2b2b2;
@@ -0,0 +1 @@
1
+ $mycolor12: #12abcd;
@@ -0,0 +1 @@
1
+ $mycolor2: #0b1c2d;
@@ -0,0 +1 @@
1
+ $the_import_dir_1_color_1: #a1a1a1;
@@ -0,0 +1 @@
1
+ $the_import_dir_1_color_2: #a2a2a2;
@@ -0,0 +1,29 @@
1
+ class SassRailsSpecController < ApplicationController
2
+ def default_sass_import
3
+ # nothing here
4
+ end
5
+
6
+ def added_asset_path
7
+ # nothing here
8
+ end
9
+
10
+ def other_features
11
+ # nothing here
12
+ end
13
+
14
+ def import_directory
15
+ # nothing here
16
+ end
17
+
18
+ def import_view_relative_directory
19
+ # nothing here
20
+ end
21
+
22
+ def asset_url
23
+ # nothing here
24
+ end
25
+
26
+ def shared_imports
27
+ # nothing here
28
+ end
29
+ end
@@ -0,0 +1,2 @@
1
+ @import "twenty";
2
+ div { color: $mycolor20; }
@@ -0,0 +1,10 @@
1
+ class Views::SassRailsSpec::AddedAssetPath < Views::Widgets::Base
2
+ css %{
3
+ @import "twenty";
4
+ p { color: $mycolor20; }
5
+ }
6
+
7
+ def content
8
+ text "hello, world"
9
+ end
10
+ end
@@ -0,0 +1,2 @@
1
+ span { background: image-url('baz/quux.jpg'); }
2
+ section { background: asset-data-url('quux/foo.png'); }
@@ -0,0 +1,17 @@
1
+ class Views::SassRailsSpec::AssetUrl < Views::Widgets::Base
2
+ if ::Rails.version =~ /^3/
3
+ css %{
4
+ p { background: url(asset-path('foo/bar.jpg', 'image')); }
5
+ div { background: asset-url('bar/baz.png', 'image'); }
6
+ }
7
+ else
8
+ css %{
9
+ p { background: url(asset-path('foo/bar.jpg')); }
10
+ div { background: asset-url('bar/baz.png'); }
11
+ }
12
+ end
13
+
14
+ def content
15
+ text "hello, world"
16
+ end
17
+ end
@@ -0,0 +1,6 @@
1
+ @import "eleven";
2
+ @import "twelve";
3
+ @import "thirteen";
4
+ h1 { color: $mycolor11; }
5
+ h2 { color: $mycolor12; }
6
+ h3 { color: $mycolor13; }
@@ -0,0 +1,14 @@
1
+ class Views::SassRailsSpec::DefaultSassImport < Views::Widgets::Base
2
+ css %{
3
+ @import "one";
4
+ @import "two";
5
+ @import "three";
6
+ p { color: $mycolor1; }
7
+ div { color: $mycolor2; }
8
+ span { color: $mycolor3; }
9
+ }
10
+
11
+ def content
12
+ text "hello, world"
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ @import "the_import_dir_2/*";
2
+ span { color: $the_import_dir_2_color_1; }
3
+ section { color: $the_import_dir_2_color_2; }
@@ -0,0 +1,11 @@
1
+ class Views::SassRailsSpec::ImportDirectory < Views::Widgets::Base
2
+ css %{
3
+ @import "the_import_dir_1/*";
4
+ p { color: $the_import_dir_1_color_1; }
5
+ div { color: $the_import_dir_1_color_2; }
6
+ }
7
+
8
+ def content
9
+ text "hello, world"
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ @import "vr_import_dir_2/*";
2
+ span { color: $vr_import_dir_2_color_1; }
3
+ section { color: $vr_import_dir_2_color_2; }
@@ -0,0 +1,11 @@
1
+ class Views::SassRailsSpec::ImportViewRelativeDirectory < Views::Widgets::Base
2
+ css %{
3
+ @import "vr_import_dir_1/*";
4
+ p { color: $vr_import_dir_1_color_1; }
5
+ div { color: $vr_import_dir_1_color_2; }
6
+ }
7
+
8
+ def content
9
+ text "hello, world"
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class Views::SassRailsSpec::OtherFeatures < Views::Widgets::Base
2
+ css %{
3
+ p { color: #010203 + #040506; }
4
+ }
5
+
6
+ def content
7
+ text "hello, world"
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ class Views::SassRailsSpec::SharedImports < Views::Widgets::ImportBase
2
+ css %{
3
+ p { color: $sid1_color1; }
4
+ div { color: $sid1_color2; }
5
+ }
6
+
7
+ def content
8
+ text "hello, world"
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ class Views::Widgets::ImportBase < Views::Widgets::Base
2
+ css_prefix %{
3
+ @import "shared_import_dir/*";
4
+ }
5
+ end
@@ -0,0 +1,25 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module SassRailsSpec
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+
23
+ config.assets.paths << ::Rails.root.join('lib', 'more_assets')
24
+ end
25
+ end