lib/sass/exec/sass_scss.rb in sass-3.4.21 vs lib/sass/exec/sass_scss.rb in sass-3.4.22
- old
+ new
@@ -154,11 +154,11 @@
'How to link generated output to the source files.',
' auto (default): relative paths where possible, file URIs elsewhere',
' file: always absolute file URIs',
' inline: include the source text in the sourcemap',
' none: no sourcemaps') do |type|
- if type && !%w[auto file inline none].include?(type)
+ if type && !%w(auto file inline none).include?(type)
$stderr.puts "Unknown sourcemap type #{type}.\n\n"
$stderr.puts opts
exit
elsif type.nil?
Sass::Util.sass_warn <<MESSAGE.rstrip
@@ -288,33 +288,10 @@
File #{@args[1]} #{err}.
Did you mean: #{@default_syntax} #{flag} #{@args[0]}:#{@args[1]}
MSG
end
- # Watch the working directory for changes without adding it to the load
- # path. This preserves the pre-3.4 behavior when the working directory was
- # on the load path. We should remove this when we can look for directories
- # to watch by traversing the import graph.
- class << Sass::Plugin.compiler
- # We have to use a class var to make this visible to #watched_file? and
- # #watched_paths.
- # rubocop:disable ClassVars
- @@working_directory = Sass::Util.realpath('.').to_s
- # rubocop:enable ClassVars
-
- # rubocop:disable NestedMethodDefinition
- def watched_file?(file)
- super(file) ||
- (file =~ /\.s[ac]ss$/ && file.start_with?(@@working_directory + File::SEPARATOR))
- end
-
- def watched_paths
- @watched_paths ||= super + [@@working_directory]
- end
- # rubocop:enable NestedMethodDefinition
- end
-
dirs, files = @args.map {|name| split_colon_path(name)}.
partition {|i, _| File.directory? i}
if @fake_update && !dirs.empty?
# Issue 1602.
@@ -434,10 +411,10 @@
end
def split_colon_path(path)
one, two = path.split(':', 2)
if one && two && Sass::Util.windows? &&
- one =~ /\A[A-Za-z]\Z/ && two =~ /\A[\/\\]/
+ one =~ /\A[A-Za-z]\Z/ && two =~ %r{\A[/\\]}
# If we're on Windows and we were passed a drive letter path,
# don't split on that colon.
one2, two = two.split(':', 2)
one = one + ':' + one2
end