haml-edge 3.1.55 → 3.1.56

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/EDGE_GEM_VERSION +1 -1
  2. data/VERSION +1 -1
  3. data/lib/haml/exec.rb +9 -2
  4. metadata +1 -1
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.55
1
+ 3.1.56
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.55
1
+ 3.1.56
data/lib/haml/exec.rb CHANGED
@@ -388,7 +388,7 @@ END
388
388
  ::Sass::Plugin.options.merge! @options[:for_engine]
389
389
  ::Sass::Plugin.options[:unix_newlines] = @options[:unix_newlines]
390
390
 
391
- if @args[1] && !colon_path?(@args[0])
391
+ if !colon_path?(@args[0]) && probably_dest_dir?(@args[1])
392
392
  flag = @options[:update] ? "--update" : "--watch"
393
393
  err =
394
394
  if !File.exist?(@args[1])
@@ -396,7 +396,7 @@ END
396
396
  elsif @args[1] =~ /\.css$/
397
397
  "is a CSS file"
398
398
  end
399
- raise <<MSG if err
399
+ msg = <<MSG if err
400
400
  File #{@args[1]} #{err}.
401
401
  Did you mean: sass #{flag} #{@args[0]}:#{@args[1]}
402
402
  MSG
@@ -452,6 +452,13 @@ MSG
452
452
  end
453
453
  return one, two
454
454
  end
455
+
456
+ # Whether path is likely to be meant as the destination
457
+ # in a source:dest pair.
458
+ def probably_dest_dir?(path)
459
+ return false if colon_path?(path)
460
+ return Dir.glob(File.join(path, "*.s[ca]ss")).empty?
461
+ end
455
462
  end
456
463
 
457
464
  # The `haml` executable.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.55
4
+ version: 3.1.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum