ansible-ruby 1.0.23 → 1.0.24

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: 8842db6dbeb2c664053ca449053438137015ea71
4
- data.tar.gz: 260166fec3b364eecd957aa3eb254eeae88f622a
3
+ metadata.gz: 8a3b10e6daf387bf576ebc965e6495e780de15a4
4
+ data.tar.gz: 284eb53f8b51d7e74756992a0b447b5729be2250
5
5
  SHA512:
6
- metadata.gz: 80950d31fd499e27c642ecfb87caf8dd50e3211353b2c42bb7d8ccbb3a87f5dc61a2cb151e612be884ddf7c23f8f540aec860e58b86d792686f0f3ee8c3e3ca2
7
- data.tar.gz: b22e9e8f624793179c117e67a182e85e8c557453d7a49404be68924865c991d7065bf288f40a7d437ba2fc2ecdc0003c6655d0b352009ffc1617937165d313d0
6
+ metadata.gz: 935d7255cf1404870fad878820af4ac21a7e758498f0cd953c616495aeb192263c1c3b1f8ad5193fad5b2be4d07b1af23b7c3a65aea07b4fd90c1ca864c10c58
7
+ data.tar.gz: 36ff04526d9f88bb06aef7664a8527085861e82b85c73deaa03d6fbc23d9c13916ac546bc7c34b0d6bc4792079c40574ec300e3613671fb1e64b01cdaeae4536
@@ -10,14 +10,10 @@ module Ansible
10
10
  def initialize
11
11
  super
12
12
  @task_builders = []
13
- temp_counter = 0
14
- @temp_counter_incrementer = lambda do
15
- temp_counter += 1
16
- end
17
13
  end
18
14
 
19
15
  def task(name, &block)
20
- task_builder = Task.new name, Models::Task, @temp_counter_incrementer
16
+ task_builder = Task.new name, Models::Task
21
17
  task_builder.instance_eval(&block)
22
18
  @task_builders << task_builder
23
19
  task_builder._register
@@ -10,7 +10,14 @@ module Ansible
10
10
  module Ruby
11
11
  module DslBuilders
12
12
  class Task < Unit
13
- def initialize(name, context, temp_counter_inc)
13
+ @counter_variable = 0
14
+
15
+ class << self
16
+ attr_reader :counter_variable
17
+ attr_writer :counter_variable
18
+ end
19
+
20
+ def initialize(name, context)
14
21
  super()
15
22
  @name = name
16
23
  @context = context
@@ -18,7 +25,8 @@ module Ansible
18
25
  @inclusion = nil
19
26
  # Until the variable is utilized, we don't know if 'register' should be set, the supplied lambda
20
27
  name_fetcher = lambda do
21
- name = "result_#{temp_counter_inc.call}"
28
+ self.class.counter_variable += 1
29
+ name = "result_#{self.class.counter_variable}"
22
30
  @task_args[:register] = name
23
31
  name
24
32
  end
@@ -13,10 +13,6 @@ module Ansible
13
13
  @context = context
14
14
  @task_builders = []
15
15
  @includes = []
16
- temp_counter = 0
17
- @temp_counter_incrementer = lambda do
18
- temp_counter += 1
19
- end
20
16
  end
21
17
 
22
18
  def ansible_include(filename, &block)
@@ -78,7 +74,7 @@ module Ansible
78
74
  model = _context[:model]
79
75
  raise "Model not configured for #{@context}" unless model
80
76
 
81
- task_builder = Task.new name, model, @temp_counter_incrementer
77
+ task_builder = Task.new name, model
82
78
  task_builder.instance_eval(&block)
83
79
  @last_variable = task_builder._register
84
80
  @task_builders << task_builder
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ansible
4
4
  module Ruby
5
- VERSION = '1.0.23'
5
+ VERSION = '1.0.24'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ansible-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.23
4
+ version: 1.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brady Wied
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-08 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel