sass-rails 3.2.3 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +103 -0
  4. data/lib/sass/rails/importer.rb +3 -120
  5. data/lib/sass/rails/logger.rb +3 -19
  6. data/lib/sass/rails/railtie.rb +1 -77
  7. data/lib/sass/rails/version.rb +1 -1
  8. data/lib/sass/rails.rb +1 -16
  9. data/lib/sass-rails.rb +1 -1
  10. metadata +42 -408
  11. data/.gitignore +0 -5
  12. data/.travis.yml +0 -12
  13. data/CHANGELOG.md +0 -20
  14. data/Gemfile +0 -17
  15. data/README.markdown +0 -75
  16. data/Rakefile +0 -12
  17. data/lib/rails/generators/sass/assets/assets_generator.rb +0 -13
  18. data/lib/rails/generators/sass/assets/templates/stylesheet.css.sass +0 -3
  19. data/lib/rails/generators/sass/scaffold/scaffold_generator.rb +0 -9
  20. data/lib/rails/generators/sass_scaffold.rb +0 -16
  21. data/lib/rails/generators/scss/assets/assets_generator.rb +0 -13
  22. data/lib/rails/generators/scss/assets/templates/stylesheet.css.scss +0 -3
  23. data/lib/rails/generators/scss/scaffold/scaffold_generator.rb +0 -10
  24. data/lib/sass/rails/compressor.rb +0 -19
  25. data/lib/sass/rails/helpers.rb +0 -52
  26. data/lib/sass/rails/template_handlers.rb +0 -117
  27. data/sass-rails.gemspec +0 -25
  28. data/test/fixtures/engine_project/.gitignore +0 -6
  29. data/test/fixtures/engine_project/Gemfile +0 -5
  30. data/test/fixtures/engine_project/README.rdoc +0 -3
  31. data/test/fixtures/engine_project/Rakefile +0 -39
  32. data/test/fixtures/engine_project/app/assets/images/engine_project/.gitkeep +0 -0
  33. data/test/fixtures/engine_project/app/assets/javascripts/engine_project/application.js +0 -9
  34. data/test/fixtures/engine_project/app/assets/stylesheets/engine_project/application.css +0 -7
  35. data/test/fixtures/engine_project/app/controllers/engine_project/application_controller.rb +0 -4
  36. data/test/fixtures/engine_project/app/helpers/engine_project/application_helper.rb +0 -4
  37. data/test/fixtures/engine_project/app/views/layouts/engine_project/application.html.erb +0 -14
  38. data/test/fixtures/engine_project/config/routes.rb +0 -2
  39. data/test/fixtures/engine_project/db/seeds.rb +0 -7
  40. data/test/fixtures/engine_project/engine_project.gemspec +0 -8
  41. data/test/fixtures/engine_project/lib/engine_project/engine.rb +0 -5
  42. data/test/fixtures/engine_project/lib/engine_project/version.rb +0 -3
  43. data/test/fixtures/engine_project/lib/engine_project.rb +0 -4
  44. data/test/fixtures/engine_project/lib/tasks/engine_project_tasks.rake +0 -4
  45. data/test/fixtures/engine_project/script/rails +0 -6
  46. data/test/fixtures/engine_project/test/dummy/Rakefile +0 -7
  47. data/test/fixtures/engine_project/test/dummy/app/assets/javascripts/application.js +0 -9
  48. data/test/fixtures/engine_project/test/dummy/app/assets/stylesheets/application.css +0 -7
  49. data/test/fixtures/engine_project/test/dummy/app/controllers/application_controller.rb +0 -3
  50. data/test/fixtures/engine_project/test/dummy/app/helpers/application_helper.rb +0 -2
  51. data/test/fixtures/engine_project/test/dummy/app/mailers/.gitkeep +0 -0
  52. data/test/fixtures/engine_project/test/dummy/app/models/.gitkeep +0 -0
  53. data/test/fixtures/engine_project/test/dummy/app/views/layouts/application.html.erb +0 -14
  54. data/test/fixtures/engine_project/test/dummy/config/application.rb +0 -42
  55. data/test/fixtures/engine_project/test/dummy/config/boot.rb +0 -10
  56. data/test/fixtures/engine_project/test/dummy/config/database.yml +0 -25
  57. data/test/fixtures/engine_project/test/dummy/config/environment.rb +0 -5
  58. data/test/fixtures/engine_project/test/dummy/config/environments/development.rb +0 -27
  59. data/test/fixtures/engine_project/test/dummy/config/environments/production.rb +0 -51
  60. data/test/fixtures/engine_project/test/dummy/config/environments/test.rb +0 -39
  61. data/test/fixtures/engine_project/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  62. data/test/fixtures/engine_project/test/dummy/config/initializers/inflections.rb +0 -10
  63. data/test/fixtures/engine_project/test/dummy/config/initializers/mime_types.rb +0 -5
  64. data/test/fixtures/engine_project/test/dummy/config/initializers/secret_token.rb +0 -7
  65. data/test/fixtures/engine_project/test/dummy/config/initializers/session_store.rb +0 -8
  66. data/test/fixtures/engine_project/test/dummy/config/initializers/wrap_parameters.rb +0 -12
  67. data/test/fixtures/engine_project/test/dummy/config/locales/en.yml +0 -5
  68. data/test/fixtures/engine_project/test/dummy/config/routes.rb +0 -4
  69. data/test/fixtures/engine_project/test/dummy/config.ru +0 -4
  70. data/test/fixtures/engine_project/test/dummy/db/seeds.rb +0 -7
  71. data/test/fixtures/engine_project/test/dummy/lib/assets/.gitkeep +0 -0
  72. data/test/fixtures/engine_project/test/dummy/log/.gitkeep +0 -0
  73. data/test/fixtures/engine_project/test/dummy/public/404.html +0 -26
  74. data/test/fixtures/engine_project/test/dummy/public/422.html +0 -26
  75. data/test/fixtures/engine_project/test/dummy/public/500.html +0 -26
  76. data/test/fixtures/engine_project/test/dummy/public/favicon.ico +0 -0
  77. data/test/fixtures/engine_project/test/dummy/script/rails +0 -6
  78. data/test/fixtures/sass_project/.gitignore +0 -5
  79. data/test/fixtures/sass_project/Gemfile +0 -7
  80. data/test/fixtures/sass_project/README +0 -261
  81. data/test/fixtures/sass_project/Rakefile +0 -7
  82. data/test/fixtures/sass_project/app/assets/images/rails.png +0 -0
  83. data/test/fixtures/sass_project/app/assets/javascripts/application.js +0 -9
  84. data/test/fixtures/sass_project/app/assets/stylesheets/application.css +0 -7
  85. data/test/fixtures/sass_project/app/controllers/application_controller.rb +0 -3
  86. data/test/fixtures/sass_project/app/helpers/application_helper.rb +0 -2
  87. data/test/fixtures/sass_project/app/mailers/.gitkeep +0 -0
  88. data/test/fixtures/sass_project/app/models/.gitkeep +0 -0
  89. data/test/fixtures/sass_project/app/views/layouts/application.html.erb +0 -14
  90. data/test/fixtures/sass_project/config/application.rb +0 -52
  91. data/test/fixtures/sass_project/config/boot.rb +0 -6
  92. data/test/fixtures/sass_project/config/database.yml +0 -25
  93. data/test/fixtures/sass_project/config/environment.rb +0 -5
  94. data/test/fixtures/sass_project/config/environments/development.rb +0 -27
  95. data/test/fixtures/sass_project/config/environments/production.rb +0 -54
  96. data/test/fixtures/sass_project/config/environments/test.rb +0 -39
  97. data/test/fixtures/sass_project/config/initializers/backtrace_silencers.rb +0 -7
  98. data/test/fixtures/sass_project/config/initializers/inflections.rb +0 -10
  99. data/test/fixtures/sass_project/config/initializers/mime_types.rb +0 -5
  100. data/test/fixtures/sass_project/config/initializers/secret_token.rb +0 -7
  101. data/test/fixtures/sass_project/config/initializers/session_store.rb +0 -8
  102. data/test/fixtures/sass_project/config/initializers/wrap_parameters.rb +0 -12
  103. data/test/fixtures/sass_project/config/locales/en.yml +0 -5
  104. data/test/fixtures/sass_project/config/routes.rb +0 -58
  105. data/test/fixtures/sass_project/config.ru +0 -4
  106. data/test/fixtures/sass_project/db/seeds.rb +0 -7
  107. data/test/fixtures/sass_project/doc/README_FOR_APP +0 -2
  108. data/test/fixtures/sass_project/lib/tasks/.gitkeep +0 -0
  109. data/test/fixtures/sass_project/log/.gitkeep +0 -0
  110. data/test/fixtures/sass_project/public/404.html +0 -26
  111. data/test/fixtures/sass_project/public/422.html +0 -26
  112. data/test/fixtures/sass_project/public/500.html +0 -26
  113. data/test/fixtures/sass_project/public/favicon.ico +0 -0
  114. data/test/fixtures/sass_project/public/index.html +0 -241
  115. data/test/fixtures/sass_project/public/robots.txt +0 -5
  116. data/test/fixtures/sass_project/script/rails +0 -6
  117. data/test/fixtures/sass_project/vendor/assets/stylesheets/.gitkeep +0 -0
  118. data/test/fixtures/sass_project/vendor/plugins/.gitkeep +0 -0
  119. data/test/fixtures/scss_project/.gitignore +0 -5
  120. data/test/fixtures/scss_project/Gemfile +0 -7
  121. data/test/fixtures/scss_project/README +0 -261
  122. data/test/fixtures/scss_project/Rakefile +0 -7
  123. data/test/fixtures/scss_project/app/assets/images/1x1.png +0 -0
  124. data/test/fixtures/scss_project/app/assets/images/rails.png +0 -0
  125. data/test/fixtures/scss_project/app/assets/javascripts/application.js +0 -9
  126. data/test/fixtures/scss_project/app/assets/stylesheets/_top_level_partial.css.scss +0 -3
  127. data/test/fixtures/scss_project/app/assets/stylesheets/application.css.scss +0 -32
  128. data/test/fixtures/scss_project/app/assets/stylesheets/css_application.css +0 -7
  129. data/test/fixtures/scss_project/app/assets/stylesheets/globbed/globbed.css.scss +0 -3
  130. data/test/fixtures/scss_project/app/assets/stylesheets/globbed/nested/nested_glob.css.scss +0 -3
  131. data/test/fixtures/scss_project/app/assets/stylesheets/partials/_sass_import.css.sass +0 -5
  132. data/test/fixtures/scss_project/app/assets/stylesheets/partials/_scss_import.css.scss +0 -9
  133. data/test/fixtures/scss_project/app/assets/stylesheets/partials/_without_css_ext.scss +0 -3
  134. data/test/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_sass.css.sass +0 -2
  135. data/test/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_scss.css.scss +0 -3
  136. data/test/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.css.scss +0 -3
  137. data/test/fixtures/scss_project/app/assets/stylesheets/subfolder/another_plain.css +0 -3
  138. data/test/fixtures/scss_project/app/assets/stylesheets/subfolder/plain.css +0 -3
  139. data/test/fixtures/scss_project/app/assets/stylesheets/subfolder/second_level.css.scss +0 -1
  140. data/test/fixtures/scss_project/app/controllers/application_controller.rb +0 -3
  141. data/test/fixtures/scss_project/app/helpers/application_helper.rb +0 -2
  142. data/test/fixtures/scss_project/app/mailers/.gitkeep +0 -0
  143. data/test/fixtures/scss_project/app/models/.gitkeep +0 -0
  144. data/test/fixtures/scss_project/app/views/layouts/application.html.erb +0 -14
  145. data/test/fixtures/scss_project/config/application.rb +0 -49
  146. data/test/fixtures/scss_project/config/boot.rb +0 -6
  147. data/test/fixtures/scss_project/config/database.yml +0 -25
  148. data/test/fixtures/scss_project/config/environment.rb +0 -5
  149. data/test/fixtures/scss_project/config/environments/development.rb +0 -27
  150. data/test/fixtures/scss_project/config/environments/production.rb +0 -54
  151. data/test/fixtures/scss_project/config/environments/test.rb +0 -39
  152. data/test/fixtures/scss_project/config/initializers/backtrace_silencers.rb +0 -7
  153. data/test/fixtures/scss_project/config/initializers/inflections.rb +0 -10
  154. data/test/fixtures/scss_project/config/initializers/mime_types.rb +0 -5
  155. data/test/fixtures/scss_project/config/initializers/secret_token.rb +0 -7
  156. data/test/fixtures/scss_project/config/initializers/session_store.rb +0 -8
  157. data/test/fixtures/scss_project/config/initializers/wrap_parameters.rb +0 -12
  158. data/test/fixtures/scss_project/config/locales/en.yml +0 -5
  159. data/test/fixtures/scss_project/config/routes.rb +0 -58
  160. data/test/fixtures/scss_project/config.ru +0 -4
  161. data/test/fixtures/scss_project/db/seeds.rb +0 -7
  162. data/test/fixtures/scss_project/doc/README_FOR_APP +0 -2
  163. data/test/fixtures/scss_project/lib/tasks/.gitkeep +0 -0
  164. data/test/fixtures/scss_project/log/.gitkeep +0 -0
  165. data/test/fixtures/scss_project/public/404.html +0 -26
  166. data/test/fixtures/scss_project/public/422.html +0 -26
  167. data/test/fixtures/scss_project/public/500.html +0 -26
  168. data/test/fixtures/scss_project/public/favicon.ico +0 -0
  169. data/test/fixtures/scss_project/public/index.html +0 -241
  170. data/test/fixtures/scss_project/public/robots.txt +0 -5
  171. data/test/fixtures/scss_project/script/rails +0 -6
  172. data/test/fixtures/scss_project/vendor/assets/stylesheets/.gitkeep +0 -0
  173. data/test/fixtures/scss_project/vendor/plugins/.gitkeep +0 -0
  174. data/test/sass_rails_logger_test.rb +0 -24
  175. data/test/sass_rails_test.rb +0 -110
  176. data/test/support/sass_rails_test_case.rb +0 -159
  177. data/test/test_helper.rb +0 -30
@@ -1,159 +0,0 @@
1
- unless defined?(Bundler)
2
- $stderr.puts "You didn't run bundle exec did you? Try again: bundle exec rake test"
3
- exit 1
4
- end
5
- require 'fileutils'
6
- require 'tmpdir'
7
- require 'sprockets/helpers/rails_helper'
8
-
9
- class Sass::Rails::TestCase < ActiveSupport::TestCase
10
-
11
- class ExecutionError < StandardError
12
- attr_accessor :output
13
- def initialize(message, output = nil)
14
- super(message)
15
- self.output = output
16
- end
17
- def message
18
- "#{super}\nOutput was:\n#{output}"
19
- end
20
- end
21
-
22
- module SilentError
23
- attr_accessor :output
24
- def message
25
- "#{super}\nOutput was:\n#{output}"
26
- end
27
- end
28
-
29
- protected
30
-
31
- def fixture_path(path)
32
- File.expand_path("../../fixtures/#{path}", __FILE__)
33
- end
34
-
35
- module TestAssetPaths
36
- attr_accessor :assets
37
- end
38
-
39
- def sprockets_render(project, filename)
40
- within_rails_app(project) do
41
- runcmd "ruby script/rails runner 'puts Rails.application.assets[#{filename.inspect}]'"
42
- end
43
- end
44
-
45
- def assert_file_exists(filename)
46
- assert File.exists?(filename), "could not find #{filename}. PWD=#{Dir.pwd}\nDid find: #{Dir.glob(File.dirname(filename)+"/*").join(", ")}"
47
- end
48
-
49
- def assert_not_output(match)
50
- assert_no_match match, $last_ouput
51
- end
52
-
53
- def assert_output(match)
54
- assert $last_ouput.to_s =~ match, "#{match} was not found in #{$last_ouput.inspect}"
55
- end
56
-
57
- # Copies a rails app fixture to a temp directory
58
- # and changes to that directory during the yield.
59
- #
60
- # Automatically changes back to the working directory
61
- # and removes the temp directory when done.
62
- def within_rails_app(name, without_gems = [], gem_options = $gem_options)
63
- sourcedir = File.expand_path("../../fixtures/#{name}", __FILE__)
64
- Dir.mktmpdir do |tmpdir|
65
- FileUtils.cp_r "#{sourcedir}/.", tmpdir
66
- Dir.chdir(tmpdir) do
67
- gem_options.each {|name, options| modify_gem_entry name, options}
68
- without_gems.each {|name| remove_gem name}
69
- FileUtils.rm("Gemfile.lock") if File.exist?("Gemfile.lock")
70
- runcmd "bundle install --verbose"
71
- runcmd "bundle exec rake db:create --trace"
72
- yield tmpdir
73
- end
74
- end
75
- end
76
-
77
- def process_gemfile(gemfile = "Gemfile", &blk)
78
- gem_contents = File.readlines(gemfile)
79
- gem_contents.map!(&blk)
80
- gem_contents.compact!
81
- File.open(gemfile, "w") do |f|
82
- f.print(gem_contents.join(""))
83
- end
84
- end
85
-
86
- def modify_gem_entry(gemname, options, gemfile = "Gemfile")
87
- found = false
88
- process_gemfile(gemfile) do |line|
89
- if line =~ /gem *(["'])#{Regexp.escape(gemname)}\1/
90
- found = true
91
- gem_entry(gemname, options) + "\n"
92
- else
93
- line
94
- end
95
- end
96
- unless found
97
- File.open(gemfile, "a") do |f|
98
- f.print("\n#{gem_entry(gemname, options)}\n")
99
- end
100
- end
101
- end
102
-
103
- def gem_entry(gemname, options)
104
- entry = %Q{gem "#{gemname}", "~> #{options[:version]}"}
105
- entry += ", :path => #{options[:path].inspect}" if options[:path]
106
- entry
107
- end
108
-
109
- def remove_gem(gemname)
110
- process_gemfile(gemfile) do |line|
111
- line unless line =~ /gem *(["'])#{Regexp.escape(gemname)}\1/
112
- end
113
- end
114
-
115
- def silently
116
- output = StringIO.new
117
- $stderr, old_stderr = output, $stderr
118
- $stdout, old_stdout = output, $stdout
119
- begin
120
- yield
121
- rescue ExecutionError => e
122
- raise
123
- rescue => e
124
- e.extend(SilentError)
125
- e.output = output.string
126
- raise
127
- end
128
- ensure
129
- $stderr = old_stderr
130
- $stdout = old_stdout
131
- end
132
-
133
- # executes a system command
134
- # raises an error if it does not complete successfully
135
- # returns the output as a string if it does complete successfully
136
- def runcmd(cmd, working_directory = Dir.pwd, clean_env = true, gemfile = "Gemfile", env = {})
137
- # There's a bug in bundler where with_clean_env doesn't clear out the BUNDLE_GEMFILE environment setting
138
- # https://github.com/carlhuda/bundler/issues/1133
139
- env["BUNDLE_GEMFILE"] = "#{working_directory}/#{gemfile}" if clean_env
140
- todo = Proc.new do
141
- r, w = IO.pipe
142
- pid = Kernel.spawn(env, cmd, :out =>w , :err => w, :chdir => working_directory)
143
- w.close
144
- Process.wait
145
- output = r.read
146
- r.close
147
- unless $?.exitstatus == 0
148
- raise ExecutionError, "Command failed with exit status #{$?.exitstatus}: #{cmd}", output
149
- end
150
- $last_ouput = output
151
- end
152
- if clean_env
153
- Bundler.with_clean_env(&todo)
154
- else
155
- todo.call
156
- end
157
- end
158
-
159
- end
data/test/test_helper.rb DELETED
@@ -1,30 +0,0 @@
1
- # Configure Rails Envinronment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require 'rubygems'
5
- require 'bundler/setup'
6
-
7
- require 'rails'
8
- require "rails/test_help"
9
- require 'sass/rails'
10
- require 'sfl'
11
- require 'mocha'
12
-
13
- Rails.backtrace_cleaner.remove_silencers!
14
-
15
-
16
- # If developing against local dependencies, this code will ensure they get picked up
17
- # in the project fixtures that have their own bundle environment
18
- $gem_options = {}
19
- possible_dev_dependencies = %w(sass-rails sass rails actionpack railties sprockets)
20
- Bundler.load.specs.each do |s|
21
- if possible_dev_dependencies.include?(s.name)
22
- gem_path = s.full_gem_path
23
- gem_options = {:version => s.version}
24
- gem_options[:path] = gem_path if File.exists?("#{gem_path}/#{s.name}.gemspec")
25
- $gem_options[s.name] = gem_options
26
- end
27
- end
28
-
29
- # Load support files
30
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }