limited_red 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,8 +18,8 @@ module LimitedRed
18
18
  :token => token_for(data.merge(:build_id => build_id))})
19
19
 
20
20
  @thread_pool.with_a_thread_run do
21
- result = @adapter.post("/projects/#{@project_id}/builds/#{build_id}/results", :body => data)
22
- @out.puts error_message(result) if error?(result)
21
+ response = @adapter.post("/projects/#{@project_id}/builds/#{build_id}/results", :body => data)
22
+ log(response) if error?(response)
23
23
  end
24
24
  end
25
25
 
@@ -30,8 +30,8 @@ module LimitedRed
30
30
  :build_id => build_id, :token => token_for(data)})
31
31
 
32
32
  @thread_pool.with_a_thread_run do
33
- result = @adapter.post("/projects/#{@project_id}/builds", :body => data)
34
- @out.puts error_message(result) if error?(result)
33
+ response = @adapter.post("/projects/#{@project_id}/builds", :body => data)
34
+ log(response) if error?(response)
35
35
  end
36
36
  end
37
37
 
@@ -40,8 +40,11 @@ module LimitedRed
40
40
 
41
41
  response = @adapter.get("/projects/#{@project_id}/features/fails?user=#{@username}")
42
42
 
43
- return [] if response.nil? || response.empty?
44
- response.code == 200 ? response.body.split(" ") : []
43
+ if response.nil? || response.empty? || error?(response)
44
+ return []
45
+ else
46
+ response.body.split(" ")
47
+ end
45
48
  end
46
49
 
47
50
  private
@@ -64,18 +67,16 @@ module LimitedRed
64
67
  data == "" || data.nil? ? "" : data.join("")
65
68
  end
66
69
 
67
- def error?(result)
68
- result && !result.body.empty?
70
+ def error?(response)
71
+ response.code != 200
72
+ end
73
+
74
+ def log(response)
75
+ @out.puts(error_message(response))
69
76
  end
70
77
 
71
- def error_message(error_msg)
72
- if (ENV['LIMITED_RED_ENV'] == 'test') || (ENV['LIMITED_RED_ENV'] == 'development')
73
- message = error_msg
74
- else
75
- message = ""
76
- end
77
-
78
- "\nLimited Red had a problem logging your test results.\n#{message}"
78
+ def error_message(response)
79
+ "\nLimited Red had a problem logging your test results: #{response ? response.body : ''}"
79
80
  end
80
81
  end
81
82
  end
@@ -1,5 +1,5 @@
1
1
  module LimitedRed # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = '0.3.6'
3
+ STRING = '0.3.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,47 +1,60 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: limited_red
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.6
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 3
8
+ - 7
9
+ version: 0.3.7
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Joseph Wilk
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-02-19 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2012-02-20 00:00:00 +00:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: httparty
16
- requirement: &70244157382760 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - =
20
- - !ruby/object:Gem::Version
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 8
30
+ - 1
21
31
  version: 0.8.1
22
32
  type: :runtime
23
- prerelease: false
24
- version_requirements: *70244157382760
25
- - !ruby/object:Gem::Dependency
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
26
35
  name: cucumber
27
- requirement: &70244157381320 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 1
44
+ - 4
32
45
  version: 1.1.4
33
46
  type: :runtime
34
- prerelease: false
35
- version_requirements: *70244157381320
36
- description: Learn and adapt from you test metrics. Used with the www.limited-red.com
37
- service. Tests are priorited by the probability of failure
47
+ version_requirements: *id002
48
+ description: Learn and adapt from you test metrics. Used with the www.limited-red.com service. Tests are priorited by the probability of failure
38
49
  email: joe@josephwilk.net
39
50
  executables: []
51
+
40
52
  extensions: []
41
- extra_rdoc_files:
53
+
54
+ extra_rdoc_files:
42
55
  - LICENSE
43
56
  - README.rdoc
44
- files:
57
+ files:
45
58
  - lib/limited_red/adapter/httparty.rb
46
59
  - lib/limited_red/client.rb
47
60
  - lib/limited_red/config.rb
@@ -55,31 +68,35 @@ files:
55
68
  - lib/limited_red.rb
56
69
  - LICENSE
57
70
  - README.rdoc
71
+ has_rdoc: true
58
72
  homepage: http://www.limited-red.com
59
- licenses:
73
+ licenses:
60
74
  - MIT
61
75
  post_install_message:
62
- rdoc_options:
76
+ rdoc_options:
63
77
  - --charset=UTF-8
64
- require_paths:
78
+ require_paths:
65
79
  - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
69
- - - ! '>='
70
- - !ruby/object:Gem::Version
71
- version: '0'
72
- required_rubygems_version: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ segments:
92
+ - 0
93
+ version: "0"
78
94
  requirements: []
95
+
79
96
  rubyforge_project:
80
- rubygems_version: 1.8.6
97
+ rubygems_version: 1.3.6
81
98
  signing_key:
82
99
  specification_version: 3
83
100
  summary: Client for www.limited-red.com service
84
101
  test_files: []
85
- has_rdoc:
102
+