knife-spork 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/knife-spork.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'knife-spork'
16
- s.version = '0.1.6'
16
+ s.version = '0.1.7'
17
17
  s.date = '2012-02-21'
18
18
  s.rubyforge_project = 'knife-spork'
19
19
 
@@ -146,7 +146,7 @@ module KnifeSpork
146
146
 
147
147
  if config[:remote]
148
148
  ui.msg "Uploading #{e} to server"
149
- save_environment_changes_remote("#{e}.json")
149
+ save_environment_changes_remote("#{e}")
150
150
  ui.info "\nPromotion complete, and environment uploaded."
151
151
  else
152
152
  ui.info "\nPromotion complete! Please remember to upload your changed #{e}.json to the Chef Server."
@@ -198,7 +198,14 @@ module KnifeSpork
198
198
 
199
199
  def save_environment_changes_remote(environment)
200
200
  @loader ||= Knife::Core::ObjectLoader.new(Chef::Environment, ui)
201
- updated = loader.load_from("environments", environment)
201
+
202
+ cookbook_path = config[:cookbook_path]
203
+ if cookbook_path.size > 1
204
+ updated = loader.load_from("environments", "#{environment}.json")
205
+ else
206
+ path = cookbook_path[0].gsub("cookbooks","environments") + "/#{environment}.json"
207
+ updated = loader.object_from_file("#{path}")
208
+ end
202
209
 
203
210
  env_server = Chef::Environment.load(environment.gsub(".json","")).to_hash["cookbook_versions"]
204
211
  env_local = updated.to_hash["cookbook_versions"]
data/lib/knife-spork.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KnifeSpork
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 6
9
- version: 0.1.6
8
+ - 7
9
+ version: 0.1.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jon Cowie