serverspec-runner 1.3.6 → 1.3.7

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
  SHA256:
3
- metadata.gz: 95214931bd6fe3c15da86173962af41207536632933cf17b34b4de732e2c92e1
4
- data.tar.gz: 9d37ddc59b12c92a0e11952898aab65fd7fe9ebadcf7d4b9b9084610cc435ae6
3
+ metadata.gz: a08a31c047d65c820512c61b00f67c56bdac4942ff0d1c37bb36ca135f7d78a1
4
+ data.tar.gz: bafdd894d11c29fa2d5cd0f45c981a743d4b5bf2cf5804d3be91ec49659e3820
5
5
  SHA512:
6
- metadata.gz: 1bdfe0bcc4ec3cdf22081217c055644f44511943a723f832b256d8940bc0d52faf68dbb327c65f6237b35774e2cfa30bac869c42f8b982bf9b9a77f9a78ed9fb
7
- data.tar.gz: d8c155efdb66b9561c91128bf7ec4c2ab7fc53b995fb9db3ce6b940ae1dcfc99808dca7bd0b773ff2174f80bfaee6f76578a01677ece8c39c370c2433348b7d8
6
+ metadata.gz: c7d020eaed672cf410490394a0717fe191a3d4fd07bf6780e4edea880a7233a88e71c8d7630d3a56ba61e8648014ee1c20bbf48d34605ea8fff5f9d74dd7597b
7
+ data.tar.gz: 4298f5d485cb3274348324aa6f977a21c7be884db3ba331a7ff441b50a669be165df67a585327e0d4b742abc36140046f73d9705c9d464934f9cd0a1962e3a50
data/Rakefile CHANGED
@@ -38,16 +38,18 @@ namespace :spec do
38
38
  ENV['scenario'] = File.expand_path(ENV['scenario'] || "./scenario.yml")
39
39
  ENV['inventory'] = File.expand_path(ENV['inventory']) if ENV['inventory']
40
40
 
41
- def init_specpath(path)
41
+ def init_specpath(path, only_activate)
42
42
 
43
43
  abs_path = File::expand_path(path)
44
44
 
45
- begin
46
- print "want to create spec-tree to #{abs_path}? (y/n): "
47
- ans = STDIN.gets.strip
48
- exit 0 unless (ans == 'y' || ans == 'yes')
49
- rescue Exception
50
- exit 0
45
+ unless only_activate
46
+ begin
47
+ print "want to create spec-tree to #{abs_path}? (y/n): "
48
+ ans = STDIN.gets.strip
49
+ exit 0 unless (ans == 'y' || ans == 'yes')
50
+ rescue Exception
51
+ exit 0
52
+ end
51
53
  end
52
54
 
53
55
  FileUtils.mkdir_p("#{path}/lib")
@@ -145,7 +147,10 @@ namespace :spec do
145
147
  end
146
148
 
147
149
  if !Dir.exists?(ENV['specpath'])
148
- init_specpath(ENV['specroot'])
150
+ init_specpath(ENV['specroot'], false)
151
+ exit 0
152
+ elsif ENV['activate_specroot']
153
+ init_specpath(ENV['specroot'], true)
149
154
  exit 0
150
155
  end
151
156
 
@@ -21,6 +21,7 @@ opts = GetoptLong.new(
21
21
  ["--pattern", "-P", GetoptLong::REQUIRED_ARGUMENT],
22
22
  ["--exclude-pattern", "-E", GetoptLong::REQUIRED_ARGUMENT],
23
23
  ["--ignore-error-exit", "-I", GetoptLong::NO_ARGUMENT],
24
+ ["--activate-specroot", "-a", GetoptLong::NO_ARGUMENT],
24
25
  ["--version", "-v", GetoptLong::NO_ARGUMENT],
25
26
  ["--help", "-h", GetoptLong::NO_ARGUMENT],
26
27
  ["--raketask", "-1", GetoptLong::REQUIRED_ARGUMENT],
@@ -50,6 +51,8 @@ opts.each do |opt, arg|
50
51
  ENV['exclude_pattern'] = arg
51
52
  when '--ignore-error-exit'
52
53
  ENV['ignore_error_exit'] = 'true'
54
+ when '--activate-specroot'
55
+ ENV['activate_specroot'] = 'true'
53
56
  when '--tmpdir'
54
57
  ENV['tmpdir'] = arg
55
58
  when '--raketask'
@@ -71,6 +74,7 @@ opts.each do |opt, arg|
71
74
  puts "-p, --parallel execute tasks in parallel"
72
75
  puts "-P, --pattern execute pattern in spec directory"
73
76
  puts "-I, --ignore-error-exit exit with 0 even on error"
77
+ puts "-a, --activate-specroot activate existed spec root only(--specroot is required)"
74
78
  puts "-1, --raketask RAKE_TASK_NAME execute specified rake task only(ex: spec:test::anyhost-01)"
75
79
  puts "-v, --version show version"
76
80
  puts "-h, --help show help"
@@ -7,7 +7,11 @@ module Inventory
7
7
  if gk == 'hosts'
8
8
  if gv.kind_of?(Hash)
9
9
  gv.each do |hk, hv|
10
- platform[hk] = convert_ssh_opt(v['vars']).merge(convert_ssh_opt(hv))
10
+ platform[hk.to_sym] = unless hv.nil?
11
+ convert_ssh_opt(v['vars']).merge(convert_ssh_opt(hv))
12
+ else
13
+ convert_ssh_opt(v['vars'])
14
+ end
11
15
  end
12
16
  elsif gv.kind_of?(Array)
13
17
  gv.each do |h|
@@ -1,3 +1,3 @@
1
1
  module ServerspecRunner
2
- VERSION = "1.3.6"
2
+ VERSION = "1.3.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - hiracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-04 00:00:00.000000000 Z
11
+ date: 2018-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serverspec