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 ADDED
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - 2.0.0
3
+ - 1.9.3
4
+ - 1.8.7
data/Gemfile CHANGED
@@ -5,4 +5,6 @@ gemspec
5
5
 
6
6
  group :test do
7
7
  gem "rspec"
8
- end
8
+ gem "webmock", "=1.11"
9
+ gem "vcr"
10
+ end
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/rainforestapp/rainforest-cli.png?branch=master)](https://travis-ci.org/rainforestapp/rainforest-cli)
2
+
1
3
  # Rainforest-cli
2
4
 
3
5
  A command line interface to interact with RainforestQA.
@@ -4,8 +4,14 @@ require "httparty"
4
4
  require "json"
5
5
 
6
6
  module Rainforest
7
- module Cli
8
- API_URL = 'https://app.rainforestqa.com/api/1/runs'
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(API_URL, post_opts)
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 "#{API_URL}/#{run_id}?gem_version=#{Rainforest::Cli::VERSION}"
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?
@@ -20,7 +20,6 @@ module Rainforest
20
20
  @browsers = nil
21
21
 
22
22
  @parsed = ::OptionParser.new do |opts|
23
- puts opts.inspect
24
23
  opts.on("--fg", "Run the tests in foreground.") do |value|
25
24
  @foreground = value
26
25
  end
@@ -1,5 +1,5 @@
1
1
  module Rainforest
2
2
  module Cli
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
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.9
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-17 00:00:00.000000000 Z
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