knife-block 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -87,13 +87,16 @@ module GreenAndSecure
87
87
  end
88
88
  list = GreenAndSecure::BlockList.new
89
89
  new_server = name_args.first
90
- ui.confirm("You are asking to change from #{list.current_server} to #{new_server}. Are you sure")
91
- if File.exists?(::Chef::Knife::chef_config_dir+"/knife.rb")
92
- File.unlink(::Chef::Knife::chef_config_dir+"/knife.rb")
93
- end
94
- File.symlink(::Chef::Knife::chef_config_dir+"/knife-#{new_server}.rb",
95
- ::Chef::Knife::chef_config_dir+"/knife.rb")
96
- puts "The knife configuration has been updated to use #{new_server}"
90
+ if File.exists?(::Chef::Knife::chef_config_dir+"/knife-#{new_server}.rb")
91
+ if File.exists?(::Chef::Knife::chef_config_dir+"/knife.rb")
92
+ File.unlink(::Chef::Knife::chef_config_dir+"/knife.rb")
93
+ end
94
+ File.symlink(::Chef::Knife::chef_config_dir+"/knife-#{new_server}.rb",
95
+ ::Chef::Knife::chef_config_dir+"/knife.rb")
96
+ puts "The knife configuration has been updated to use #{new_server}"
97
+ else
98
+ puts "Knife configuration for #{new_server} not found, aborting switch"
99
+ end
97
100
  end
98
101
  end
99
102
 
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module Block
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-block
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-18 00:00:00.000000000Z
12
+ date: 2012-08-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Create and manage knife.rb files for OpsCodes' Chef
15
15
  email:
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  version: '0'
49
49
  requirements: []
50
50
  rubyforge_project:
51
- rubygems_version: 1.8.10
51
+ rubygems_version: 1.8.23
52
52
  signing_key:
53
53
  specification_version: 3
54
54
  summary: Create and manage knife.rb files for OpsCodes' Chef