codeship 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +41 -0
  6. data/Rakefile +1 -0
  7. data/codeship.gemspec +26 -0
  8. data/lib/codeship/status.rb +39 -0
  9. data/lib/codeship/version.rb +3 -0
  10. data/lib/codeship.rb +5 -0
  11. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_branchnotfound.yml +54 -0
  12. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_error.yml +54 -0
  13. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_ignored.yml +54 -0
  14. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_projectnotfound.yml +54 -0
  15. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_success.yml +54 -0
  16. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_testing.yml +54 -0
  17. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_waiting.yml +54 -0
  18. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_branchnotfound.yml +54 -0
  19. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_error.yml +54 -0
  20. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_ignored.yml +54 -0
  21. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_projectnotfound.yml +54 -0
  22. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_success.yml +54 -0
  23. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_testing.yml +54 -0
  24. data/spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_waiting.yml +54 -0
  25. data/spec/spec_helper.rb +14 -0
  26. data/spec/status_spec.rb +22 -0
  27. metadata +155 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4c96abc691be0f401dd8528c406afe2ff99661a7
4
+ data.tar.gz: 769b3d638609809493e21c42bb7a88273d668c5a
5
+ SHA512:
6
+ metadata.gz: 7aa3d3e611fbb4915acdb23e6f342751e9695770256a3592085bc7c2e7a36eb6256a0561b0a9bc71bfcef8347592458807980176f5e7348633a14fa746a4c089
7
+ data.tar.gz: c01e116887936929259624d023b23dab5924e88ea980e1887b80852a09d232f2d8461105b5575ea746d46806b17db4d9707cb96e1628ea06aea3f3fb05f5abe8
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in codeship.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Codeship
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Codeship
2
+
3
+ interact with Codeship
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'codeship'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install codeship
18
+
19
+ ## Usage
20
+
21
+ ### Check the latest Build
22
+
23
+ project_status = Codeship::Status.new "my_project_uuid"
24
+ project_status.status #=> :success
25
+
26
+ ### Check the latest Build on a specific branch
27
+
28
+ project_status = Codeship::Status.new "my_project_uuid", branch: "development"
29
+ project_status.status #=> :error
30
+
31
+ ### States
32
+
33
+ :branchnotfound, :error, :ignored, :projectnotfound, :success, :testing, :waiting
34
+
35
+ ## Contributing
36
+
37
+ 1. Fork it
38
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
39
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
40
+ 4. Push to the branch (`git push origin my-new-feature`)
41
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/codeship.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'codeship/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "codeship"
8
+ spec.version = Codeship::VERSION
9
+ spec.authors = ["beanieboi"]
10
+ spec.email = ["ben@codeship.io"]
11
+ spec.description = %q{easily interact with Codeship.io}
12
+ spec.summary = %q{easily interact with Codeship.io}
13
+ spec.homepage = "https://www.codeship.io"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec", "~> 2.9"
24
+ spec.add_development_dependency "vcr", "~> 2.5"
25
+ spec.add_development_dependency "webmock"
26
+ end
@@ -0,0 +1,39 @@
1
+ require 'net/http'
2
+
3
+ module Codeship
4
+ class Status
5
+ STATES = [:branchnotfound, :error, :ignored, :projectnotfound,
6
+ :success, :testing, :waiting]
7
+
8
+ def initialize uuid, options = {}
9
+ @uuid = uuid
10
+ @branch = options.delete(:branch)
11
+ end
12
+
13
+ def status
14
+ image.scan(/status_(.*).png/).flatten.first.to_sym
15
+ end
16
+
17
+ private
18
+
19
+ def image
20
+ head['Content-Disposition'].split("\"").last
21
+ end
22
+
23
+ def head
24
+ @head ||= http_request.head project_url
25
+ end
26
+
27
+ def project_url
28
+ url = "/projects/#{@uuid}/status"
29
+ url << "?branch=#{@branch}" if @branch
30
+ url
31
+ end
32
+
33
+ def http_request
34
+ http = Net::HTTP.new "www.codeship.io", 443
35
+ http.use_ssl = true
36
+ http
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,3 @@
1
+ module Codeship
2
+ VERSION = "0.0.1"
3
+ end
data/lib/codeship.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "codeship/version"
2
+ require "codeship/status"
3
+
4
+ module Codeship
5
+ end
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/branchnotfound/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_branchnotfound.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:03:53 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - b8658e6a-dd42-409a-beb7-29ac635d2343
41
+ X-Runtime:
42
+ - '0.022480'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:03:53 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/error/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_error.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:03:54 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 2bc48c3d-0555-41e5-a9a2-8ca68e190ed7
41
+ X-Runtime:
42
+ - '0.025595'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:03:54 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/ignored/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_ignored.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:03:55 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 579f8b0e-eab9-475c-af41-08f37aa77169
41
+ X-Runtime:
42
+ - '0.026949'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:03:55 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/projectnotfound/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_projectnotfound.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:03:56 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 4d103741-689e-4ffc-8308-db09a0d03f51
41
+ X-Runtime:
42
+ - '0.021021'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:03:56 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/success/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_success.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:03:57 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - e0557e10-a4e8-4ab1-92ba-31cf050deb67
41
+ X-Runtime:
42
+ - '0.022914'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:03:57 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/testing/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_testing.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:03:58 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - d87a2adb-877a-4609-bd8f-e795804e3c1b
41
+ X-Runtime:
42
+ - '0.105671'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:03:58 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/waiting/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_waiting.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:03:59 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 369a0cdc-dbd0-478f-a976-16c641f9f35b
41
+ X-Runtime:
42
+ - '0.126971'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:03:59 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/branchnotfound/status?branch=master
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_branchnotfound.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:26:43 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 32a859d9-1cff-416b-a0db-ec33eae1541d
41
+ X-Runtime:
42
+ - '0.043327'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:26:43 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/error/status?branch=master
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_error.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:26:44 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 3115360b-b4ce-4b5a-bb0b-1394b502fa89
41
+ X-Runtime:
42
+ - '0.131432'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:26:44 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/ignored/status?branch=master
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_ignored.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:26:45 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - d4ac64a7-5d39-4926-848b-24830a356f8a
41
+ X-Runtime:
42
+ - '0.040278'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:26:45 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/projectnotfound/status?branch=master
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_projectnotfound.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:26:46 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 830b42b7-1d95-44a9-a7b0-4099f6ae99c8
41
+ X-Runtime:
42
+ - '0.028636'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:26:46 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/success/status?branch=master
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_success.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:26:47 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 816234d4-d3fc-4939-8850-f2627fb379f2
41
+ X-Runtime:
42
+ - '0.044395'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:26:48 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/testing/status?branch=master
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_testing.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:26:48 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - 115b3bf1-52c1-45b3-8d88-95f3ef60eb8a
41
+ X-Runtime:
42
+ - '0.307362'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:26:49 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: head
5
+ uri: https://www.codeship.io/projects/waiting/status?branch=master
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Disposition:
22
+ - inline; filename="status_waiting.png"
23
+ Content-Transfer-Encoding:
24
+ - binary
25
+ Content-Type:
26
+ - image/png
27
+ Date:
28
+ - Mon, 19 Aug 2013 21:26:49 GMT
29
+ Etag:
30
+ - '"4d19aacfee1ad8cc9d908df7383b0718"'
31
+ Status:
32
+ - 200 OK
33
+ Vary:
34
+ - Accept-Encoding
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Request-Id:
40
+ - ad65bf74-cf48-4551-a6ce-dfad6d6b24c7
41
+ X-Runtime:
42
+ - '0.046419'
43
+ X-Ua-Compatible:
44
+ - chrome=1
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Mon, 19 Aug 2013 21:26:50 GMT
54
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,14 @@
1
+ require 'codeship'
2
+ require 'vcr'
3
+
4
+ VCR.configure do |c|
5
+ c.cassette_library_dir = 'spec/fixtures/cassettes'
6
+ c.hook_into :webmock
7
+ c.configure_rspec_metadata!
8
+ end
9
+
10
+ RSpec.configure do |c|
11
+ # so we can use :vcr rather than :vcr => true;
12
+ # in RSpec 3 this will no longer be necessary.
13
+ c.treat_symbols_as_metadata_keys_with_true_values = true
14
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Codeship::Status do
4
+
5
+ context 'parsing the project status', :vcr do
6
+ Codeship::Status::STATES.each do |state|
7
+ it "should parse #{state}" do
8
+ project_status = Codeship::Status.new state
9
+ project_status.status.should == state
10
+ end
11
+ end
12
+ end
13
+
14
+ context 'parsing the project status on a certain branch', :vcr do
15
+ Codeship::Status::STATES.each do |state|
16
+ it "should parse #{state}" do
17
+ project_status = Codeship::Status.new state, branch: 'master'
18
+ project_status.status.should == state
19
+ end
20
+ end
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,155 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: codeship
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - beanieboi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '2.9'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.9'
55
+ - !ruby/object:Gem::Dependency
56
+ name: vcr
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.5'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '2.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: easily interact with Codeship.io
84
+ email:
85
+ - ben@codeship.io
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - .gitignore
91
+ - Gemfile
92
+ - LICENSE.txt
93
+ - README.md
94
+ - Rakefile
95
+ - codeship.gemspec
96
+ - lib/codeship.rb
97
+ - lib/codeship/status.rb
98
+ - lib/codeship/version.rb
99
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_branchnotfound.yml
100
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_error.yml
101
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_ignored.yml
102
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_projectnotfound.yml
103
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_success.yml
104
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_testing.yml
105
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_waiting.yml
106
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_branchnotfound.yml
107
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_error.yml
108
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_ignored.yml
109
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_projectnotfound.yml
110
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_success.yml
111
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_testing.yml
112
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_waiting.yml
113
+ - spec/spec_helper.rb
114
+ - spec/status_spec.rb
115
+ homepage: https://www.codeship.io
116
+ licenses:
117
+ - MIT
118
+ metadata: {}
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.0.2
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: easily interact with Codeship.io
139
+ test_files:
140
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_branchnotfound.yml
141
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_error.yml
142
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_ignored.yml
143
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_projectnotfound.yml
144
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_success.yml
145
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_testing.yml
146
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status/should_parse_waiting.yml
147
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_branchnotfound.yml
148
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_error.yml
149
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_ignored.yml
150
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_projectnotfound.yml
151
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_success.yml
152
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_testing.yml
153
+ - spec/fixtures/cassettes/Codeship_Status/parsing_the_project_status_on_a_certain_branch/should_parse_waiting.yml
154
+ - spec/spec_helper.rb
155
+ - spec/status_spec.rb