rainforest-cli 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -3
- data/lib/rainforest/cli.rb +4 -10
- data/lib/rainforest/cli/version.rb +1 -1
- data/spec/spec_helper.rb +0 -7
- metadata +2 -2
data/Gemfile
CHANGED
data/lib/rainforest/cli.rb
CHANGED
@@ -4,14 +4,8 @@ require "httparty"
|
|
4
4
|
require "json"
|
5
5
|
|
6
6
|
module Rainforest
|
7
|
-
module Cli
|
8
|
-
|
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
|
7
|
+
module Cli
|
8
|
+
API_URL = 'https://app.rainforestqa.com/api/1/runs'
|
15
9
|
|
16
10
|
def self.start(args)
|
17
11
|
@options = OptionParser.new(args)
|
@@ -29,7 +23,7 @@ module Rainforest
|
|
29
23
|
|
30
24
|
puts "Issuing run"
|
31
25
|
|
32
|
-
response = post(
|
26
|
+
response = post(API_URL, post_opts)
|
33
27
|
|
34
28
|
if response['error']
|
35
29
|
puts "Error starting your run: #{response['error']}"
|
@@ -43,7 +37,7 @@ module Rainforest
|
|
43
37
|
|
44
38
|
while running
|
45
39
|
sleep 5
|
46
|
-
response = get "#{
|
40
|
+
response = get "#{API_URL}/#{run_id}?gem_version=#{Rainforest::Cli::VERSION}"
|
47
41
|
if %w(queued in_progress sending_webhook waiting_for_callback).include?(response["state"])
|
48
42
|
puts "Run #{run_id} is #{response['state']} and is #{response['current_progress']['percent']}% complete"
|
49
43
|
running = false if response["result"] == 'failed' && @options.failfast?
|
data/spec/spec_helper.rb
CHANGED
@@ -6,13 +6,6 @@
|
|
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
|
16
9
|
|
17
10
|
RSpec.configure do |config|
|
18
11
|
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.11
|
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-
|
13
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|