go_cd_feed 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.rvmrc +1 -0
  4. data/.zeroci.yml +1 -0
  5. data/Gemfile +4 -0
  6. data/Gemfile.lock +32 -0
  7. data/README.textile +36 -0
  8. data/Rakefile +39 -0
  9. data/bin/go_api_client +3 -0
  10. data/go_api_client.gemspec +27 -0
  11. data/lib/go_api_client.rb +60 -0
  12. data/lib/go_api_client/atom.rb +4 -0
  13. data/lib/go_api_client/atom/author.rb +42 -0
  14. data/lib/go_api_client/atom/entry.rb +34 -0
  15. data/lib/go_api_client/atom/feed.rb +44 -0
  16. data/lib/go_api_client/atom/feed_page.rb +49 -0
  17. data/lib/go_api_client/commit.rb +30 -0
  18. data/lib/go_api_client/helpers.rb +1 -0
  19. data/lib/go_api_client/helpers/simple_attribute_support.rb +11 -0
  20. data/lib/go_api_client/http_fetcher.rb +43 -0
  21. data/lib/go_api_client/job.rb +64 -0
  22. data/lib/go_api_client/pipeline.rb +49 -0
  23. data/lib/go_api_client/stage.rb +57 -0
  24. data/lib/go_api_client/user.rb +36 -0
  25. data/lib/go_api_client/version.rb +9 -0
  26. data/ssh_keys/git-ci.zeroci.com +27 -0
  27. data/ssh_keys/git-ci.zeroci.com.pub +1 -0
  28. data/ssh_keys/git-ssh +3 -0
  29. data/test/fixtures/building/job_1.xml +41 -0
  30. data/test/fixtures/building/job_2.xml +43 -0
  31. data/test/fixtures/building/job_3.xml +40 -0
  32. data/test/fixtures/building/job_4.xml +40 -0
  33. data/test/fixtures/building/pipeline_1.xml +45 -0
  34. data/test/fixtures/building/pipeline_2.xml +39 -0
  35. data/test/fixtures/building/pipeline_3.xml +71 -0
  36. data/test/fixtures/building/stages.xml +180 -0
  37. data/test/fixtures/building/stages_1.xml +16 -0
  38. data/test/fixtures/building/stages_2.xml +16 -0
  39. data/test/fixtures/building/stages_3.xml +16 -0
  40. data/test/fixtures/building/stages_4.xml +16 -0
  41. data/test/fixtures/job_1_console.log.txt +82 -0
  42. data/test/fixtures/job_2_console.log.txt +82 -0
  43. data/test/fixtures/jobs_1.xml +29 -0
  44. data/test/fixtures/jobs_2.xml +29 -0
  45. data/test/fixtures/jobs_with_no_properties.xml +42 -0
  46. data/test/fixtures/ordering/go/api/jobs/1.xml +29 -0
  47. data/test/fixtures/ordering/go/api/jobs/10.xml +31 -0
  48. data/test/fixtures/ordering/go/api/jobs/2.xml +29 -0
  49. data/test/fixtures/ordering/go/api/jobs/3.xml +29 -0
  50. data/test/fixtures/ordering/go/api/jobs/4.xml +29 -0
  51. data/test/fixtures/ordering/go/api/jobs/5.xml +29 -0
  52. data/test/fixtures/ordering/go/api/jobs/6.xml +29 -0
  53. data/test/fixtures/ordering/go/api/jobs/7.xml +31 -0
  54. data/test/fixtures/ordering/go/api/jobs/8.xml +31 -0
  55. data/test/fixtures/ordering/go/api/jobs/9.xml +31 -0
  56. data/test/fixtures/ordering/go/api/pipelines/defaultPipeline/1.xml +31 -0
  57. data/test/fixtures/ordering/go/api/pipelines/defaultPipeline/2.xml +26 -0
  58. data/test/fixtures/ordering/go/api/pipelines/defaultPipeline/3.xml +26 -0
  59. data/test/fixtures/ordering/go/api/pipelines/defaultPipeline/4.xml +27 -0
  60. data/test/fixtures/ordering/go/api/pipelines/defaultPipeline/5.xml +33 -0
  61. data/test/fixtures/ordering/go/api/pipelines/defaultPipeline/stages.xml +255 -0
  62. data/test/fixtures/ordering/go/api/stages/1.xml +14 -0
  63. data/test/fixtures/ordering/go/api/stages/10.xml +14 -0
  64. data/test/fixtures/ordering/go/api/stages/2.xml +14 -0
  65. data/test/fixtures/ordering/go/api/stages/3.xml +14 -0
  66. data/test/fixtures/ordering/go/api/stages/4.xml +14 -0
  67. data/test/fixtures/ordering/go/api/stages/5.xml +14 -0
  68. data/test/fixtures/ordering/go/api/stages/6.xml +14 -0
  69. data/test/fixtures/ordering/go/api/stages/7.xml +14 -0
  70. data/test/fixtures/ordering/go/api/stages/8.xml +14 -0
  71. data/test/fixtures/ordering/go/api/stages/9.xml +14 -0
  72. data/test/fixtures/pagination/stages.xml +636 -0
  73. data/test/fixtures/pagination/stages_before_7916973.xml +615 -0
  74. data/test/fixtures/pagination/stages_before_7959831.xml +615 -0
  75. data/test/fixtures/pipelines_1.xml +32 -0
  76. data/test/fixtures/stages.xml +63 -0
  77. data/test/fixtures/stages_1.xml +14 -0
  78. data/test/fixtures/stages_2.xml +14 -0
  79. data/test/fixtures/stages_empty.xml +9 -0
  80. data/test/go_api_client/atom/author_test.rb +27 -0
  81. data/test/go_api_client/atom/entry_test.rb +27 -0
  82. data/test/go_api_client/atom/feed_page_test.rb +41 -0
  83. data/test/go_api_client/atom/feed_test.rb +25 -0
  84. data/test/go_api_client/building_test.rb +38 -0
  85. data/test/go_api_client/commit_test.rb +38 -0
  86. data/test/go_api_client/job_test.rb +42 -0
  87. data/test/go_api_client/pipeline_test.rb +34 -0
  88. data/test/go_api_client/stage_test.rb +75 -0
  89. data/test/go_api_client/user_test.rb +27 -0
  90. data/test/test_helper.rb +31 -0
  91. metadata +272 -0
@@ -0,0 +1,27 @@
1
+ require "test_helper"
2
+
3
+ module GoApiClient
4
+ class UserTest < Test::Unit::TestCase
5
+
6
+ test "should parse user name and email address" do
7
+ user = User.parse("foobar <foo@example.com>")
8
+ assert_equal 'foobar', user.name
9
+ assert_equal 'foo@example.com', user.email
10
+ end
11
+
12
+ test "should strip name and email when parsing" do
13
+ user = User.parse("foobar1 <foo1@example.com>")
14
+ assert_equal 'foobar1', user.name
15
+ assert_equal 'foo1@example.com', user.email
16
+ end
17
+
18
+ test "equality" do
19
+ assert_equal User.parse("foobar <foo@example.com>"), User.parse("foobar <foo@example.com>")
20
+ end
21
+
22
+ test "hashcode" do
23
+ assert_equal User.parse("foobar <foo@example.com>").hash, User.parse("foobar <foo@example.com>").hash
24
+ assert_not_equal User.parse("bar <bar@example.com>").hash, User.parse("foo <foo@example.com>").hash
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'simplecov'
4
+ SimpleCov.start do
5
+ add_filter "/.bundle/"
6
+ add_filter "/bundle/"
7
+ add_filter "/test/"
8
+ end
9
+
10
+ Bundler.require
11
+ require 'test/unit'
12
+ require 'go_api_client'
13
+ require 'ostruct'
14
+ require 'webmock/test_unit'
15
+
16
+ module WebMock
17
+ class RequestStub
18
+ attr_accessor :responses_sequences
19
+ end
20
+ end
21
+ class Test::Unit::TestCase
22
+ def file_contents(file_name)
23
+ File.read(File.expand_path("../../test/fixtures/#{file_name}", __FILE__))
24
+ end
25
+ end
26
+
27
+ module Test::Unit::Assertions
28
+ def assert_false(test, failure_message = nil)
29
+ assert(!test, failure_message || "Expected <#{test}> to be <false>.")
30
+ end
31
+ end
metadata ADDED
@@ -0,0 +1,272 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: go_cd_feed
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Nikhil Mungel
8
+ - Ketan Padegaonkar
9
+ - Shishir Das
10
+ - Bill DePhillips
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2014-07-11 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: webmock
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: simplecov
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ - !ruby/object:Gem::Dependency
45
+ name: rake
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ - !ruby/object:Gem::Dependency
59
+ name: test-unit
60
+ requirement: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ - !ruby/object:Gem::Dependency
73
+ name: nokogiri
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ description: (Fork of go_api_client) This gem parses atom feed generated by the Go.CD
87
+ server and provides an OO representation of the pipelines and stages.
88
+ email:
89
+ - hyfather@gmail.com
90
+ - KetanPadegaonkar@gmail.com
91
+ - shishir.das@gmail.com
92
+ - bill.dephillips@gmail.com
93
+ executables:
94
+ - go_api_client
95
+ extensions: []
96
+ extra_rdoc_files: []
97
+ files:
98
+ - .gitignore
99
+ - .rvmrc
100
+ - .zeroci.yml
101
+ - Gemfile
102
+ - Gemfile.lock
103
+ - README.textile
104
+ - Rakefile
105
+ - bin/go_api_client
106
+ - go_api_client.gemspec
107
+ - lib/go_api_client.rb
108
+ - lib/go_api_client/atom.rb
109
+ - lib/go_api_client/atom/author.rb
110
+ - lib/go_api_client/atom/entry.rb
111
+ - lib/go_api_client/atom/feed.rb
112
+ - lib/go_api_client/atom/feed_page.rb
113
+ - lib/go_api_client/commit.rb
114
+ - lib/go_api_client/helpers.rb
115
+ - lib/go_api_client/helpers/simple_attribute_support.rb
116
+ - lib/go_api_client/http_fetcher.rb
117
+ - lib/go_api_client/job.rb
118
+ - lib/go_api_client/pipeline.rb
119
+ - lib/go_api_client/stage.rb
120
+ - lib/go_api_client/user.rb
121
+ - lib/go_api_client/version.rb
122
+ - ssh_keys/git-ci.zeroci.com
123
+ - ssh_keys/git-ci.zeroci.com.pub
124
+ - ssh_keys/git-ssh
125
+ - test/fixtures/building/job_1.xml
126
+ - test/fixtures/building/job_2.xml
127
+ - test/fixtures/building/job_3.xml
128
+ - test/fixtures/building/job_4.xml
129
+ - test/fixtures/building/pipeline_1.xml
130
+ - test/fixtures/building/pipeline_2.xml
131
+ - test/fixtures/building/pipeline_3.xml
132
+ - test/fixtures/building/stages.xml
133
+ - test/fixtures/building/stages_1.xml
134
+ - test/fixtures/building/stages_2.xml
135
+ - test/fixtures/building/stages_3.xml
136
+ - test/fixtures/building/stages_4.xml
137
+ - test/fixtures/job_1_console.log.txt
138
+ - test/fixtures/job_2_console.log.txt
139
+ - test/fixtures/jobs_1.xml
140
+ - test/fixtures/jobs_2.xml
141
+ - test/fixtures/jobs_with_no_properties.xml
142
+ - test/fixtures/ordering/go/api/jobs/1.xml
143
+ - test/fixtures/ordering/go/api/jobs/10.xml
144
+ - test/fixtures/ordering/go/api/jobs/2.xml
145
+ - test/fixtures/ordering/go/api/jobs/3.xml
146
+ - test/fixtures/ordering/go/api/jobs/4.xml
147
+ - test/fixtures/ordering/go/api/jobs/5.xml
148
+ - test/fixtures/ordering/go/api/jobs/6.xml
149
+ - test/fixtures/ordering/go/api/jobs/7.xml
150
+ - test/fixtures/ordering/go/api/jobs/8.xml
151
+ - test/fixtures/ordering/go/api/jobs/9.xml
152
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/1.xml
153
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/2.xml
154
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/3.xml
155
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/4.xml
156
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/5.xml
157
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/stages.xml
158
+ - test/fixtures/ordering/go/api/stages/1.xml
159
+ - test/fixtures/ordering/go/api/stages/10.xml
160
+ - test/fixtures/ordering/go/api/stages/2.xml
161
+ - test/fixtures/ordering/go/api/stages/3.xml
162
+ - test/fixtures/ordering/go/api/stages/4.xml
163
+ - test/fixtures/ordering/go/api/stages/5.xml
164
+ - test/fixtures/ordering/go/api/stages/6.xml
165
+ - test/fixtures/ordering/go/api/stages/7.xml
166
+ - test/fixtures/ordering/go/api/stages/8.xml
167
+ - test/fixtures/ordering/go/api/stages/9.xml
168
+ - test/fixtures/pagination/stages.xml
169
+ - test/fixtures/pagination/stages_before_7916973.xml
170
+ - test/fixtures/pagination/stages_before_7959831.xml
171
+ - test/fixtures/pipelines_1.xml
172
+ - test/fixtures/stages.xml
173
+ - test/fixtures/stages_1.xml
174
+ - test/fixtures/stages_2.xml
175
+ - test/fixtures/stages_empty.xml
176
+ - test/go_api_client/atom/author_test.rb
177
+ - test/go_api_client/atom/entry_test.rb
178
+ - test/go_api_client/atom/feed_page_test.rb
179
+ - test/go_api_client/atom/feed_test.rb
180
+ - test/go_api_client/building_test.rb
181
+ - test/go_api_client/commit_test.rb
182
+ - test/go_api_client/job_test.rb
183
+ - test/go_api_client/pipeline_test.rb
184
+ - test/go_api_client/stage_test.rb
185
+ - test/go_api_client/user_test.rb
186
+ - test/test_helper.rb
187
+ homepage: http://github.com/rearadmiral/go-api-client.git
188
+ licenses: []
189
+ metadata: {}
190
+ post_install_message:
191
+ rdoc_options: []
192
+ require_paths:
193
+ - lib
194
+ required_ruby_version: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - '>='
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ required_rubygems_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - '>='
202
+ - !ruby/object:Gem::Version
203
+ version: '0'
204
+ requirements: []
205
+ rubyforge_project: go_cd_feed
206
+ rubygems_version: 2.0.14
207
+ signing_key:
208
+ specification_version: 4
209
+ summary: Client to parse Go CI atom feed
210
+ test_files:
211
+ - test/fixtures/building/job_1.xml
212
+ - test/fixtures/building/job_2.xml
213
+ - test/fixtures/building/job_3.xml
214
+ - test/fixtures/building/job_4.xml
215
+ - test/fixtures/building/pipeline_1.xml
216
+ - test/fixtures/building/pipeline_2.xml
217
+ - test/fixtures/building/pipeline_3.xml
218
+ - test/fixtures/building/stages.xml
219
+ - test/fixtures/building/stages_1.xml
220
+ - test/fixtures/building/stages_2.xml
221
+ - test/fixtures/building/stages_3.xml
222
+ - test/fixtures/building/stages_4.xml
223
+ - test/fixtures/job_1_console.log.txt
224
+ - test/fixtures/job_2_console.log.txt
225
+ - test/fixtures/jobs_1.xml
226
+ - test/fixtures/jobs_2.xml
227
+ - test/fixtures/jobs_with_no_properties.xml
228
+ - test/fixtures/ordering/go/api/jobs/1.xml
229
+ - test/fixtures/ordering/go/api/jobs/10.xml
230
+ - test/fixtures/ordering/go/api/jobs/2.xml
231
+ - test/fixtures/ordering/go/api/jobs/3.xml
232
+ - test/fixtures/ordering/go/api/jobs/4.xml
233
+ - test/fixtures/ordering/go/api/jobs/5.xml
234
+ - test/fixtures/ordering/go/api/jobs/6.xml
235
+ - test/fixtures/ordering/go/api/jobs/7.xml
236
+ - test/fixtures/ordering/go/api/jobs/8.xml
237
+ - test/fixtures/ordering/go/api/jobs/9.xml
238
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/1.xml
239
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/2.xml
240
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/3.xml
241
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/4.xml
242
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/5.xml
243
+ - test/fixtures/ordering/go/api/pipelines/defaultPipeline/stages.xml
244
+ - test/fixtures/ordering/go/api/stages/1.xml
245
+ - test/fixtures/ordering/go/api/stages/10.xml
246
+ - test/fixtures/ordering/go/api/stages/2.xml
247
+ - test/fixtures/ordering/go/api/stages/3.xml
248
+ - test/fixtures/ordering/go/api/stages/4.xml
249
+ - test/fixtures/ordering/go/api/stages/5.xml
250
+ - test/fixtures/ordering/go/api/stages/6.xml
251
+ - test/fixtures/ordering/go/api/stages/7.xml
252
+ - test/fixtures/ordering/go/api/stages/8.xml
253
+ - test/fixtures/ordering/go/api/stages/9.xml
254
+ - test/fixtures/pagination/stages.xml
255
+ - test/fixtures/pagination/stages_before_7916973.xml
256
+ - test/fixtures/pagination/stages_before_7959831.xml
257
+ - test/fixtures/pipelines_1.xml
258
+ - test/fixtures/stages.xml
259
+ - test/fixtures/stages_1.xml
260
+ - test/fixtures/stages_2.xml
261
+ - test/fixtures/stages_empty.xml
262
+ - test/go_api_client/atom/author_test.rb
263
+ - test/go_api_client/atom/entry_test.rb
264
+ - test/go_api_client/atom/feed_page_test.rb
265
+ - test/go_api_client/atom/feed_test.rb
266
+ - test/go_api_client/building_test.rb
267
+ - test/go_api_client/commit_test.rb
268
+ - test/go_api_client/job_test.rb
269
+ - test/go_api_client/pipeline_test.rb
270
+ - test/go_api_client/stage_test.rb
271
+ - test/go_api_client/user_test.rb
272
+ - test/test_helper.rb