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 +2 -0
- data/lib/cfoundry/baseclient.rb +0 -2
- data/lib/cfoundry/v2/user.rb +1 -1
- data/lib/cfoundry/version.rb +1 -1
- data/lib/tasks/gem_release.rake +41 -0
- data/spec/cfoundry/v2/user_spec.rb +11 -1
- metadata +3 -2
data/Rakefile
CHANGED
data/lib/cfoundry/baseclient.rb
CHANGED
@@ -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)
|
data/lib/cfoundry/v2/user.rb
CHANGED
data/lib/cfoundry/version.rb
CHANGED
@@ -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.
|
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-
|
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
|