theme-juice 0.7.5 → 0.7.6
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 +13 -6
- 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: 5d78a7169a4c3799728ba0d7fbe5d3553a3e6f59
|
4
|
+
data.tar.gz: eab7e61c4dfd6b4450f0887db9424f6bfb8ba721
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c84429630cd653c15ba70e8560d3a28b21364f9163088f734f4dc01e1907d589b66666eeffa14d865c5ce1c2eddcaf1845b1d94eed8a1953ab712f3d44ac2548
|
7
|
+
data.tar.gz: 5093ba361d92597e68e67bd66d81b7223f3f6e7ed69d2b81d8918f66c09592b46497c7b7cab3279fe2d8cfe33c9784c01cba2217518b0da2b839388996dc366b
|
data/lib/theme-juice/config.rb
CHANGED
@@ -24,13 +24,12 @@ module ThemeJuice
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def format_command(cmd, args = [])
|
27
|
-
return cmd if args.empty?
|
28
27
|
|
29
|
-
if
|
30
|
-
cmd.gsub!
|
28
|
+
if multi_arg_regex =~ cmd
|
29
|
+
cmd.gsub! multi_arg_regex, args.join(" ")
|
31
30
|
else
|
32
31
|
args.to_enum.with_index(1).each do |arg, i|
|
33
|
-
cmd.gsub!
|
32
|
+
cmd.gsub! single_arg_regex, arg
|
34
33
|
end
|
35
34
|
end
|
36
35
|
|
@@ -39,7 +38,7 @@ module ThemeJuice
|
|
39
38
|
|
40
39
|
def config
|
41
40
|
begin
|
42
|
-
YAML.load_file Dir["#{@project.location}/*"].select { |f|
|
41
|
+
YAML.load_file Dir["#{@project.location}/*"].select { |f| config_regex =~ File.basename(f) }.last ||
|
43
42
|
@io.error("Config file not found in '#{@project.location}'")
|
44
43
|
rescue ::Psych::SyntaxError => err
|
45
44
|
@io.error "Config file is invalid" do
|
@@ -48,10 +47,18 @@ module ThemeJuice
|
|
48
47
|
end
|
49
48
|
end
|
50
49
|
|
51
|
-
def
|
50
|
+
def config_regex
|
52
51
|
%r{^(((\.)?(tj)|((J|j)uicefile))(.y(a)?ml)?$)}
|
53
52
|
end
|
54
53
|
|
54
|
+
def multi_arg_regex
|
55
|
+
%r{(%args%)|(%arguments%)}
|
56
|
+
end
|
57
|
+
|
58
|
+
def single_arg_regex
|
59
|
+
%r{(%arg#{i}%)|(%argument#{i}%)}
|
60
|
+
end
|
61
|
+
|
55
62
|
extend self
|
56
63
|
end
|
57
64
|
end
|
data/lib/theme-juice/version.rb
CHANGED