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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 885cc7b8cbb4e35b9a8c1c97fbcb0031131e1ba5
4
- data.tar.gz: ec17f04a2d409d259373be6d961667d5100e2645
3
+ metadata.gz: 5d78a7169a4c3799728ba0d7fbe5d3553a3e6f59
4
+ data.tar.gz: eab7e61c4dfd6b4450f0887db9424f6bfb8ba721
5
5
  SHA512:
6
- metadata.gz: cc3a762ee08780da5ce286d30a7ac358d2fdd6cf695805b65fe749f814475948ec984970b9b0e5a081fea1cbf8a061a573f12f5827ca459023cd6430d06e59b9
7
- data.tar.gz: 91cab191d53c060db510a5437d4ea07a9e8dd8aa341d2122d58f9d3880a3cea5a23cf23c8b784ba3c8e9f80160f7423dd9214c76eaf24013207cfdd9ca54ce44
6
+ metadata.gz: c84429630cd653c15ba70e8560d3a28b21364f9163088f734f4dc01e1907d589b66666eeffa14d865c5ce1c2eddcaf1845b1d94eed8a1953ab712f3d44ac2548
7
+ data.tar.gz: 5093ba361d92597e68e67bd66d81b7223f3f6e7ed69d2b81d8918f66c09592b46497c7b7cab3279fe2d8cfe33c9784c01cba2217518b0da2b839388996dc366b
@@ -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 %r{(%args%)|(%arguments%)} =~ cmd
30
- cmd.gsub! %r{(%args%)|(%arguments%)}, args.join(" ")
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! %r{(%arg#{i}%)|(%argument#{i}%)}, arg
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| regex =~ File.basename(f) }.last ||
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 regex
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
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.7.5"
4
+ VERSION = "0.7.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theme-juice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse