cfoundry 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,8 +1,10 @@
1
1
  require "rake"
2
2
  require "rspec/core/rake_task"
3
+ Dir.glob("lib/tasks/**/*").sort.each { |ext| load(ext) }
3
4
 
4
5
  $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
5
6
  require "cfoundry/version"
6
7
 
8
+
7
9
  RSpec::Core::RakeTask.new(:spec)
8
10
  task :default => :spec
@@ -134,8 +134,6 @@ module CFoundry
134
134
 
135
135
  def handle_response(response, options, request)
136
136
  if status_is_successful?(response[:status].to_i)
137
- uaa.delete_user(options[:params][:user_delete]) if options[:params] && options[:params][:user_delete]
138
-
139
137
  handle_successful_response(response, options)
140
138
  else
141
139
  handle_error_response(response, request)
@@ -63,8 +63,8 @@ module CFoundry
63
63
  end
64
64
 
65
65
  def delete! (options = {})
66
- options[:user_delete] = guid
67
66
  super (options)
67
+ @client.base.uaa.delete_user(guid)
68
68
  end
69
69
  end
70
70
  end
@@ -1,4 +1,4 @@
1
1
  module CFoundry # :nodoc:
2
2
  # CFoundry library version number.
3
- VERSION = "2.3.1".freeze
3
+ VERSION = "2.3.2".freeze
4
4
  end
@@ -0,0 +1,41 @@
1
+ require 'active_support/core_ext'
2
+
3
+ namespace :gem do
4
+ desc "Bump gem version, push to RubyGems, push to Github, add release notes"
5
+ task :release, [:version] do |_, args|
6
+ version = args[:version] || 'rc'
7
+ old_version = gem_version
8
+
9
+ sh! "gem bump --version #{version} --no-commit"
10
+
11
+ print_with_purpose "Bumping to version #{gem_version}"
12
+ generate_release_notes(old_version)
13
+ sh!("git commit -m 'Bumping to version #{gem_version}.'")
14
+ sh!("git push")
15
+ sh!("gem release --tag")
16
+ end
17
+
18
+ private
19
+ def generate_release_notes(old_version)
20
+ print_with_purpose "Generating release notes..."
21
+ file_name = "release_#{gem_version}"
22
+ sh!("anchorman notes --name=#{file_name} --from=v#{old_version}")
23
+ sh!("git add release_notes")
24
+ end
25
+
26
+ def sh!(cmd)
27
+ `#{cmd}`
28
+ raise "borked with #{$?}" unless $?.success?
29
+ end
30
+
31
+ def print_with_purpose(text)
32
+ puts "\033[34m#{text}\033[0m"
33
+ end
34
+
35
+ def gem_version
36
+ silence_warnings do
37
+ load "lib/cfoundry/version.rb"
38
+ end
39
+ Gem::Specification.load("cfoundry.gemspec").version.to_s
40
+ end
41
+ end
@@ -16,7 +16,17 @@ module CFoundry
16
16
  it "also removes the user from uaa" do
17
17
  CFoundry::UAAClient.any_instance.should_receive(:delete_user)
18
18
 
19
- subject.delete!({})
19
+ subject.delete!
20
+ end
21
+ end
22
+
23
+ describe "when cloud controller was unable to delete the user" do
24
+ before do
25
+ client.base.stub(:delete).and_raise(CFoundry::APIError)
26
+ end
27
+
28
+ it "allows the exception to bubble up" do
29
+ expect{ subject.delete! }.to raise_error(CFoundry::APIError)
20
30
  end
21
31
  end
22
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfoundry
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-02 00:00:00.000000000 Z
13
+ date: 2013-07-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
@@ -299,6 +299,7 @@ files:
299
299
  - lib/cfoundry/version.rb
300
300
  - lib/cfoundry/zip.rb
301
301
  - lib/cfoundry.rb
302
+ - lib/tasks/gem_release.rake
302
303
  - vendor/errors/README.md
303
304
  - vendor/errors/v1.yml
304
305
  - vendor/errors/v2.yml