snakeeyes 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/snakeeyes.rb +17 -3
  2. metadata +34 -7
@@ -7,7 +7,7 @@ require 'pp'
7
7
 
8
8
  class SnakeEyes
9
9
 
10
- attr_accessor :path, :sleep, :debug_level, :run_count, :master, :omaster
10
+ attr_accessor :path, :sleep, :debug_level, :run_count, :master, :omaster, :config
11
11
 
12
12
  def initialize(path)
13
13
  @path = path
@@ -31,10 +31,12 @@ class SnakeEyes
31
31
  reset_to_newest_commit
32
32
  pass, output = run_tests
33
33
  report_tests(pass, output)
34
+ @run_count += 1
35
+ else
36
+ heartbeat
34
37
  end
35
38
 
36
39
  sleepy_time
37
- @run_count += 1
38
40
  end
39
41
  end
40
42
 
@@ -95,6 +97,18 @@ class SnakeEyes
95
97
  new_master != current_master
96
98
  end
97
99
 
100
+ def heartbeat
101
+ debug "heartbeating"
102
+ config = hawk_config
103
+ data = {
104
+ "agent" => config[:agent],
105
+ "description" => config[:description],
106
+ "url" => config[:url],
107
+ "heartbeat" => '1',
108
+ }
109
+ post_update(data.to_json) # POST JSON TO URL
110
+ end
111
+
98
112
  def sleepy_time
99
113
  debug
100
114
  debug "OK, sleeping for a while (#{@sleep})..."
@@ -124,11 +138,11 @@ class SnakeEyes
124
138
  data = {
125
139
  "agent" => config[:agent],
126
140
  "description" => config[:description],
141
+ "url" => config[:url],
127
142
  "branch" => "master",
128
143
  "author" => author,
129
144
  "sha" => sha,
130
145
  "status" => status,
131
- "url" => config[:url],
132
146
  "message" => message,
133
147
  "output" => output
134
148
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snakeeyes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Scott Chacon
@@ -15,10 +15,37 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-16 00:00:00 -08:00
18
+ date: 2010-12-17 00:00:00 -08:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: json
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: popen4
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :runtime
48
+ version_requirements: *id002
22
49
  description: " snakeeyes is a polling, command line based cijoe replacement that will\n report to generalhawk.\n"
23
50
  email: schacon@gmail.com
24
51
  executables:
@@ -64,6 +91,6 @@ rubyforge_project:
64
91
  rubygems_version: 1.3.7
65
92
  signing_key:
66
93
  specification_version: 3
67
- summary: snakeeyes reports to general hawk. hes the coolest cijoe
94
+ summary: snakeeyes reports to general hawk. he's the coolest cijoe
68
95
  test_files: []
69
96