erb2haml_cli 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/erb2haml_cli/version.rb +1 -1
- data/lib/erb2haml_cli.rb +5 -3
- metadata +1 -1
data/lib/erb2haml_cli/version.rb
CHANGED
data/lib/erb2haml_cli.rb
CHANGED
@@ -13,8 +13,10 @@ module Erb2hamlCli
|
|
13
13
|
begin_text_style + text + END_TEXT_STYLE
|
14
14
|
end
|
15
15
|
|
16
|
-
def self.run(argv)
|
17
|
-
|
16
|
+
def self.run(argv=[])
|
17
|
+
if !argv.grep('--help').first.nil? or !argv.grep('-h').first.nil?
|
18
|
+
return usage
|
19
|
+
end
|
18
20
|
|
19
21
|
if `which html2haml`.empty?
|
20
22
|
puts "#{color "ERROR: ", RED_FG} Could not find " +
|
@@ -32,7 +34,7 @@ module Erb2hamlCli
|
|
32
34
|
|
33
35
|
Find.find(dir) do |path|
|
34
36
|
if FileTest.file?(path) and path.downcase.match(/\.erb$/i)
|
35
|
-
haml_path = path.gsub("erb", "haml")
|
37
|
+
haml_path = path.gsub(".erb", ".haml")
|
36
38
|
|
37
39
|
unless FileTest.exists?(haml_path)
|
38
40
|
print "Converting: #{path}... "
|