behave 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/behave-0.1.gem +0 -0
- data/bin/behave-cli +0 -0
- data/lib/behave/version.rb +1 -1
- data/lib/behave.rb +27 -17
- data/tests/behaviour_spec.rb +9 -0
- metadata +2 -1
data/behave-0.1.gem
ADDED
Binary file
|
data/bin/behave-cli
CHANGED
File without changes
|
data/lib/behave/version.rb
CHANGED
data/lib/behave.rb
CHANGED
@@ -43,29 +43,39 @@ module Behave
|
|
43
43
|
|
44
44
|
def fetch()
|
45
45
|
path = @host + 'rest/cucumber/1.0/project/' + @key + '/features'
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
args = { :content_type => 'application/zip' }
|
47
|
+
args[:user] = @user unless @user.nil?
|
48
|
+
args[:password] = @pass unless @user.nil?
|
49
|
+
resource = RestClient::Resource.new(path, :user => @user, :password => @pass, :content_type => 'application/zip')
|
50
|
+
#resource = RestClient::Resource.new(path, args)
|
52
51
|
begin
|
53
|
-
@contents =
|
52
|
+
@contents = resource.get(:accept => 'application/zip', :params => {:manual => @manual})
|
54
53
|
puts '--------------------------------------------------------------'
|
55
54
|
puts 'Fetched file from server...'
|
56
55
|
rescue => e
|
57
56
|
puts '--------------------------------------------------------------'
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
57
|
+
if e.respond_to?('response') then
|
58
|
+
case e.response.code
|
59
|
+
when 401
|
60
|
+
puts 'User unauthorized (401)'
|
61
|
+
puts 'Could not authenticate using supplied username and password'
|
62
|
+
when 403
|
63
|
+
puts 'User forbidden (403)'
|
64
|
+
puts 'Too many attempts with this user'
|
65
|
+
when 405
|
66
|
+
puts 'Method not Allowed (405)'
|
67
|
+
when 406
|
68
|
+
puts 'Behave running on server is outdated, cannot download features'
|
69
|
+
puts 'Please upgrade your version of Behave for Jira and try again'
|
70
|
+
when 500
|
71
|
+
puts 'Jira server error (500)'
|
72
|
+
end
|
73
|
+
puts 'Writing server response to error.log...'
|
74
|
+
File.open('error.log', 'w') {|f| f.write(e.response) }
|
75
|
+
else
|
76
|
+
puts 'Could not connect to host.'
|
77
|
+
puts e.message
|
66
78
|
end
|
67
|
-
puts 'Writing server response to error.log...'
|
68
|
-
File.open('error.log', 'w') {|f| f.write(e.response) }
|
69
79
|
puts 'ABORTING'
|
70
80
|
puts '--------------------------------------------------------------'
|
71
81
|
exit 1
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: behave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: "0.
|
5
|
+
version: "0.2"
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jack Bastow
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- pkg/behave-0.0.1.gem
|
70
70
|
- target/maven-archiver/pom.properties
|
71
71
|
- target/rubycli-1.0.0-BETA7-SNAPSHOT.jar
|
72
|
+
- tests/behaviour_spec.rb
|
72
73
|
homepage: http://www.hindsighttesting.com
|
73
74
|
licenses: []
|
74
75
|
|