limited_red 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,17 +7,16 @@ require 'cucumber'
7
7
  module LimitedRed
8
8
  ROOT = File.expand_path('..', __FILE__).to_s
9
9
 
10
- autoload :Gzip, "#{ROOT}/limited_red/gzip"
11
- autoload :Client, "#{ROOT}/limited_red/client"
12
-
13
- autoload :ThreadPool, "#{ROOT}/limited_red/thread_pool"
10
+ autoload :Gzip, "#{ROOT}/limited_red/gzip"
11
+ autoload :Client, "#{ROOT}/limited_red/client"
12
+ autoload :ThreadPool, "#{ROOT}/limited_red/thread_pool"
14
13
  autoload :FakeThreadPool, "#{ROOT}/limited_red/thread_pool"
15
-
16
- autoload :Stats, "#{ROOT}/limited_red/stats"
17
- autoload :Config, "#{ROOT}/limited_red/config"
14
+ autoload :Stats, "#{ROOT}/limited_red/stats"
15
+ autoload :Config, "#{ROOT}/limited_red/config"
16
+ autoload :Version, "#{ROOT}/limited_red/version"
18
17
 
19
18
  module Adapter
20
- autoload :HttParty, "#{ROOT}/limited_red/adapter/httparty"
19
+ autoload :HttParty, "#{ROOT}/limited_red/adapter/httparty"
21
20
  end
22
21
 
23
22
  module Formatter
@@ -13,7 +13,9 @@ module LimitedRed
13
13
 
14
14
  def log_result(build_id, data)
15
15
  data[:result] = @adapter.encode_and_compress(data[:result])
16
- data = data.merge({:user => @username, :token => token_for(data.merge(:build_id => build_id))})
16
+ data = data.merge({:user => @username,
17
+ :version => LimitedRed::Version::STRING,
18
+ :token => token_for(data.merge(:build_id => build_id))})
17
19
 
18
20
  @thread_pool.with_a_thread_run do
19
21
  result = @adapter.post("/projects/#{@project_id}/builds/#{build_id}/results", :body => data)
@@ -23,7 +25,9 @@ module LimitedRed
23
25
 
24
26
  def log_build(build_id, data)
25
27
  data[:build_id] = build_id
26
- data = data.merge({:user => @username, :build_id => build_id, :token => token_for(data)})
28
+ data = data.merge({:user => @username,
29
+ :version => LimitedRed::Version::STRING,
30
+ :build_id => build_id, :token => token_for(data)})
27
31
 
28
32
  @thread_pool.with_a_thread_run do
29
33
  result = @adapter.post("/projects/#{@project_id}/builds", :body => data)
@@ -48,9 +52,12 @@ module LimitedRed
48
52
  build_data_string(data[:passes]) +
49
53
  (data[:result] ? data[:result] : "") +
50
54
  (data[:build_id].to_s) +
55
+ LimitedRed::Version::STRING +
51
56
  @api_key.to_s
52
-
53
- Digest::SHA1.hexdigest(data_string)
57
+
58
+ sha512 = Digest::SHA512.new
59
+ digest = sha512.digest(data_string)
60
+ Digest.hexencode(digest)
54
61
  end
55
62
 
56
63
  def build_data_string(data)
@@ -0,0 +1,5 @@
1
+ module LimitedRed # :nodoc:
2
+ module Version # :nodoc:
3
+ STRING = '0.3.0'
4
+ end
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.2.6
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-25 00:00:00.000000000Z
12
+ date: 2011-12-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &70316816655480 !ruby/object:Gem::Requirement
16
+ requirement: &70354798265740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.8.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70316816655480
24
+ version_requirements: *70354798265740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: cucumber
27
- requirement: &70316816654860 !ruby/object:Gem::Requirement
27
+ requirement: &70354798265200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 1.1.4
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70316816654860
35
+ version_requirements: *70354798265200
36
36
  description: Learn and adapt from you test metrics. Used with the www.limited-red.com
37
37
  service. Tests are priorited by the probability of failure
38
38
  email: joe@josephwilk.net
@@ -50,6 +50,7 @@ files:
50
50
  - lib/limited_red/plugin.rb
51
51
  - lib/limited_red/stats.rb
52
52
  - lib/limited_red/thread_pool.rb
53
+ - lib/limited_red/version.rb
53
54
  - lib/limited_red.rb
54
55
  - LICENSE
55
56
  - README.rdoc