chicanery 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTlkYjYzOTk1OTQ2ZTYzODY5ZTczNjg5MGNhY2I2ZmZhOTgxZmEwMw==
5
+ data.tar.gz: !binary |-
6
+ Njg2ZTk2MzM4ZWIyMGU1MmVjMmQzYTRiYzE5MzZkZDE0YTFkYjAxOQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZGY4NmM0NDE4ZTFlZjE3YzQ3OGUzZDJlZmUwMmQ5YmNiOTc2NzM5YjgzZDQ3
10
+ ZDAxYTg2MTY1MzMxNjYxZDlmNDVmN2M4NzI2NDY5N2MwMjgxOTdjY2UxZTYx
11
+ OTAyMjI3OWUxNDJkZDllNzdmMGRjYjQ2MmExZjgyNDdhNDllOTU=
12
+ data.tar.gz: !binary |-
13
+ NmVjZGVlNGI2YzA2NWEwMjY2MGU3MTZhMGJhM2I4MzAyNjhhM2I4NjdlM2Yw
14
+ ODJiYWZjMGJkOWE1ZDEzNGMzNWQ4NDljYWZjMmZkYWZjOWU2MjhlNzMxNzY5
15
+ Y2E2YzM5NmU5OGJlMzQ3MGI3YjcyNjYxOTNhZjcxOGE4NzI4ODk=
data/Gemfile.lock CHANGED
@@ -1,22 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chicanery (0.1.1)
4
+ chicanery (0.1.3)
5
5
  nokogiri (~> 1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- diff-lcs (1.2.1)
11
- fakeweb (1.3.0)
12
- multi_json (1.6.1)
13
- nokogiri (1.5.6)
10
+ addressable (2.3.3)
11
+ crack (0.3.2)
12
+ diff-lcs (1.2.2)
13
+ multi_json (1.7.2)
14
+ nokogiri (1.5.9)
14
15
  rake (0.9.6)
15
16
  rspec (2.13.0)
16
17
  rspec-core (~> 2.13.0)
17
18
  rspec-expectations (~> 2.13.0)
18
19
  rspec-mocks (~> 2.13.0)
19
- rspec-core (2.13.0)
20
+ rspec-core (2.13.1)
20
21
  rspec-expectations (2.13.0)
21
22
  diff-lcs (>= 1.1.3, < 2.0)
22
23
  rspec-mocks (2.13.0)
@@ -27,15 +28,18 @@ GEM
27
28
  simplecov
28
29
  simplecov-html (0.7.1)
29
30
  vcr (2.4.0)
31
+ webmock (1.9.3)
32
+ addressable (>= 2.2.7)
33
+ crack (>= 0.3.2)
30
34
 
31
35
  PLATFORMS
32
36
  ruby
33
37
 
34
38
  DEPENDENCIES
35
39
  chicanery!
36
- fakeweb
37
40
  rake (~> 0)
38
41
  rspec (~> 2)
39
42
  simplecov
40
43
  simplecov-gem-adapter
41
44
  vcr
45
+ webmock (< 1.10)
data/chicanery.gemspec CHANGED
@@ -24,5 +24,5 @@ Gem::Specification.new do |gem|
24
24
  gem.add_development_dependency 'simplecov'
25
25
  gem.add_development_dependency 'simplecov-gem-adapter'
26
26
  gem.add_development_dependency 'vcr'
27
- gem.add_development_dependency 'fakeweb'
27
+ gem.add_development_dependency 'webmock', '<1.10'
28
28
  end
@@ -46,9 +46,7 @@ http_interactions:
46
46
  - keep-alive
47
47
  body:
48
48
  encoding: US-ASCII
49
- string: ! "<Projects>\n <Project\n name=\"markryall/chicanery\"\n activity=\"Sleeping\"\n
50
- \ lastBuildStatus=\"Failure\"\n lastBuildLabel=\"50\"\n lastBuildTime=\"2012-12-15T02:41:20.000+0000\"\n
51
- \ webUrl=\"api.travis-ci.org/markryall/chicanery\" />\n</Projects>"
49
+ string: ! "<Projects>\n <Project\n name=\"markryall/chicanery\"\n activity=\"Sleeping\"\nlastBuildStatus=\"Failure\"\n lastBuildLabel=\"50\"\n lastBuildTime=\"2012-12-15T02:41:20.000+0000\"\nwebUrl=\"api.travis-ci.org/markryall/chicanery\" />\n</Projects>"
52
50
  http_version: '1.1'
53
51
  recorded_at: Sat, 15 Dec 2012 02:41:42 GMT
54
52
  recorded_with: VCR 2.3.0
@@ -46,9 +46,7 @@ http_interactions:
46
46
  - keep-alive
47
47
  body:
48
48
  encoding: US-ASCII
49
- string: ! "<Projects>\n <Project\n name=\"markryall/chicanery\"\n activity=\"Sleeping\"\n
50
- \ lastBuildStatus=\"Success\"\n lastBuildLabel=\"48\"\n lastBuildTime=\"2012-12-15T02:18:28.000+0000\"\n
51
- \ webUrl=\"api.travis-ci.org/markryall/chicanery\" />\n</Projects>"
49
+ string: ! "<Projects>\n <Project\n name=\"markryall/chicanery\"\n activity=\"Sleeping\"\nlastBuildStatus=\"Success\"\n lastBuildLabel=\"48\"\n lastBuildTime=\"2012-12-15T02:18:28.000+0000\"\nwebUrl=\"api.travis-ci.org/markryall/chicanery\" />\n</Projects>"
52
50
  http_version: '1.1'
53
51
  recorded_at: Sat, 15 Dec 2012 02:36:20 GMT
54
52
  recorded_with: VCR 2.3.0
@@ -46,9 +46,7 @@ http_interactions:
46
46
  - keep-alive
47
47
  body:
48
48
  encoding: US-ASCII
49
- string: ! "<Projects>\n <Project\n name=\"markryall/chicanery\"\n activity=\"Building\"\n
50
- \ lastBuildStatus=\"Unknown\"\n lastBuildLabel=\"49\"\n lastBuildTime=\"\"\n
51
- \ webUrl=\"api.travis-ci.org/markryall/chicanery\" />\n</Projects>"
49
+ string: ! "<Projects>\n <Project\n name=\"markryall/chicanery\"\n activity=\"Building\"\nlastBuildStatus=\"Unknown\"\n lastBuildLabel=\"49\"\n lastBuildTime=\"\"\nwebUrl=\"api.travis-ci.org/markryall/chicanery\" />\n</Projects>"
52
50
  http_version: '1.1'
53
51
  recorded_at: Sat, 15 Dec 2012 02:39:09 GMT
54
52
  recorded_with: VCR 2.3.0
@@ -13,5 +13,13 @@ module Chicanery
13
13
  status == :down
14
14
  end.inject(false) {|v,a| v || a}
15
15
  end
16
+
17
+ def building?
18
+ self[:servers].map do |name,jobs|
19
+ jobs.map do |name, state|
20
+ state[:activity] == :building
21
+ end
22
+ end.flatten.inject(false) {|v,a| v || a}
23
+ end
16
24
  end
17
25
  end
data/lib/chicanery.rb CHANGED
@@ -16,7 +16,7 @@ module Chicanery
16
16
  include Repos
17
17
  include Sites
18
18
 
19
- VERSION = "0.1.1"
19
+ VERSION = "0.1.3"
20
20
 
21
21
  def poll_period seconds=nil
22
22
  @poll_period = seconds if seconds
@@ -3,7 +3,7 @@ require 'vcr'
3
3
 
4
4
  VCR.configure do |c|
5
5
  c.cassette_library_dir = 'fixtures/vcr_cassettes'
6
- c.hook_into :fakeweb
6
+ c.hook_into :webmock
7
7
  end
8
8
 
9
9
  describe Chicanery::Cctray do
@@ -1,11 +1,11 @@
1
1
  describe Chicanery::Summary do
2
- describe '#failure?' do
3
- let(:state) { {servers: {} } }
2
+ let(:state) { {servers: {} } }
4
3
 
5
- before do
6
- state.extend Chicanery::Summary
7
- end
4
+ before do
5
+ state.extend Chicanery::Summary
6
+ end
8
7
 
8
+ describe '#failure?' do
9
9
  it 'should be false if there are no jobs' do
10
10
  state.should_not have_failure
11
11
  end
@@ -26,4 +26,26 @@ describe Chicanery::Summary do
26
26
  state.should have_failure
27
27
  end
28
28
  end
29
+
30
+ describe '#building?' do
31
+ it 'should be false if there are no jobs' do
32
+ state.should_not be_building
33
+ end
34
+
35
+ it 'should be false if all jobs are sleeping' do
36
+ state[:servers][:server1] = {
37
+ job1: { activity: :sleeping },
38
+ job2: { activity: :sleeping }
39
+ }
40
+ state.should_not be_building
41
+ end
42
+
43
+ it 'should be true if there is a single job building' do
44
+ state[:servers][:server1] = {
45
+ job1: { activity: :sleeping },
46
+ job2: { activity: :building }
47
+ }
48
+ state.should be_building
49
+ end
50
+ end
29
51
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chicanery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mark Ryall
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-01 00:00:00.000000000 Z
11
+ date: 2013-04-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: nokogiri
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: simplecov
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: simplecov-gem-adapter
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: vcr
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ! '>='
100
88
  - !ruby/object:Gem::Version
@@ -102,27 +90,24 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ! '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
- name: fakeweb
98
+ name: webmock
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - <
116
102
  - !ruby/object:Gem::Version
117
- version: '0'
103
+ version: '1.10'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - <
124
109
  - !ruby/object:Gem::Version
125
- version: '0'
110
+ version: '1.10'
126
111
  description: trigger various events related to a continuous integration environment
127
112
  email:
128
113
  - mark@ryall.name
@@ -168,33 +153,26 @@ files:
168
153
  - spec/embedded_chicanery_spec.rb
169
154
  homepage: http://github.com/markryall/chicanery
170
155
  licenses: []
156
+ metadata: {}
171
157
  post_install_message:
172
158
  rdoc_options: []
173
159
  require_paths:
174
160
  - lib
175
161
  required_ruby_version: !ruby/object:Gem::Requirement
176
- none: false
177
162
  requirements:
178
163
  - - ! '>='
179
164
  - !ruby/object:Gem::Version
180
165
  version: '0'
181
- segments:
182
- - 0
183
- hash: -3139042759217892738
184
166
  required_rubygems_version: !ruby/object:Gem::Requirement
185
- none: false
186
167
  requirements:
187
168
  - - ! '>='
188
169
  - !ruby/object:Gem::Version
189
170
  version: '0'
190
- segments:
191
- - 0
192
- hash: -3139042759217892738
193
171
  requirements: []
194
172
  rubyforge_project:
195
- rubygems_version: 1.8.23
173
+ rubygems_version: 2.0.3
196
174
  signing_key:
197
- specification_version: 3
175
+ specification_version: 4
198
176
  summary: polls various resources related to a ci environment and performs custom notifications
199
177
  test_files:
200
178
  - spec/chicanery/cctray_spec.rb