chicanery 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2294bb93b469bfefc0a36b829f1d30a6c85d43a
4
- data.tar.gz: 4b0a2c6565a3ae523bb748a4e3e1d00c84b4bb3b
3
+ metadata.gz: 06154319be2516602f494511de80525664d02791
4
+ data.tar.gz: b9e358c36d08ce74769bbfa967e9e5ee7663f069
5
5
  SHA512:
6
- metadata.gz: ab140228326d5dc93958a6fc0b995e6dc6ab24b1ba390b7d8df48ae4d489a63f02cadee12a1030e9abad0a0467216a34a24fabaab787fdb30e3bd6e6247d47e5
7
- data.tar.gz: 50d4691c8d0de15de244f1b3083d7ca4327c10ab6df4ccb01e9ef13eefdc3654234781f3012171458aa107ec05d0692dc200abe3d9d30362d222d60e7ba38c92
6
+ metadata.gz: a5ac4d6a5a033b0f1e61de5c3d5224efaa24c5168294715034b9c13ef6f14ada9fcf3216e0d9421675f1ea6568a09705ae4faaa659e252b3575cf81fb05ab789
7
+ data.tar.gz: d42d771ef47adfbb434a1e4b65192263c597d1731e7d952769b1d64c1261e30997513462522f8670c312c73b06f7177443b56eaab27f925a83d5b0502e1ac7ba
data/Gemfile.lock CHANGED
@@ -1,37 +1,39 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chicanery (0.1.5)
4
+ chicanery (0.1.6)
5
5
  nokogiri (~> 1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.3.5)
11
- crack (0.4.1)
12
- safe_yaml (~> 0.9.0)
13
- diff-lcs (1.2.4)
14
- mini_portile (0.5.1)
15
- multi_json (1.8.0)
16
- nokogiri (1.6.0)
17
- mini_portile (~> 0.5.0)
10
+ addressable (2.3.6)
11
+ crack (0.4.2)
12
+ safe_yaml (~> 1.0.0)
13
+ diff-lcs (1.2.5)
14
+ docile (1.1.5)
15
+ mini_portile (0.6.0)
16
+ multi_json (1.10.1)
17
+ nokogiri (1.6.3.1)
18
+ mini_portile (= 0.6.0)
18
19
  rake (0.9.6)
19
- rspec (2.14.1)
20
- rspec-core (~> 2.14.0)
21
- rspec-expectations (~> 2.14.0)
22
- rspec-mocks (~> 2.14.0)
23
- rspec-core (2.14.5)
24
- rspec-expectations (2.14.2)
20
+ rspec (2.99.0)
21
+ rspec-core (~> 2.99.0)
22
+ rspec-expectations (~> 2.99.0)
23
+ rspec-mocks (~> 2.99.0)
24
+ rspec-core (2.99.1)
25
+ rspec-expectations (2.99.2)
25
26
  diff-lcs (>= 1.1.3, < 2.0)
26
- rspec-mocks (2.14.3)
27
- safe_yaml (0.9.5)
28
- simplecov (0.7.1)
29
- multi_json (~> 1.0)
30
- simplecov-html (~> 0.7.1)
27
+ rspec-mocks (2.99.2)
28
+ safe_yaml (1.0.3)
29
+ simplecov (0.9.0)
30
+ docile (~> 1.1.0)
31
+ multi_json
32
+ simplecov-html (~> 0.8.0)
31
33
  simplecov-gem-adapter (1.0.1)
32
34
  simplecov
33
- simplecov-html (0.7.1)
34
- vcr (2.5.0)
35
+ simplecov-html (0.8.0)
36
+ vcr (2.9.2)
35
37
  webmock (1.9.3)
36
38
  addressable (>= 2.2.7)
37
39
  crack (>= 0.3.2)
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.5"
19
+ VERSION = "0.1.6"
20
20
 
21
21
  def poll_period seconds=nil
22
22
  @poll_period = seconds if seconds
@@ -15,7 +15,9 @@ module Chicanery
15
15
  class Server < Chicanery::Site
16
16
  def jobs
17
17
  jobs = {}
18
- Nokogiri::XML(response_body = get).css("Project").each do |project|
18
+ response_body = get
19
+ File.open("#{Time.now.to_i}.xml", 'w') {|f| f.puts response_body} if ENV['CHICANERY_CAPTURE']
20
+ Nokogiri::XML(response_body).css("Project").each do |project|
19
21
  job = {
20
22
  activity: project[:activity] == 'Sleeping' ? :sleeping : :building,
21
23
  last_build_status: parse_build_status(project[:lastBuildStatus]),
@@ -23,6 +25,9 @@ module Chicanery
23
25
  url: project[:webUrl],
24
26
  last_label: project[:lastBuildLabel]
25
27
  }
28
+ project.css('message').each do |message|
29
+ job[:breaker] = message[:text] if message[:kind] == 'Breakers'
30
+ end
26
31
  jobs[project[:name]] = job unless filtered project[:name]
27
32
  end
28
33
  raise "could not find any jobs in response: [#{response_body}]" if jobs.empty?
@@ -30,7 +35,7 @@ module Chicanery
30
35
  end
31
36
 
32
37
  def parse_build_time time
33
- return nil if time.nil? || time.empty?
38
+ return nil if time.nil? || time.empty? || time == '0'
34
39
  DateTime.parse(time).to_time.to_i
35
40
  end
36
41
 
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chicanery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Ryall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-08 00:00:00.000000000 Z
11
+ date: 2014-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov-gem-adapter
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: vcr
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webmock
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - <
101
+ - - "<"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.10'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - <
108
+ - - "<"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.10'
111
111
  description: trigger various events related to a continuous integration environment
@@ -116,8 +116,8 @@ executables:
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
- - .gitignore
120
- - .travis.yml
119
+ - ".gitignore"
120
+ - ".travis.yml"
121
121
  - Gemfile
122
122
  - Gemfile.lock
123
123
  - LICENSE.txt
@@ -160,17 +160,17 @@ require_paths:
160
160
  - lib
161
161
  required_ruby_version: !ruby/object:Gem::Requirement
162
162
  requirements:
163
- - - '>='
163
+ - - ">="
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  requirements:
168
- - - '>='
168
+ - - ">="
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.0.3
173
+ rubygems_version: 2.2.2
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: polls various resources related to a ci environment and performs custom notifications