chef_helper 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/{recipe2json → role2json} +15 -0
  2. metadata +5 -5
@@ -23,7 +23,22 @@ class RubyToJson
23
23
  end
24
24
  end
25
25
 
26
+ if ARGV.size == 0 then
27
+ puts "USAGE: #{__FILE__} <path-to>/<role-name>.rb"
28
+ puts "The chef_helper converts the role to json, and stores it back in the same folder as the original."
29
+ exit 1
30
+ end
31
+
26
32
  filename = ARGV[0]
33
+
34
+ unless File.exists?(filename) then
35
+ puts "The role #{filename} does not exist. Are you in the right directory?"
36
+ exit 1
37
+ end
38
+
27
39
  filename_json = filename.gsub(".rb", ".json")
40
+ puts "Converting #{filename}"
28
41
  r2j = RubyToJson.new filename
29
42
  File.write(filename_json, r2j.get_data)
43
+ puts " to #{filename_json}"
44
+ puts "Done. Thanks!"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70297370093860 !ruby/object:Gem::Requirement
16
+ requirement: &70279900608120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,16 +21,16 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70297370093860
24
+ version_requirements: *70279900608120
25
25
  description: Helper scripts for chef-solo. Currently only installs a recipe2json executable
26
26
  which converts your ruby recipies to json recipes
27
27
  email: sebastian.probst.eide@gmail.com
28
28
  executables:
29
- - recipe2json
29
+ - role2json
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
- - bin/recipe2json
33
+ - bin/role2json
34
34
  homepage: https://github.com/sebastian/chef_helper
35
35
  licenses: []
36
36
  post_install_message: