limited_red 0.3.12 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Limited Red Ruby Client
2
2
 
3
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/limited-red/limited_red_rb)
3
4
  [![Build Status](https://secure.travis-ci.org//limited-red/limited_red_rb.png?branch=master)](https://secure.travis-ci.org//limited-red/limited_red_rb.png?branch=master)
4
5
 
5
6
 
@@ -26,7 +26,7 @@ module LimitedRed
26
26
  :token => token_for(data.merge(:build_id => build_id))})
27
27
 
28
28
  @thread_pool.with_a_thread_run do
29
- response = @adapter.post("/projects/#{@project_id}/builds/#{build_id}/results", :body => data)
29
+ response = @adapter.post("/#{@username}/#{@project_id}/builds/#{build_id}/results", :body => data)
30
30
  log(response) if error?(response)
31
31
  end
32
32
  end
@@ -38,7 +38,7 @@ module LimitedRed
38
38
  :build_id => build_id, :token => token_for(data)})
39
39
 
40
40
  @thread_pool.with_a_thread_run do
41
- response = @adapter.post("/projects/#{@project_id}/builds", :body => data)
41
+ response = @adapter.post("/#{@username}/#{@project_id}/builds", :body => data)
42
42
  log(response) if response && error?(response)
43
43
  end
44
44
  end
@@ -47,7 +47,7 @@ module LimitedRed
47
47
  raise "No project name was found in params: #{@config.inspect}" if @project_id.nil?
48
48
 
49
49
  begin
50
- response = @adapter.get("/projects/#{@project_id}/features/fails?user=#{@username}")
50
+ response = @adapter.get("/#{@username}/#{@project_id}/features/fails?user=#{@username}")
51
51
  rescue
52
52
  puts "[Limited Red] Unable to reach www.limited-red.com. No tests will be recorded."
53
53
  return []
@@ -1,8 +1,9 @@
1
1
  module LimitedRed
2
2
  class Config
3
- def initialize(out_stream = STDOUT, in_stream = STDIN)
3
+ def initialize(out_stream = STDOUT, in_stream = STDIN, env_config = ENV)
4
4
  @in = in_stream
5
5
  @out = out_stream
6
+ @env_config = env_config
6
7
  end
7
8
 
8
9
  def self.load_and_validate_config(type)
@@ -26,7 +27,18 @@ module LimitedRed
26
27
  @config ||= begin
27
28
  limited_red_project_config = load_yaml(limited_red_project_config_file)
28
29
  limited_red_shared_config = load_yaml(limited_red_shared_config_file)
29
- limited_red_shared_config.merge(limited_red_project_config)
30
+
31
+ limited_red_shared_config = limited_red_shared_config.merge(limited_red_project_config)
32
+
33
+ if @env_config.has_key?('LIMITED_RED_USERNAME')
34
+ limited_red_shared_config = limited_red_shared_config.merge({'username' => @env_config['LIMITED_RED_USERNAME']})
35
+ end
36
+
37
+ if @env_config.has_key?('LIMITED_RED_API_KEY')
38
+ limited_red_shared_config = limited_red_shared_config.merge({'api key' => @env_config['LIMITED_RED_API_KEY']})
39
+ end
40
+
41
+ limited_red_shared_config
30
42
  end
31
43
  end
32
44
 
@@ -42,6 +54,8 @@ module LimitedRed
42
54
  end
43
55
 
44
56
  def ensure_config_exists
57
+ return if @env_config['LIMITED_RED_API_KEY']
58
+
45
59
  unless limited_red_project_config_file_exists?
46
60
  details = ask_for_setup_details
47
61
 
@@ -1,5 +1,5 @@
1
1
  module LimitedRed # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = '0.3.12'
3
+ STRING = '0.4.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limited_red
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,27 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-17 00:00:00.000000000 Z
12
+ date: 2012-09-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70133766895700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - '='
19
+ - - =
20
20
  - !ruby/object:Gem::Version
21
21
  version: 0.8.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - '='
28
- - !ruby/object:Gem::Version
29
- version: 0.8.1
24
+ version_requirements: *70133766895700
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: cucumber
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70133766895100 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,12 +32,7 @@ dependencies:
37
32
  version: 1.1.4
38
33
  type: :runtime
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: 1.1.4
35
+ version_requirements: *70133766895100
46
36
  description: Learn and adapt from you test metrics. Used with the www.limited-red.com
47
37
  service. Tests are priorited by the probability of failure
48
38
  email: joe@josephwilk.net
@@ -88,8 +78,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
78
  version: '0'
89
79
  requirements: []
90
80
  rubyforge_project:
91
- rubygems_version: 1.8.24
81
+ rubygems_version: 1.8.6
92
82
  signing_key:
93
83
  specification_version: 3
94
84
  summary: Client for www.limited-red.com service
95
85
  test_files: []
86
+ has_rdoc: