rainforest-cli 0.0.3 → 0.0.4

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.
data/.rspec CHANGED
@@ -1,3 +1,4 @@
1
1
  --color
2
- --format progress
2
+ --format=nested
3
3
  --require spec_helper
4
+ --profile
@@ -29,7 +29,8 @@ module Rainforest
29
29
  sleep 5
30
30
  response = get "#{API_URL}/#{run_id}"
31
31
  if %w(queued in_progress sending_webhook waiting_for_callback).include?(response["state"])
32
- puts "Run #{run_id} is still running: #{response['current_progress']['percent']}% complete."
32
+ puts "Run #{run_id} is still running: #{response['current_progress']['percent']}% complete and has #{response["result"]}"
33
+ running = false if response["result"] == 'failed' && @options.failfast?
33
34
  else
34
35
  puts "Run #{run_id} is now #{response["state"]} and has #{response["result"]}"
35
36
  running = false
@@ -14,6 +14,10 @@ module Rainforest
14
14
  @foreground = value
15
15
  end
16
16
 
17
+ opts.on("--fail-fast", String, "Fail as soon as there is a failure (don't wait for completion)") do |value|
18
+ @failfast = true
19
+ end
20
+
17
21
  opts.on("--token TOKEN", String, "Your rainforest API token.") do |value|
18
22
  @token = value
19
23
  end
@@ -35,6 +39,10 @@ module Rainforest
35
39
  @tests
36
40
  end
37
41
 
42
+ def failfast?
43
+ @failfast
44
+ end
45
+
38
46
  def foreground?
39
47
  @foreground
40
48
  end
@@ -1,5 +1,5 @@
1
1
  module Rainforest
2
2
  module Cli
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
data/spec/options_spec.rb CHANGED
@@ -28,4 +28,9 @@ describe Rainforest::Cli::OptionParser do
28
28
  let(:args) { ["run", "--conflict", "abort", "all"] }
29
29
  its(:conflict) { should == "abort"}
30
30
  end
31
+
32
+ context "it parses the fail-fast flag" do
33
+ let(:args) { ["run", "--fail-fast"] }
34
+ its(:failfast?) { should be_true }
35
+ end
31
36
  end
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.3
4
+ version: 0.0.4
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-08-21 00:00:00.000000000 Z
13
+ date: 2013-08-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty