travis 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/README.md +786 -86
  2. data/Rakefile +3 -0
  3. data/lib/travis/cli/api_command.rb +22 -0
  4. data/lib/travis/cli/command.rb +36 -15
  5. data/lib/travis/cli/console.rb +13 -0
  6. data/lib/travis/cli/disable.rb +13 -0
  7. data/lib/travis/cli/enable.rb +29 -0
  8. data/lib/travis/cli/encrypt.rb +17 -4
  9. data/lib/travis/cli/history.rb +43 -0
  10. data/lib/travis/cli/logs.rb +18 -0
  11. data/lib/travis/cli/open.rb +36 -0
  12. data/lib/travis/cli/parser.rb +3 -3
  13. data/lib/travis/cli/repo_command.rb +16 -1
  14. data/lib/travis/cli/restart.rb +14 -0
  15. data/lib/travis/cli/show.rb +50 -0
  16. data/lib/travis/cli/status.rb +17 -0
  17. data/lib/travis/cli/sync.rb +28 -0
  18. data/lib/travis/cli/whatsup.rb +16 -0
  19. data/lib/travis/cli.rb +11 -0
  20. data/lib/travis/client/artifact.rb +25 -0
  21. data/lib/travis/client/build.rb +41 -0
  22. data/lib/travis/client/commit.rb +26 -0
  23. data/lib/travis/client/entity.rb +47 -3
  24. data/lib/travis/client/job.rb +52 -0
  25. data/lib/travis/client/methods.rb +22 -1
  26. data/lib/travis/client/repository.rb +70 -5
  27. data/lib/travis/client/session.rb +40 -8
  28. data/lib/travis/client/states.rb +85 -0
  29. data/lib/travis/client/user.rb +6 -0
  30. data/lib/travis/client.rb +5 -0
  31. data/lib/travis/tools/formatter.rb +38 -0
  32. data/lib/travis/version.rb +1 -1
  33. data/spec/cli/encrypt_spec.rb +16 -1
  34. data/spec/cli/history_spec.rb +28 -0
  35. data/spec/cli/logs_spec.rb +8 -0
  36. data/spec/cli/open_spec.rb +33 -0
  37. data/spec/cli/restart_spec.rb +15 -0
  38. data/spec/cli/show_spec.rb +9 -0
  39. data/spec/cli/status_spec.rb +28 -0
  40. data/spec/client/build_spec.rb +31 -0
  41. data/spec/client/commit_spec.rb +18 -0
  42. data/spec/client/job_spec.rb +30 -0
  43. data/spec/client/repository_spec.rb +15 -0
  44. data/spec/client/session_spec.rb +4 -0
  45. data/spec/spec_helper.rb +4 -1
  46. data/spec/support/fake_api.rb +616 -1
  47. data/travis.gemspec +37 -3
  48. metadata +66 -2
@@ -8,7 +8,8 @@ module Travis
8
8
  class Session
9
9
  class FakeAPI < Sinatra::Base
10
10
  disable :protection
11
- set(:rails_description, "Ruby on Rails")
11
+ enable :raise_errors
12
+ set :rails_description, "Ruby on Rails"
12
13
 
13
14
  before do
14
15
  content_type :json
@@ -32,6 +33,602 @@ module Travis
32
33
  "correct_scopes"=>true}}.to_json
33
34
  end
34
35
 
36
+ get '/jobs/4125097' do
37
+ {"job"=>
38
+ {"id"=>4125097,
39
+ "repository_id"=>891,
40
+ "repository_slug"=>"rails/rails",
41
+ "build_id"=>4125095,
42
+ "commit_id"=>1201631,
43
+ "log_id"=>3168319,
44
+ "number"=>"6180.2",
45
+ "config"=>
46
+ {"script"=>"ci/travis.rb",
47
+ "before_install"=>["gem install bundler"],
48
+ "rvm"=>"1.9.3",
49
+ "env"=>"GEM=ap,am,amo,as",
50
+ "notifications"=>
51
+ {"email"=>false,
52
+ "irc"=>
53
+ {"on_success"=>"change",
54
+ "on_failure"=>"always",
55
+ "channels"=>["irc.freenode.org#rails-contrib"]},
56
+ "campfire"=>
57
+ {"on_success"=>"change",
58
+ "on_failure"=>"always",
59
+ "rooms"=>
60
+ [{"secure"=>
61
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
62
+ "bundler_args"=>"--path vendor/bundle",
63
+ ".result"=>"configured"},
64
+ "state"=>"passed",
65
+ "started_at"=>"2013-01-13T15:55:59Z",
66
+ "finished_at"=>"2013-01-13T16:11:04Z",
67
+ "queue"=>"builds.rails",
68
+ "allow_failure"=>false,
69
+ "tags"=>""},
70
+ "commit"=>
71
+ {"id"=>1201631,
72
+ "sha"=>"a0265b98f16c6e33be32aa3f57231d1189302400",
73
+ "branch"=>"master",
74
+ "message"=>"Associaton -> Association",
75
+ "committed_at"=>"2013-01-13T15:43:24Z",
76
+ "author_name"=>"Steve Klabnik",
77
+ "author_email"=>"steve@steveklabnik.com",
78
+ "committer_name"=>"Steve Klabnik",
79
+ "committer_email"=>"steve@steveklabnik.com",
80
+ "compare_url"=>
81
+ "https://github.com/rails/rails/compare/6581d798e830...a0265b98f16c"}}.to_json
82
+ end
83
+
84
+ get '/builds/4125095' do
85
+ {"build"=>
86
+ {"id"=>4125095,
87
+ "repository_id"=>891,
88
+ "commit_id"=>1201631,
89
+ "number"=>"6180",
90
+ "pull_request"=>false,
91
+ "config"=>
92
+ {"script"=>"ci/travis.rb",
93
+ "before_install"=>["gem install bundler"],
94
+ "rvm"=>["1.9.3", "2.0.0"],
95
+ "env"=>
96
+ ["GEM=railties",
97
+ "GEM=ap,am,amo,as",
98
+ "GEM=ar:mysql",
99
+ "GEM=ar:mysql2",
100
+ "GEM=ar:sqlite3",
101
+ "GEM=ar:postgresql"],
102
+ "notifications"=>
103
+ {"email"=>false,
104
+ "irc"=>
105
+ {"on_success"=>"change",
106
+ "on_failure"=>"always",
107
+ "channels"=>["irc.freenode.org#rails-contrib"]},
108
+ "campfire"=>
109
+ {"on_success"=>"change",
110
+ "on_failure"=>"always",
111
+ "rooms"=>
112
+ [{"secure"=>
113
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
114
+ "bundler_args"=>"--path vendor/bundle",
115
+ ".result"=>"configured"},
116
+ "state"=>"failed",
117
+ "started_at"=>"2013-01-13T15:55:17Z",
118
+ "finished_at"=>nil,
119
+ "duration"=>5019,
120
+ "job_ids"=>
121
+ [4125096,
122
+ 4125097,
123
+ 4125098,
124
+ 4125099,
125
+ 4125100,
126
+ 4125101,
127
+ 4125102,
128
+ 4125103,
129
+ 4125104,
130
+ 4125105,
131
+ 4125106,
132
+ 4125107]},
133
+ "commit"=>
134
+ {"id"=>1201631,
135
+ "sha"=>"a0265b98f16c6e33be32aa3f57231d1189302400",
136
+ "branch"=>"master",
137
+ "message"=>"Associaton -> Association",
138
+ "committed_at"=>"2013-01-13T15:43:24Z",
139
+ "author_name"=>"Steve Klabnik",
140
+ "author_email"=>"steve@steveklabnik.com",
141
+ "committer_name"=>"Steve Klabnik",
142
+ "committer_email"=>"steve@steveklabnik.com",
143
+ "compare_url"=>
144
+ "https://github.com/rails/rails/compare/6581d798e830...a0265b98f16c"},
145
+ "jobs"=>
146
+ [{"id"=>4125096,
147
+ "repository_id"=>891,
148
+ "build_id"=>4125095,
149
+ "commit_id"=>1201631,
150
+ "log_id"=>3168318,
151
+ "state"=>"failed",
152
+ "number"=>"6180.1",
153
+ "config"=>
154
+ {"script"=>"ci/travis.rb",
155
+ "before_install"=>["gem install bundler"],
156
+ "rvm"=>"1.9.3",
157
+ "env"=>"GEM=railties",
158
+ "notifications"=>
159
+ {"email"=>false,
160
+ "irc"=>
161
+ {"on_success"=>"change",
162
+ "on_failure"=>"always",
163
+ "channels"=>["irc.freenode.org#rails-contrib"]},
164
+ "campfire"=>
165
+ {"on_success"=>"change",
166
+ "on_failure"=>"always",
167
+ "rooms"=>
168
+ [{"secure"=>
169
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
170
+ "bundler_args"=>"--path vendor/bundle",
171
+ ".result"=>"configured"},
172
+ "started_at"=>"2013-01-13T15:55:59Z",
173
+ "finished_at"=>"2013-01-13T16:10:15Z",
174
+ "queue"=>"builds.rails",
175
+ "allow_failure"=>false,
176
+ "tags"=>""},
177
+ {"id"=>4125097,
178
+ "repository_id"=>891,
179
+ "build_id"=>4125095,
180
+ "commit_id"=>1201631,
181
+ "log_id"=>3168319,
182
+ "state"=>"passed",
183
+ "number"=>"6180.2",
184
+ "config"=>
185
+ {"script"=>"ci/travis.rb",
186
+ "before_install"=>["gem install bundler"],
187
+ "rvm"=>"1.9.3",
188
+ "env"=>"GEM=ap,am,amo,as",
189
+ "notifications"=>
190
+ {"email"=>false,
191
+ "irc"=>
192
+ {"on_success"=>"change",
193
+ "on_failure"=>"always",
194
+ "channels"=>["irc.freenode.org#rails-contrib"]},
195
+ "campfire"=>
196
+ {"on_success"=>"change",
197
+ "on_failure"=>"always",
198
+ "rooms"=>
199
+ [{"secure"=>
200
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
201
+ "bundler_args"=>"--path vendor/bundle",
202
+ ".result"=>"configured"},
203
+ "started_at"=>"2013-01-13T15:55:59Z",
204
+ "finished_at"=>"2013-01-13T16:11:04Z",
205
+ "queue"=>"builds.rails",
206
+ "allow_failure"=>false,
207
+ "tags"=>""},
208
+ {"id"=>4125098,
209
+ "repository_id"=>891,
210
+ "build_id"=>4125095,
211
+ "commit_id"=>1201631,
212
+ "log_id"=>3168320,
213
+ "state"=>"passed",
214
+ "number"=>"6180.3",
215
+ "config"=>
216
+ {"script"=>"ci/travis.rb",
217
+ "before_install"=>["gem install bundler"],
218
+ "rvm"=>"1.9.3",
219
+ "env"=>"GEM=ar:mysql",
220
+ "notifications"=>
221
+ {"email"=>false,
222
+ "irc"=>
223
+ {"on_success"=>"change",
224
+ "on_failure"=>"always",
225
+ "channels"=>["irc.freenode.org#rails-contrib"]},
226
+ "campfire"=>
227
+ {"on_success"=>"change",
228
+ "on_failure"=>"always",
229
+ "rooms"=>
230
+ [{"secure"=>
231
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
232
+ "bundler_args"=>"--path vendor/bundle",
233
+ ".result"=>"configured"},
234
+ "started_at"=>"2013-01-13T15:55:59Z",
235
+ "finished_at"=>"2013-01-13T16:08:14Z",
236
+ "queue"=>"builds.rails",
237
+ "allow_failure"=>false,
238
+ "tags"=>""},
239
+ {"id"=>4125099,
240
+ "repository_id"=>891,
241
+ "build_id"=>4125095,
242
+ "commit_id"=>1201631,
243
+ "log_id"=>3168321,
244
+ "state"=>"passed",
245
+ "number"=>"6180.4",
246
+ "config"=>
247
+ {"script"=>"ci/travis.rb",
248
+ "before_install"=>["gem install bundler"],
249
+ "rvm"=>"1.9.3",
250
+ "env"=>"GEM=ar:mysql2",
251
+ "notifications"=>
252
+ {"email"=>false,
253
+ "irc"=>
254
+ {"on_success"=>"change",
255
+ "on_failure"=>"always",
256
+ "channels"=>["irc.freenode.org#rails-contrib"]},
257
+ "campfire"=>
258
+ {"on_success"=>"change",
259
+ "on_failure"=>"always",
260
+ "rooms"=>
261
+ [{"secure"=>
262
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
263
+ "bundler_args"=>"--path vendor/bundle",
264
+ ".result"=>"configured"},
265
+ "started_at"=>"2013-01-13T15:55:17Z",
266
+ "finished_at"=>"2013-01-13T16:06:15Z",
267
+ "queue"=>"builds.rails",
268
+ "allow_failure"=>false,
269
+ "tags"=>""},
270
+ {"id"=>4125100,
271
+ "repository_id"=>891,
272
+ "build_id"=>4125095,
273
+ "commit_id"=>1201631,
274
+ "log_id"=>3168322,
275
+ "state"=>"passed",
276
+ "number"=>"6180.5",
277
+ "config"=>
278
+ {"script"=>"ci/travis.rb",
279
+ "before_install"=>["gem install bundler"],
280
+ "rvm"=>"1.9.3",
281
+ "env"=>"GEM=ar:sqlite3",
282
+ "notifications"=>
283
+ {"email"=>false,
284
+ "irc"=>
285
+ {"on_success"=>"change",
286
+ "on_failure"=>"always",
287
+ "channels"=>["irc.freenode.org#rails-contrib"]},
288
+ "campfire"=>
289
+ {"on_success"=>"change",
290
+ "on_failure"=>"always",
291
+ "rooms"=>
292
+ [{"secure"=>
293
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
294
+ "bundler_args"=>"--path vendor/bundle",
295
+ ".result"=>"configured"},
296
+ "started_at"=>"2013-01-13T15:55:58Z",
297
+ "finished_at"=>"2013-01-13T16:08:07Z",
298
+ "queue"=>"builds.rails",
299
+ "allow_failure"=>false,
300
+ "tags"=>""},
301
+ {"id"=>4125101,
302
+ "repository_id"=>891,
303
+ "build_id"=>4125095,
304
+ "commit_id"=>1201631,
305
+ "log_id"=>3168323,
306
+ "state"=>"passed",
307
+ "number"=>"6180.6",
308
+ "config"=>
309
+ {"script"=>"ci/travis.rb",
310
+ "before_install"=>["gem install bundler"],
311
+ "rvm"=>"1.9.3",
312
+ "env"=>"GEM=ar:postgresql",
313
+ "notifications"=>
314
+ {"email"=>false,
315
+ "irc"=>
316
+ {"on_success"=>"change",
317
+ "on_failure"=>"always",
318
+ "channels"=>["irc.freenode.org#rails-contrib"]},
319
+ "campfire"=>
320
+ {"on_success"=>"change",
321
+ "on_failure"=>"always",
322
+ "rooms"=>
323
+ [{"secure"=>
324
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
325
+ "bundler_args"=>"--path vendor/bundle",
326
+ ".result"=>"configured"},
327
+ "started_at"=>"2013-01-13T15:55:28Z",
328
+ "finished_at"=>"2013-01-13T16:08:41Z",
329
+ "queue"=>"builds.rails",
330
+ "allow_failure"=>false,
331
+ "tags"=>""},
332
+ {"id"=>4125102,
333
+ "repository_id"=>891,
334
+ "build_id"=>4125095,
335
+ "commit_id"=>1201631,
336
+ "log_id"=>3168324,
337
+ "state"=>"failed",
338
+ "number"=>"6180.7",
339
+ "config"=>
340
+ {"script"=>"ci/travis.rb",
341
+ "before_install"=>["gem install bundler"],
342
+ "rvm"=>"2.0.0",
343
+ "env"=>"GEM=railties",
344
+ "notifications"=>
345
+ {"email"=>false,
346
+ "irc"=>
347
+ {"on_success"=>"change",
348
+ "on_failure"=>"always",
349
+ "channels"=>["irc.freenode.org#rails-contrib"]},
350
+ "campfire"=>
351
+ {"on_success"=>"change",
352
+ "on_failure"=>"always",
353
+ "rooms"=>
354
+ [{"secure"=>
355
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
356
+ "bundler_args"=>"--path vendor/bundle",
357
+ ".result"=>"configured"},
358
+ "started_at"=>"2013-01-13T15:55:17Z",
359
+ "finished_at"=>"2013-01-13T15:56:16Z",
360
+ "queue"=>"builds.rails",
361
+ "allow_failure"=>false,
362
+ "tags"=>""},
363
+ {"id"=>4125103,
364
+ "repository_id"=>891,
365
+ "build_id"=>4125095,
366
+ "commit_id"=>1201631,
367
+ "log_id"=>3168325,
368
+ "state"=>"failed",
369
+ "number"=>"6180.8",
370
+ "config"=>
371
+ {"script"=>"ci/travis.rb",
372
+ "before_install"=>["gem install bundler"],
373
+ "rvm"=>"2.0.0",
374
+ "env"=>"GEM=ap,am,amo,as",
375
+ "notifications"=>
376
+ {"email"=>false,
377
+ "irc"=>
378
+ {"on_success"=>"change",
379
+ "on_failure"=>"always",
380
+ "channels"=>["irc.freenode.org#rails-contrib"]},
381
+ "campfire"=>
382
+ {"on_success"=>"change",
383
+ "on_failure"=>"always",
384
+ "rooms"=>
385
+ [{"secure"=>
386
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
387
+ "bundler_args"=>"--path vendor/bundle",
388
+ ".result"=>"configured"},
389
+ "started_at"=>"2013-01-13T15:55:58Z",
390
+ "finished_at"=>"2013-01-13T15:56:57Z",
391
+ "queue"=>"builds.rails",
392
+ "allow_failure"=>false,
393
+ "tags"=>""},
394
+ {"id"=>4125104,
395
+ "repository_id"=>891,
396
+ "build_id"=>4125095,
397
+ "commit_id"=>1201631,
398
+ "log_id"=>3168326,
399
+ "state"=>"failed",
400
+ "number"=>"6180.9",
401
+ "config"=>
402
+ {"script"=>"ci/travis.rb",
403
+ "before_install"=>["gem install bundler"],
404
+ "rvm"=>"2.0.0",
405
+ "env"=>"GEM=ar:mysql",
406
+ "notifications"=>
407
+ {"email"=>false,
408
+ "irc"=>
409
+ {"on_success"=>"change",
410
+ "on_failure"=>"always",
411
+ "channels"=>["irc.freenode.org#rails-contrib"]},
412
+ "campfire"=>
413
+ {"on_success"=>"change",
414
+ "on_failure"=>"always",
415
+ "rooms"=>
416
+ [{"secure"=>
417
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
418
+ "bundler_args"=>"--path vendor/bundle",
419
+ ".result"=>"configured"},
420
+ "started_at"=>"2013-01-13T15:55:18Z",
421
+ "finished_at"=>"2013-01-13T15:56:16Z",
422
+ "queue"=>"builds.rails",
423
+ "allow_failure"=>false,
424
+ "tags"=>""},
425
+ {"id"=>4125105,
426
+ "repository_id"=>891,
427
+ "build_id"=>4125095,
428
+ "commit_id"=>1201631,
429
+ "log_id"=>3168327,
430
+ "state"=>"failed",
431
+ "number"=>"6180.10",
432
+ "config"=>
433
+ {"script"=>"ci/travis.rb",
434
+ "before_install"=>["gem install bundler"],
435
+ "rvm"=>"2.0.0",
436
+ "env"=>"GEM=ar:mysql2",
437
+ "notifications"=>
438
+ {"email"=>false,
439
+ "irc"=>
440
+ {"on_success"=>"change",
441
+ "on_failure"=>"always",
442
+ "channels"=>["irc.freenode.org#rails-contrib"]},
443
+ "campfire"=>
444
+ {"on_success"=>"change",
445
+ "on_failure"=>"always",
446
+ "rooms"=>
447
+ [{"secure"=>
448
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
449
+ "bundler_args"=>"--path vendor/bundle",
450
+ ".result"=>"configured"},
451
+ "started_at"=>"2013-01-13T15:55:27Z",
452
+ "finished_at"=>"2013-01-13T15:56:23Z",
453
+ "queue"=>"builds.rails",
454
+ "allow_failure"=>false,
455
+ "tags"=>""},
456
+ {"id"=>4125106,
457
+ "repository_id"=>891,
458
+ "build_id"=>4125095,
459
+ "commit_id"=>1201631,
460
+ "log_id"=>3168328,
461
+ "state"=>"failed",
462
+ "number"=>"6180.11",
463
+ "config"=>
464
+ {"script"=>"ci/travis.rb",
465
+ "before_install"=>["gem install bundler"],
466
+ "rvm"=>"2.0.0",
467
+ "env"=>"GEM=ar:sqlite3",
468
+ "notifications"=>
469
+ {"email"=>false,
470
+ "irc"=>
471
+ {"on_success"=>"change",
472
+ "on_failure"=>"always",
473
+ "channels"=>["irc.freenode.org#rails-contrib"]},
474
+ "campfire"=>
475
+ {"on_success"=>"change",
476
+ "on_failure"=>"always",
477
+ "rooms"=>
478
+ [{"secure"=>
479
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
480
+ "bundler_args"=>"--path vendor/bundle",
481
+ ".result"=>"configured"},
482
+ "started_at"=>"2013-01-13T15:56:47Z",
483
+ "finished_at"=>"2013-01-13T15:57:43Z",
484
+ "queue"=>"builds.rails",
485
+ "allow_failure"=>false,
486
+ "tags"=>""},
487
+ {"id"=>4125107,
488
+ "repository_id"=>891,
489
+ "build_id"=>4125095,
490
+ "commit_id"=>1201631,
491
+ "log_id"=>3168329,
492
+ "state"=>"failed",
493
+ "number"=>"6180.12",
494
+ "config"=>
495
+ {"script"=>"ci/travis.rb",
496
+ "before_install"=>["gem install bundler"],
497
+ "rvm"=>"2.0.0",
498
+ "env"=>"GEM=ar:postgresql",
499
+ "notifications"=>
500
+ {"email"=>false,
501
+ "irc"=>
502
+ {"on_success"=>"change",
503
+ "on_failure"=>"always",
504
+ "channels"=>["irc.freenode.org#rails-contrib"]},
505
+ "campfire"=>
506
+ {"on_success"=>"change",
507
+ "on_failure"=>"always",
508
+ "rooms"=>
509
+ [{"secure"=>
510
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
511
+ "bundler_args"=>"--path vendor/bundle",
512
+ ".result"=>"configured"},
513
+ "started_at"=>"2013-01-13T15:56:54Z",
514
+ "finished_at"=>"2013-01-13T15:57:49Z",
515
+ "queue"=>"builds.rails",
516
+ "allow_failure"=>false,
517
+ "tags"=>""}]}.to_json
518
+ end
519
+
520
+ get '/builds/' do
521
+ return {"builds"=>[]}.to_json if params[:after_number]
522
+ {"builds"=>
523
+ [{"id"=>4125095,
524
+ "repository_id"=>891,
525
+ "commit_id"=>1201631,
526
+ "number"=>"6180",
527
+ "pull_request"=>false,
528
+ "config"=>
529
+ {"script"=>"ci/travis.rb",
530
+ "before_install"=>["gem install bundler"],
531
+ "rvm"=>["1.9.3", "2.0.0"],
532
+ "env"=>
533
+ ["GEM=railties",
534
+ "GEM=ap,am,amo,as",
535
+ "GEM=ar:mysql",
536
+ "GEM=ar:mysql2",
537
+ "GEM=ar:sqlite3",
538
+ "GEM=ar:postgresql"],
539
+ "notifications"=>
540
+ {"email"=>false,
541
+ "irc"=>
542
+ {"on_success"=>"change",
543
+ "on_failure"=>"always",
544
+ "channels"=>["irc.freenode.org#rails-contrib"]},
545
+ "campfire"=>
546
+ {"on_success"=>"change",
547
+ "on_failure"=>"always",
548
+ "rooms"=>
549
+ [{"secure"=>
550
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
551
+ "bundler_args"=>"--path vendor/bundle",
552
+ ".result"=>"configured"},
553
+ "state"=>"failed",
554
+ "started_at"=>"2013-01-13T15:55:17Z",
555
+ "finished_at"=>nil,
556
+ "duration"=>5019,
557
+ "job_ids"=>
558
+ [4125096,
559
+ 4125097,
560
+ 4125098,
561
+ 4125099,
562
+ 4125100,
563
+ 4125101,
564
+ 4125102,
565
+ 4125103,
566
+ 4125104,
567
+ 4125105,
568
+ 4125106,
569
+ 4125107]}],
570
+ "commits"=>
571
+ [{"id"=>1201631,
572
+ "sha"=>"a0265b98f16c6e33be32aa3f57231d1189302400",
573
+ "branch"=>"master",
574
+ "message"=>"Associaton -> Association",
575
+ "committed_at"=>"2013-01-13T15:43:24Z",
576
+ "author_name"=>"Steve Klabnik",
577
+ "author_email"=>"steve@steveklabnik.com",
578
+ "committer_name"=>"Steve Klabnik",
579
+ "committer_email"=>"steve@steveklabnik.com",
580
+ "compare_url"=>
581
+ "https://github.com/rails/rails/compare/6581d798e830...a0265b98f16c"}]}.to_json
582
+ end
583
+
584
+ get '/jobs/4125096' do
585
+ {"job"=>
586
+ {"id"=>4125096,
587
+ "repository_id"=>891,
588
+ "repository_slug"=>"rails/rails",
589
+ "build_id"=>4125095,
590
+ "commit_id"=>1201631,
591
+ "log_id"=>3168318,
592
+ "number"=>"6180.1",
593
+ "config"=>
594
+ {"script"=>"ci/travis.rb",
595
+ "before_install"=>["gem install bundler"],
596
+ "rvm"=>"1.9.3",
597
+ "env"=>"GEM=railties",
598
+ "notifications"=>
599
+ {"email"=>false,
600
+ "irc"=>
601
+ {"on_success"=>"change",
602
+ "on_failure"=>"always",
603
+ "channels"=>["irc.freenode.org#rails-contrib"]},
604
+ "campfire"=>
605
+ {"on_success"=>"change",
606
+ "on_failure"=>"always",
607
+ "rooms"=>
608
+ [{"secure"=>
609
+ "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="}]}},
610
+ "bundler_args"=>"--path vendor/bundle",
611
+ ".result"=>"configured"},
612
+ "state"=>"failed",
613
+ "started_at"=>"2013-01-13T15:55:59Z",
614
+ "finished_at"=>"2013-01-13T16:10:15Z",
615
+ "queue"=>"builds.rails",
616
+ "allow_failure"=>false,
617
+ "tags"=>""},
618
+ "commit"=>
619
+ {"id"=>1201631,
620
+ "sha"=>"a0265b98f16c6e33be32aa3f57231d1189302400",
621
+ "branch"=>"master",
622
+ "message"=>"Associaton -> Association",
623
+ "committed_at"=>"2013-01-13T15:43:24Z",
624
+ "author_name"=>"Steve Klabnik",
625
+ "author_email"=>"steve@steveklabnik.com",
626
+ "committer_name"=>"Steve Klabnik",
627
+ "committer_email"=>"steve@steveklabnik.com",
628
+ "compare_url"=>
629
+ "https://github.com/rails/rails/compare/6581d798e830...a0265b98f16c"}}.to_json
630
+ end
631
+
35
632
  get '/repos/' do
36
633
  {"repos"=>
37
634
  [{"id"=>107495,
@@ -46,6 +643,19 @@ module Travis
46
643
  "last_build_finished_at"=>"2013-01-13T16:55:08Z"}]}.to_json
47
644
  end
48
645
 
646
+ get '/config' do
647
+ {"config" => {"host" => "travis-ci.org"}}.to_json
648
+ end
649
+
650
+ get '/artifacts/3168318' do
651
+ {"artifact"=>
652
+ {"id"=>3168318,
653
+ "job_id"=>4125096,
654
+ "type"=>"Log",
655
+ "body"=>
656
+ "$ export GEM=railties\n"}}.to_json
657
+ end
658
+
49
659
  get '/repos/travis-ci/travis' do
50
660
  # hack hack
51
661
  request.path_info = '/repos/rails/rails'
@@ -75,6 +685,11 @@ module Travis
75
685
  {"key"=>RAILS_KEY}.to_json
76
686
  end
77
687
 
688
+ post '/requests' do
689
+ $params = params
690
+ "{}"
691
+ end
692
+
78
693
  post '/auth/github' do
79
694
  halt(403) unless params[:github_token] == 'github_token'
80
695
  { 'access_token' => 'token' }.to_json