behave 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aaadb4dad9c37a60786b7c7c72a02729e3720583
4
- data.tar.gz: fe2520f862e1bd0fc505acf0b7cd83577e47be0c
3
+ metadata.gz: 128bb5de9d792adc5b42f0957b1fdde605bb678c
4
+ data.tar.gz: 833514be3dc971763f0accdb4905903aa82d8921
5
5
  SHA512:
6
- metadata.gz: df5ebcb552523a0eeacc9b448c75794dcc72643329aee00c269e339cb2ab67ab1ce25a6fa9b5ce7e2f4465c5aa56f8fa1aecc709258a336d60a41153054a2009
7
- data.tar.gz: 4adf599da654adaa1821e7e8197b8750a5fb5c5c2b9781139285b1723a624ce3d6e83c95364c74bd8605a1acf2ac65994e60728bc385c69d8b1de3fd0f0dd23f
6
+ metadata.gz: 0d822eda84804ad205368337107ff431d192a8e18328a1656b6a18d7d5750d49ee84978e6ff34f1192390cfa00834b0c6b2b865b743b85116df7caee7ef22f87
7
+ data.tar.gz: 70b16e8385ad4dea0b1d9045305a42b5f2346f8a57ba48abb20bbaf33e21072c1e52a18c2456794de427e01c58791a5de87bbda713d03ff4d815c1ae374f659a
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  .idea
2
2
  .DS_Store
3
+ *.gem
@@ -0,0 +1 @@
1
+ behave
@@ -0,0 +1 @@
1
+ ruby-2.1.7
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rest-client'
3
+ gem 'rest-client', '~> 1.7'
4
4
  gem 'rubyzip', '>= 1.0.0'
5
5
  gem 'zip-zip', '~> 0.3'
6
6
 
@@ -1,32 +1,39 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- behave (0.2.7)
5
- rest-client
6
- rubyzip
4
+ behave (0.4.0)
5
+ rest-client (~> 1.7)
6
+ rubyzip (>= 1.0.0)
7
+ zip-zip (~> 0.3)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- diff-lcs (1.1.3)
12
- mime-types (1.19)
13
- rest-client (1.6.7)
14
- mime-types (>= 1.16)
15
- rspec (2.11.0)
16
- rspec-core (~> 2.11.0)
17
- rspec-expectations (~> 2.11.0)
18
- rspec-mocks (~> 2.11.0)
19
- rspec-core (2.11.1)
20
- rspec-expectations (2.11.3)
21
- diff-lcs (~> 1.1.3)
22
- rspec-mocks (2.11.3)
23
- rubyzip (0.9.9)
12
+ domain_name (0.5.20160128)
13
+ unf (>= 0.0.5, < 1.0.0)
14
+ http-cookie (1.0.2)
15
+ domain_name (~> 0.5)
16
+ mime-types (2.99)
17
+ netrc (0.11.0)
18
+ rest-client (1.8.0)
19
+ http-cookie (>= 1.0.2, < 2.0)
20
+ mime-types (>= 1.16, < 3.0)
21
+ netrc (~> 0.7)
22
+ rubyzip (1.1.7)
23
+ unf (0.1.4)
24
+ unf_ext
25
+ unf_ext (0.0.7.2)
26
+ zip-zip (0.3)
27
+ rubyzip (>= 1.0.0)
24
28
 
25
29
  PLATFORMS
26
30
  ruby
27
31
 
28
32
  DEPENDENCIES
29
33
  behave!
30
- rest-client
31
- rspec (~> 2.6)
32
- rubyzip (~> 0.9.9)
34
+ rest-client (~> 1.7)
35
+ rubyzip (>= 1.0.0)
36
+ zip-zip (~> 0.3)
37
+
38
+ BUNDLED WITH
39
+ 1.11.2
@@ -5,9 +5,9 @@ require 'behave/version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
 
8
- gem.add_development_dependency "rspec", "~> 2.6"
8
+ # gem.add_development_dependency "rspec", "~> 2.6"
9
9
 
10
- gem.add_dependency "rest-client"
10
+ gem.add_dependency "rest-client", "~> 1.7"
11
11
  gem.add_dependency "rubyzip", ">= 1.0.0"
12
12
  gem.add_dependency "zip-zip", "~> 0.3"
13
13
 
@@ -1,3 +1,4 @@
1
+ require 'openssl'
1
2
  require 'rubygems'
2
3
  require 'rest_client'
3
4
  require 'zip/zip'
@@ -5,11 +6,12 @@ require 'optparse'
5
6
  require 'optparse/time'
6
7
  require 'ostruct'
7
8
  require 'pp'
9
+ require 'behave/version'
8
10
 
9
11
  module Behave
10
12
 
11
13
  class FeatureDownloader
12
- attr_accessor :host, :user, :pass, :key, :dir, :manual, :contents
14
+ attr_accessor :host, :user, :pass, :key, :dir, :manual, :proxy, :bypass_ssl, :contents
13
15
 
14
16
  def initialize(args)
15
17
  @dir = "features/"
@@ -24,7 +26,6 @@ module Behave
24
26
  puts '--------------------------------------------------------------'
25
27
  exit 1
26
28
  end
27
- @key.upcase!
28
29
  @dir << '/' unless @dir[-1,1] == '/'
29
30
  @host << '/' unless @host[-1,1] == '/'
30
31
  output_vars()
@@ -35,18 +36,22 @@ module Behave
35
36
  def output_vars()
36
37
  puts '--------------------------------------------------------------'
37
38
  puts 'HOST: ' + @host
38
- puts 'PROJECT KEY: ' + @key
39
+ puts 'PROJECT ID: ' + @key.to_s
39
40
  puts 'USER: ' + @user
40
41
  puts 'DIRECTORY: ' + @dir
41
42
  puts 'INCLUDE MANUAL: ' + @manual.to_s
43
+ puts 'PROXY: ' + @proxy unless @proxy.nil?
44
+ puts 'BYPASS SSL: ' + @bypass_ssl.to_s unless @bypass_ssl.nil?
42
45
  end
43
46
 
44
47
  def fetch()
45
- path = @host + 'rest/cucumber/1.0/project/' + @key + '/features'
48
+ RestClient.proxy = @proxy unless @proxy.nil?
49
+ ssl = if @bypass_ssl then OpenSSL::SSL::VERIFY_NONE else OpenSSL::SSL::VERIFY_PEER end
50
+ path = @host + 'rest/cucumber/1.0/project/' + @key.to_s + '/features'
46
51
  if @user.nil? then
47
- resource = RestClient::Resource.new(path, :content_type => 'application/zip')
52
+ resource = RestClient::Resource.new(path, :content_type => 'application/zip', :verify_ssl => ssl)
48
53
  else
49
- resource = RestClient::Resource.new(path, :user => @user, :password => @pass, :content_type => 'application/zip')
54
+ resource = RestClient::Resource.new(path, :user => @user, :password => @pass, :content_type => 'application/zip', :verify_ssl => ssl)
50
55
  end
51
56
  begin
52
57
  @contents = resource.get(:accept => 'application/zip', :params => {:manual => @manual})
@@ -55,24 +60,32 @@ module Behave
55
60
  rescue => e
56
61
  puts '--------------------------------------------------------------'
57
62
  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 login attempts with this user'
65
- when 404
66
- puts 'Not Found (404)'
67
- puts 'Could not find the project specified'
68
- when 405
69
- puts 'Behave running on server is outdated, cannot download features'
70
- puts 'Please upgrade your version of Behave for Jira and try again'
71
- when 406
72
- puts 'Behave running on server is outdated, cannot download features'
73
- puts 'Please upgrade your version of Behave for Jira and try again'
74
- when 500
75
- puts 'Jira server error (500)'
63
+ if e.response.respond_to?('code') then
64
+ case e.response.code
65
+ when 401
66
+ puts 'User unauthorized (401)'
67
+ puts 'Could not authenticate using supplied username and password'
68
+ when 403
69
+ puts 'User forbidden (403)'
70
+ puts 'Too many login attempts with this user'
71
+ when 404
72
+ puts 'Not Found (404)'
73
+ puts 'Could not find the project specified'
74
+ when 405
75
+ puts 'Behave running on server is outdated, cannot download features'
76
+ puts 'Please upgrade your version of Behave for Jira and try again'
77
+ when 406
78
+ puts 'Behave running on server is outdated, cannot download features'
79
+ puts 'Please upgrade your version of Behave for Jira and try again'
80
+ when 500
81
+ puts 'Jira server error (500)'
82
+ end
83
+ else
84
+ if e.respond_to?('inspect')
85
+ puts e.inspect
86
+ else
87
+ puts 'Unknown error occured (!)'
88
+ end
76
89
  end
77
90
  puts 'Writing server response to error.log...'
78
91
  File.open('error.log', 'w') {|f| f.write(e.response) }
@@ -155,6 +168,16 @@ module Behave
155
168
  map["manual"] = true
156
169
  end
157
170
 
171
+ opts.on("--proxy PROXY_URL",
172
+ "Pass requests through a PROXY_URL") do |proxy|
173
+ map["proxy"] = proxy
174
+ end
175
+
176
+ opts.on("--bypass-ssl",
177
+ "Bypass SSL certificate checking") do
178
+ map["bypass_ssl"] = true
179
+ end
180
+
158
181
  opts.on_tail("--help", "Show this message") do
159
182
  puts opts
160
183
  exit
@@ -173,4 +196,4 @@ module Behave
173
196
  end
174
197
  end
175
198
 
176
- end
199
+ end
@@ -1,3 +1,3 @@
1
1
  module Behave
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -0,0 +1 @@
1
+ behave
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p551
@@ -0,0 +1,15 @@
1
+ require 'rake'
2
+ require 'behave'
3
+
4
+ task :download do
5
+ Behave::FeatureDownloader.new({
6
+ 'host' => 'https://www.behave.pro',
7
+ 'user' => 'amlyYToxMDgzMjAyMA==',
8
+ 'pass' => 'be93d3f65d6926714cd28edda912ed1fd48996ed',
9
+ 'key' => 11900,
10
+ 'dir' => 'features',
11
+ 'manual' => true
12
+ })
13
+ end
14
+
15
+ task :default => :download
File without changes
@@ -0,0 +1,10 @@
1
+ Feature: Ruby
2
+
3
+
4
+ @RCT-1 @OPEN
5
+ Scenario: Running in 2.1.7
6
+
7
+ Given we are using "2.1.7"
8
+ When the behave gem is executed on this project
9
+ Then features are downloaded
10
+
@@ -0,0 +1 @@
1
+ behave
@@ -0,0 +1 @@
1
+ ruby-2.0.0-p643
@@ -0,0 +1,15 @@
1
+ require 'rake'
2
+ require 'behave'
3
+
4
+ task :download do
5
+ Behave::FeatureDownloader.new({
6
+ 'host' => 'https://www.behave.pro',
7
+ 'user' => 'amlyYToxMDgzMjAyMA==',
8
+ 'pass' => 'be93d3f65d6926714cd28edda912ed1fd48996ed',
9
+ 'key' => 11900,
10
+ 'dir' => 'features',
11
+ 'manual' => true
12
+ })
13
+ end
14
+
15
+ task :default => :download
@@ -0,0 +1,10 @@
1
+ Feature: Ruby
2
+
3
+
4
+ @RCT-1 @OPEN
5
+ Scenario: Running in 2.1.7
6
+
7
+ Given we are using "2.1.7"
8
+ When the behave gem is executed on this project
9
+ Then features are downloaded
10
+
@@ -0,0 +1 @@
1
+ behave
@@ -0,0 +1 @@
1
+ ruby-2.1.7
@@ -0,0 +1,15 @@
1
+ require 'rake'
2
+ require 'behave'
3
+
4
+ task :download do
5
+ Behave::FeatureDownloader.new({
6
+ 'host' => 'https://www.behave.pro',
7
+ 'user' => 'amlyYToxMDgzMjAyMA==',
8
+ 'pass' => 'be93d3f65d6926714cd28edda912ed1fd48996ed',
9
+ 'key' => 11900,
10
+ 'dir' => 'features',
11
+ 'manual' => true
12
+ })
13
+ end
14
+
15
+ task :default => :download
File without changes
@@ -0,0 +1,10 @@
1
+ Feature: Ruby
2
+
3
+
4
+ @RCT-1 @OPEN
5
+ Scenario: Running in 2.1.7
6
+
7
+ Given we are using "2.1.7"
8
+ When the behave gem is executed on this project
9
+ Then features are downloaded
10
+
@@ -0,0 +1 @@
1
+ behave
@@ -0,0 +1 @@
1
+ ruby-2.2.1
@@ -0,0 +1,15 @@
1
+ require 'rake'
2
+ require 'behave'
3
+
4
+ task :download do
5
+ Behave::FeatureDownloader.new({
6
+ 'host' => 'https://www.behave.pro',
7
+ 'user' => 'amlyYToxMDgzMjAyMA==',
8
+ 'pass' => 'be93d3f65d6926714cd28edda912ed1fd48996ed',
9
+ 'key' => 11900,
10
+ 'dir' => 'features',
11
+ 'manual' => true
12
+ })
13
+ end
14
+
15
+ task :default => :download
@@ -0,0 +1,10 @@
1
+ Feature: Ruby
2
+
3
+
4
+ @RCT-1 @OPEN
5
+ Scenario: Running in 2.1.7
6
+
7
+ Given we are using "2.1.7"
8
+ When the behave gem is executed on this project
9
+ Then features are downloaded
10
+
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: behave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Bastow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-03 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rspec
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.6'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.6'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rest-client
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - ">="
17
+ - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: '0'
19
+ version: '1.7'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - ">="
24
+ - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: '0'
26
+ version: '1.7'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rubyzip
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +61,8 @@ extensions: []
75
61
  extra_rdoc_files: []
76
62
  files:
77
63
  - ".gitignore"
64
+ - ".ruby-gemset"
65
+ - ".ruby-version"
78
66
  - Gemfile
79
67
  - Gemfile.lock
80
68
  - LICENSE.txt
@@ -89,6 +77,24 @@ files:
89
77
  - target/maven-archiver/pom.properties
90
78
  - target/rubycli-1.0.0-BETA7-SNAPSHOT.jar
91
79
  - tests/behaviour_spec.rb
80
+ - tests/env/1.9.3/.ruby-gemset
81
+ - tests/env/1.9.3/.ruby-version
82
+ - tests/env/1.9.3/Rakefile
83
+ - tests/env/1.9.3/error.log
84
+ - tests/env/1.9.3/features/1-ruby.feature
85
+ - tests/env/2.0.0/.ruby-gemset
86
+ - tests/env/2.0.0/.ruby-version
87
+ - tests/env/2.0.0/Rakefile
88
+ - tests/env/2.0.0/features/1-ruby.feature
89
+ - tests/env/2.1.7/.ruby-gemset
90
+ - tests/env/2.1.7/.ruby-version
91
+ - tests/env/2.1.7/Rakefile
92
+ - tests/env/2.1.7/error.log
93
+ - tests/env/2.1.7/features/1-ruby.feature
94
+ - tests/env/2.2.1/.ruby-gemset
95
+ - tests/env/2.2.1/.ruby-version
96
+ - tests/env/2.2.1/Rakefile
97
+ - tests/env/2.2.1/features/1-ruby.feature
92
98
  homepage: http://www.hindsighttesting.com
93
99
  licenses: []
94
100
  metadata: {}
@@ -108,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
114
  version: '0'
109
115
  requirements: []
110
116
  rubyforge_project:
111
- rubygems_version: 2.3.0
117
+ rubygems_version: 2.4.8
112
118
  signing_key:
113
119
  specification_version: 4
114
120
  summary: Command Line Interface for fetching features and scenarios from the Jira