rainforest-cli 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Gemfile +3 -1
- data/README.md +2 -0
- data/lib/rainforest/cli.rb +10 -4
- data/lib/rainforest/cli/options.rb +0 -1
- data/lib/rainforest/cli/version.rb +1 -1
- data/spec/spec_helper.rb +7 -0
- metadata +3 -2
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
data/lib/rainforest/cli.rb
CHANGED
@@ -4,8 +4,14 @@ require "httparty"
|
|
4
4
|
require "json"
|
5
5
|
|
6
6
|
module Rainforest
|
7
|
-
module Cli
|
8
|
-
|
7
|
+
module Cli
|
8
|
+
def self.api_url
|
9
|
+
if ENV['RAINFOREST_API_URL'].present?
|
10
|
+
ENV['RAINFOREST_API_URL']
|
11
|
+
else
|
12
|
+
'https://app.rainforestqa.com/api/1/runs'
|
13
|
+
end
|
14
|
+
end
|
9
15
|
|
10
16
|
def self.start(args)
|
11
17
|
@options = OptionParser.new(args)
|
@@ -23,7 +29,7 @@ module Rainforest
|
|
23
29
|
|
24
30
|
puts "Issuing run"
|
25
31
|
|
26
|
-
response = post(
|
32
|
+
response = post(api_url, post_opts)
|
27
33
|
|
28
34
|
if response['error']
|
29
35
|
puts "Error starting your run: #{response['error']}"
|
@@ -37,7 +43,7 @@ module Rainforest
|
|
37
43
|
|
38
44
|
while running
|
39
45
|
sleep 5
|
40
|
-
response = get "#{
|
46
|
+
response = get "#{api_url}/#{run_id}?gem_version=#{Rainforest::Cli::VERSION}"
|
41
47
|
if %w(queued in_progress sending_webhook waiting_for_callback).include?(response["state"])
|
42
48
|
puts "Run #{run_id} is #{response['state']} and is #{response['current_progress']['percent']}% complete"
|
43
49
|
running = false if response["result"] == 'failed' && @options.failfast?
|
data/spec/spec_helper.rb
CHANGED
@@ -6,6 +6,13 @@
|
|
6
6
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
7
|
|
8
8
|
require "rainforest/cli"
|
9
|
+
require "webmock/rspec"
|
10
|
+
require "vcr"
|
11
|
+
|
12
|
+
VCR.configure do |c|
|
13
|
+
c.cassette_library_dir = 'fixtures/vcr_cassettes'
|
14
|
+
c.hook_into :webmock # or :fakeweb
|
15
|
+
end
|
9
16
|
|
10
17
|
RSpec.configure do |config|
|
11
18
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rainforest-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
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-09-
|
13
|
+
date: 2013-09-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- .gitignore
|
73
73
|
- .rspec
|
74
74
|
- .rvmrc
|
75
|
+
- .travis.yml
|
75
76
|
- Gemfile
|
76
77
|
- LICENSE.txt
|
77
78
|
- README.md
|