From bcc3dd84d0997932c592a0baec702c8bfb53fd04 Mon Sep 17 00:00:00 2001 From: Norman Clarke Date: Thu, 26 Apr 2012 17:44:48 -0300 Subject: [PATCH] Completely removed Sass Closes #498 --- .gitmodules | 3 --- Rakefile | 12 +----------- haml.gemspec | 2 +- lib/haml/railtie.rb | 3 --- lib/haml/util.rb | 29 ----------------------------- lib/sass.rb | 8 -------- lib/sass/plugin.rb | 10 ---------- lib/sass/rails2_shim.rb | 9 --------- lib/sass/rails3_shim.rb | 16 ---------------- vendor/sass | 1 - 10 files changed, 2 insertions(+), 91 deletions(-) delete mode 100644 lib/sass.rb delete mode 100644 lib/sass/plugin.rb delete mode 100644 lib/sass/rails2_shim.rb delete mode 100644 lib/sass/rails3_shim.rb delete mode 160000 vendor/sass diff --git a/.gitmodules b/.gitmodules index 4bda9619..1b76619f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "test/haml-spec"] path = test/haml-spec url = git://github.com/norman/haml-spec.git -[submodule "vendor/sass"] - path = vendor/sass - url = git://github.com/nex3/sass.git diff --git a/Rakefile b/Rakefile index 0f9b41e7..9ac79b02 100644 --- a/Rakefile +++ b/Rakefile @@ -183,15 +183,6 @@ begin require 'yard' namespace :doc do - task :sass do - require 'sass' - Dir[scope("yard/default/**/*.sass")].each do |sass| - File.open(sass.gsub(/sass$/, 'css'), 'w') do |f| - f.write(Sass::Engine.new(File.read(sass)).render) - end - end - end - desc "List all undocumented methods and classes." task :undocumented do opts = ENV["YARD_OPTS"] || "" @@ -226,7 +217,6 @@ OPTS end end end - Rake::Task['yard'].prerequisites.insert(0, 'doc:sass') Rake::Task['yard'].instance_variable_set('@comment', nil) desc "Generate Documentation" @@ -346,7 +336,7 @@ namespace :test do namespace :bundles do desc "Install all dependencies necessary to test Haml." task :install do - with_each_gemfile {sh "bundle install"} + with_each_gemfile {sh "bundle"} end desc "Update all dependencies for testing Haml." diff --git a/haml.gemspec b/haml.gemspec index 73795741..e3da426d 100644 --- a/haml.gemspec +++ b/haml.gemspec @@ -29,7 +29,7 @@ HAML_GEMSPEC = Gem::Specification.new do |spec| readmes = Dir['*'].reject{ |x| x =~ /(^|[^.a-z])[a-z]+/ || x == "TODO" } spec.executables = ['haml', 'html2haml'] spec.files = Dir['rails/init.rb', 'lib/**/*', 'bin/*', 'test/**/*', - 'extra/**/*', 'vendor/sass/**/*', 'Rakefile', 'init.rb', '.yardopts'] + readmes + 'extra/**/*', 'Rakefile', 'init.rb', '.yardopts'] + readmes spec.homepage = 'http://haml-lang.com/' spec.has_rdoc = false spec.test_files = Dir['test/**/*_test.rb'] diff --git a/lib/haml/railtie.rb b/lib/haml/railtie.rb index 818cc352..4c254115 100644 --- a/lib/haml/railtie.rb +++ b/lib/haml/railtie.rb @@ -8,10 +8,7 @@ end # Rails 3.0.0.beta.2+ if defined?(ActiveSupport) && Haml::Util.has?(:public_method, ActiveSupport, :on_load) require 'haml/template/options' - autoload(:Sass, 'sass/rails3_shim') ActiveSupport.on_load(:before_initialize) do - # resolve autoload if it looks like they're using Sass without options - Sass if File.exist?(File.join(Rails.root, 'public/stylesheets/sass')) ActiveSupport.on_load(:action_view) do Haml.init_rails(binding) end diff --git a/lib/haml/util.rb b/lib/haml/util.rb index 1e4bccd8..a241a431 100755 --- a/lib/haml/util.rb +++ b/lib/haml/util.rb @@ -340,35 +340,6 @@ module Haml warn(msg) end - # Try loading Sass. If the `sass` gem isn't installed, - # print a warning and load from the vendored gem. - # - # @return [Boolean] True if Sass was successfully loaded from the `sass` gem, - # false otherwise. - def try_sass - return true if defined?(::SASS_BEGUN_TO_LOAD) - begin - require 'sass/version' - loaded = Sass.respond_to?(:version) && Sass.version[:major] && - Sass.version[:minor] && ((Sass.version[:major] > 3 && Sass.version[:minor] > 1) || - ((Sass.version[:major] == 3 && Sass.version[:minor] == 1) && - (Sass.version[:prerelease] || Sass.version[:name] != "Bleeding Edge"))) - rescue LoadError => e - loaded = false - end - - unless loaded - haml_warn(<