theme-juice 0.7.6 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/theme-juice/config.rb +11 -5
- data/lib/theme-juice/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b205b3fc677c63ee8edc2a0c13f77278ef8b6bf
|
4
|
+
data.tar.gz: 3d8b2f995129d7fb25720a519f249e10b4402116
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3478fc683ad1dba3a8ef25314187bb40c47f80fee4240c7c95fa3d956b640daf694497018f20360b793fda7f7c01aac3ea1a0ffe58e8820c540633bdaf4ebea
|
7
|
+
data.tar.gz: 1c44dc8d3def277761857fa77a62fb035fa0ec8f29375d8a205152a306f0e1f6241ca3d55e71b4fd389116f2c76137ffe8501783a46b561f02ef390a2e45c63d
|
data/lib/theme-juice/config.rb
CHANGED
@@ -10,9 +10,15 @@ module ThemeJuice
|
|
10
10
|
def method_missing(method, *args, &block)
|
11
11
|
@project.location ||= Dir.pwd
|
12
12
|
|
13
|
-
|
14
|
-
.fetch(
|
15
|
-
|
13
|
+
begin
|
14
|
+
config.fetch("commands", {})
|
15
|
+
.fetch("#{method}") { @io.error("Command '#{method}' not found in config") }
|
16
|
+
.each { |cmd| run format_command(cmd, *args) }
|
17
|
+
rescue ::NoMethodError => err
|
18
|
+
@io.error "Config file is invalid" do
|
19
|
+
puts err
|
20
|
+
end
|
21
|
+
end
|
16
22
|
end
|
17
23
|
|
18
24
|
private
|
@@ -29,7 +35,7 @@ module ThemeJuice
|
|
29
35
|
cmd.gsub! multi_arg_regex, args.join(" ")
|
30
36
|
else
|
31
37
|
args.to_enum.with_index(1).each do |arg, i|
|
32
|
-
cmd.gsub! single_arg_regex, arg
|
38
|
+
cmd.gsub! single_arg_regex(i), arg
|
33
39
|
end
|
34
40
|
end
|
35
41
|
|
@@ -55,7 +61,7 @@ module ThemeJuice
|
|
55
61
|
%r{(%args%)|(%arguments%)}
|
56
62
|
end
|
57
63
|
|
58
|
-
def single_arg_regex
|
64
|
+
def single_arg_regex(i)
|
59
65
|
%r{(%arg#{i}%)|(%argument#{i}%)}
|
60
66
|
end
|
61
67
|
|
data/lib/theme-juice/version.rb
CHANGED