itamae 1.2.17 → 1.2.18

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 772a7eb4b6610bba4d4870d1d75edf98109572de
4
- data.tar.gz: 4964ef8bb3b46ab2a7d2c7af45c54c76c083c15e
3
+ metadata.gz: da43f26da1fe7099b9c2d83e01c07c5185a75418
4
+ data.tar.gz: 04525933d1554c90fff5de1e9ba92b488356168c
5
5
  SHA512:
6
- metadata.gz: 9da73359173c808a04958558a2044f48ff234d5b9cd8da7df7c84281bc6ae96a7911b535c60dd06ba6921a8ea971ff8b84350658425c0ab9716f2c93c8cfaa5b
7
- data.tar.gz: e79e18c07d212949b0464a1f71c4c87315d62298df8b81abc50a1118ed7ff1b9201ee811cd044e22c1a299262bcbda1d65badaff19b811cce1d179d360f3ebf8
6
+ metadata.gz: 178deb73e925e008861d2caaf03dcace628d379fe32dff86d7ab2efafd9811fd1d2ddd87e0715c0d99afccb377408945b4adea330dc7b634c117037fb94aa001
7
+ data.tar.gz: 4a9f5cdf2590c0eb7eafad461f963700d158f3105bc53c4257cff59d43596872b799d1f8216f98b5fa118cc067b51f04429fb46e6e60c3d038865e2c22e2cb59
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v1.2.18
2
+
3
+ Features
4
+
5
+ - `run_command` method in a recipe, definition and resource
6
+
1
7
  ## v1.2.17
2
8
 
3
9
  Features
data/lib/itamae/recipe.rb CHANGED
@@ -128,6 +128,10 @@ module Itamae
128
128
  def runner
129
129
  @recipe.runner
130
130
  end
131
+
132
+ def run_command(*args)
133
+ runner.backend.run_command(*args)
134
+ end
131
135
  end
132
136
 
133
137
  class RecipeFromDefinition < Recipe
@@ -60,6 +60,10 @@ module Itamae
60
60
  @resource.recipe.runner.node
61
61
  end
62
62
 
63
+ def run_command(*args)
64
+ @resource.recipe.runner.backend.run_command(*args)
65
+ end
66
+
63
67
  # Experimental
64
68
  def verify(command)
65
69
  @verify_commands << command
@@ -1 +1 @@
1
- 1.2.17
1
+ 1.2.18
@@ -299,3 +299,29 @@ file '/tmp/file_edit_sample' do
299
299
  content.gsub!('world', 'Itamae')
300
300
  end
301
301
  end
302
+
303
+ ###
304
+
305
+ unless run_command("echo -n Hello").stdout == "Hello"
306
+ raise "run_command in a recipe failed"
307
+ end
308
+
309
+ define :run_command_in_definition do
310
+ unless run_command("echo -n Hello").stdout == "Hello"
311
+ raise "run_command in a definition failed"
312
+ end
313
+ end
314
+
315
+ execute "echo Hello" do
316
+ unless run_command("echo -n Hello").stdout == "Hello"
317
+ raise "run_command in a resource failed"
318
+ end
319
+ end
320
+
321
+ local_ruby_block 'execute run_command' do
322
+ block do
323
+ unless run_command("echo -n Hello").stdout == "Hello"
324
+ raise "run_command in local_ruby_block failed"
325
+ end
326
+ end
327
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.17
4
+ version: 1.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -277,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
277
  version: '0'
278
278
  requirements: []
279
279
  rubyforge_project:
280
- rubygems_version: 2.4.5
280
+ rubygems_version: 2.2.2
281
281
  signing_key:
282
282
  specification_version: 4
283
283
  summary: Simple Configuration Management Tool