mirror of
https://github.com/zhigang1992/sass.git
synced 2026-01-12 17:52:27 +08:00
Re-bundle vendor/listen.
This opens the door for supporting recent versions of listen without causing undue pain for users of Ruby 1.8.7 on Mac OS X. Listen versions beyond 1.1 don't support Ruby 1.8.7, but this is installed by default on many versions of OS X. Widening the version constraint on listen is also unworkable, since RubyGems will try to select the most recent version even if it's not compatible with the local Ruby installation.
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "vendor/listen"]
|
||||
path = vendor/listen
|
||||
url = git://github.com/guard/listen.git
|
||||
@@ -309,7 +309,7 @@ module Sass::Plugin
|
||||
private
|
||||
|
||||
def create_listener(*args, &block)
|
||||
require 'listen'
|
||||
load_listen!
|
||||
Listen::Listener.new(*args, &block)
|
||||
end
|
||||
|
||||
@@ -329,6 +329,43 @@ module Sass::Plugin
|
||||
dedupped
|
||||
end
|
||||
|
||||
def load_listen!
|
||||
if defined?(gem)
|
||||
begin
|
||||
gem 'listen', '~> 1.1.0'
|
||||
require 'listen'
|
||||
rescue Gem::LoadError
|
||||
dir = Sass::Util.scope("vendor/listen/lib")
|
||||
$LOAD_PATH.unshift dir
|
||||
begin
|
||||
require 'listen'
|
||||
rescue LoadError => e
|
||||
e.message << "\n" <<
|
||||
if File.exists?(scope(".git"))
|
||||
'Run "git submodule update --init" to get the recommended version.'
|
||||
else
|
||||
'Run "gem install listen" to get it.'
|
||||
end
|
||||
raise e
|
||||
end
|
||||
end
|
||||
else
|
||||
begin
|
||||
require 'listen'
|
||||
rescue LoadError => e
|
||||
dir = Sass::Util.scope("vendor/listen/lib")
|
||||
if $LOAD_PATH.include?(dir)
|
||||
raise e unless File.exists?(scope(".git"))
|
||||
e.message << "\n" <<
|
||||
'Run "git submodule update --init" to get the recommended version.'
|
||||
else
|
||||
$LOAD_PATH.unshift dir
|
||||
retry
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update_stylesheet(filename, css, sourcemap)
|
||||
dir = File.dirname(css)
|
||||
unless File.exists?(dir)
|
||||
|
||||
@@ -19,7 +19,6 @@ SASS_GEMSPEC = Gem::Specification.new do |spec|
|
||||
END
|
||||
|
||||
spec.required_ruby_version = '>= 1.8.7'
|
||||
spec.add_dependency 'listen', '~> 1.1.0'
|
||||
spec.add_development_dependency 'yard', '>= 0.5.3'
|
||||
spec.add_development_dependency 'maruku', '>= 0.5.9'
|
||||
|
||||
|
||||
1
vendor/listen
vendored
Submodule
1
vendor/listen
vendored
Submodule
Submodule vendor/listen added at 067c7c77ad
Reference in New Issue
Block a user