parent
be6a440553
commit
bcc3dd84d0
|
@ -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
|
||||
|
|
12
Rakefile
12
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."
|
||||
|
|
|
@ -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']
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(<<WARNING)
|
||||
Sass is in the process of being separated from Haml,
|
||||
and will no longer be bundled at all in Haml 3.2.0.
|
||||
Please install the 'sass' gem if you want to use Sass.
|
||||
WARNING
|
||||
$".delete('sass/version')
|
||||
$LOAD_PATH.unshift(scope("vendor/sass/lib"))
|
||||
end
|
||||
loaded
|
||||
end
|
||||
|
||||
## Cross Rails Version Compatibility
|
||||
|
||||
# Returns the root of the Rails application,
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
dir = File.dirname(__FILE__)
|
||||
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
||||
|
||||
require 'haml'
|
||||
|
||||
unless Haml::Util.try_sass
|
||||
load Haml::Util.scope('vendor/sass/lib/sass.rb')
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
dir = File.dirname(File.dirname(__FILE__))
|
||||
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
||||
|
||||
require 'haml'
|
||||
|
||||
if Haml::Util.try_sass
|
||||
load Sass::Util.scope('lib/sass/plugin.rb')
|
||||
else
|
||||
load Haml::Util.scope('vendor/sass/lib/sass/plugin.rb')
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
Haml::Util.try_sass
|
||||
Haml::Util.haml_warn(<<WARNING)
|
||||
Haml will no longer automatically load Sass in Haml 3.2.0.
|
||||
Please add config.gem 'sass' to your environment.rb.
|
||||
WARNING
|
||||
|
||||
require 'sass'
|
||||
require 'sass/plugin'
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
unless Haml::Util.try_sass
|
||||
# Since Bundler sets up our gem environment,
|
||||
# Sass will only be loadable from gem
|
||||
# if gem "sass" has been set.
|
||||
Haml::Util.haml_warn(<<WARNING)
|
||||
Haml will no longer automatically load Sass in Haml 3.2.0.
|
||||
Please add gem 'sass' to your Gemfile.
|
||||
WARNING
|
||||
end
|
||||
|
||||
require 'sass/plugin/configuration'
|
||||
|
||||
ActiveSupport.on_load(:before_initialize) do
|
||||
require 'sass'
|
||||
require 'sass/plugin'
|
||||
end
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 4a1a0d1aaf4dd2a95cc7748b726cf0a90a432816
|
Loading…
Reference in New Issue