chef-solo-wrapper 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. data/bin/cs +14 -1
  2. metadata +3 -3
data/bin/cs CHANGED
@@ -16,7 +16,7 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
 
19
- CHEF_SOLO_WRAPPER_VERSION = '0.0.1'
19
+ CHEF_SOLO_WRAPPER_VERSION = '0.0.2'
20
20
 
21
21
  require 'rubygems'
22
22
  require 'trollop'
@@ -35,6 +35,7 @@ EOS
35
35
  opt :sandbox, "Use the Ruby environment in the local RightLink sandbox." # flag --sandbox, default false
36
36
  opt :config, "Use alternate Chef Solo configuration (default used, ~/solo.rb.)", :short => "-c" # flag --config, default false
37
37
  opt :json, "Use alternate Chef Solo JSON data (default used, ~/node.json.)", :short => "-j", :type => String # flag --json, default false
38
+ opt :test, "Tests requiring chef only plus implies a dry run", :short => "-t" # flag --test, default false
38
39
  opt :dry, "Dry run only, don't run chef-solo.", :short => "-d" # flag --dry, default false
39
40
  opt :run, "Use alernative run_list for chef-solo run.", :short => "-r", :type => String # flag --run, default false
40
41
  opt :write, "Write back to local JSON file.", :short => "-w" # flag --write, default false
@@ -49,6 +50,18 @@ puts 'chef-solo-wrapper '+CHEF_SOLO_WRAPPER_VERSION
49
50
  solo = false
50
51
  server = false
51
52
 
53
+ if opts.test
54
+ begin
55
+ puts 'Testing require of chef.'
56
+ require 'chef'
57
+ rescue
58
+ puts 'Failed to require Chef RubyGem!'
59
+ exit 1
60
+ end
61
+ puts 'Test passed.'
62
+ exit
63
+ end
64
+
52
65
  # ensure a solo.rb exists for run
53
66
  if File.file?('/etc/chef/solo.rb')
54
67
  solo = '/etc/chef/solo.rb'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-solo-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Fordham