inprovise 0.2.16 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MThmN2UyZGE2MjczYzFiZWEwOGRlNWU0Y2I5ODRmNDgyMGExZmYyZQ==
4
+ NzRlYjA0YmI2NjljZjU2YjcyMGFjNjE4NjY0MzI3MDBkMzgyMjdmNQ==
5
5
  data.tar.gz: !binary |-
6
- YTY2NDY0MGY4YWMwNjkxOTFjZDllMTQ0NjY4ZDkxYjYxZmFhYzIwNw==
6
+ YTZhZGE4MWQ0ZmQ2M2Y1MTEyYTAxYjFmYjllZWE5ZjdjOTc2ZDVkNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2UxZGQwNzhiNTJhMzkxMzZkY2IxNWRiZmU1YTY2NzUxZjZjMTQ4MmIxZDMx
10
- N2Y4YTZhNmNhNWQ0YTcxOTA5ZWM2ZjM4OWI2OGExOGRhODRmMTliMTZjMDM2
11
- MWI3YzNiYmU2MTI4ZTE0ZWEyNjg4ZTQ4MmYyMWY4YThlZDNmMWQ=
9
+ MGFkYzNiZDg5OGEzYjc0MjZjYzIyNjM2M2QzMTIyZjVhZTdjMTQxOGIxYWNi
10
+ YTI1ODJmOGE0MTRhMDg5MzQyYzAzZmRlZmM2YjVjZTc0OTE2N2EwY2ZmYWFk
11
+ NGU4ZWQ0YTU0YTMwNzQ1Y2UxMjUyOGVhNDhkZTJjM2UwYmI3NGE=
12
12
  data.tar.gz: !binary |-
13
- NTY1NjYyODI4YzBhOGMyYjY1YjE2NzBmNDBjMzMyMWQwNWFjODY1Y2FkOWNl
14
- MzUzYWM5N2RiNDMyMzIyNWIxYzIyZDJlNjdlOGM4NmFiYTE5YTJlNWFhOGMz
15
- ZWMyM2U1YWNjODA4MmFjOGUxYjNiMzQ5MGFlMzE1ZWY3Y2JiYjc=
13
+ ZTBmMTE4MTFlN2ZhMjc4M2QxNDdhNzg5MjllNmJkYjRmZDQ1OGQ5YTA2NTRj
14
+ ODVkZmVkOTI5MDk2ZjE3NmIyY2QxZDNhZjBlMWRkYzQ1ZjNjM2ZhZmMxZGM4
15
+ ZGFhZTAzNmY0ZGVjZmM1NzczYTYyNWViY2ZkNzQ5Njk3ODgwYTg=
@@ -58,7 +58,7 @@ module Inprovise::Infrastructure
58
58
  def save
59
59
  targets.synchronize do
60
60
  data = []
61
- targets.values.sort.each {|t| t.is_a?(Node) ? data.insert(0,t) : data.push(t) }
61
+ targets.keys.sort.each {|t| targets[t].is_a?(Node) ? data.insert(0,targets[t]) : data.push(targets[t]) }
62
62
  File.open(Inprovise.infra, 'w') {|f| f << JSON.pretty_generate(data) }
63
63
  end
64
64
  end
@@ -52,11 +52,19 @@ class Inprovise::TriggerRunner
52
52
  end
53
53
  end
54
54
 
55
+ def get_arg_value(v)
56
+ begin
57
+ Module.new { def self.eval(s); binding.eval(s); end }.eval(v)
58
+ rescue Exception
59
+ v
60
+ end
61
+ end
62
+
55
63
  def parse_action_ref(action_ref_with_args)
56
- matches = action_ref_with_args.match(/([\w\-\:]+?)(\[([\w\-\,]+?)\])/)
64
+ matches = action_ref_with_args.match(/([\w\-\:]+?)(\[(.+?)\])/)
57
65
  return [action_ref_with_args,[]] unless matches
58
66
  action_ref = matches[1]
59
- args = matches[3].split(',').map(&:strip)
67
+ args = matches[3].split(',').map { |arg| get_arg_value(arg.strip) }
60
68
  [action_ref, args]
61
69
  end
62
70
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Inprovise
7
7
 
8
- VERSION = '0.2.16'
8
+ VERSION = '0.2.17'
9
9
 
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inprovise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-19 00:00:00.000000000 Z
11
+ date: 2016-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored