escobar 0.4.9 → 0.4.11

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be87f6f6e3ec1daf5962ec67f64c6f7dfa9008fa
4
- data.tar.gz: 8aaec2808c280aa2b1b6829efc93aaa8b1f95778
3
+ metadata.gz: 0a88b237a63fcf347b1be8a4d06be5696ecff363
4
+ data.tar.gz: 3e60168f02c1fa4840cbb5e83bda9657976a44ac
5
5
  SHA512:
6
- metadata.gz: 729e76c8511df2a846f426e3c5259690ea8176b8b4c635e46bd6b2d80896baaed97d858a07d20bd78cf953b5d11cd8ce6a9b78d4b9a4a12ee1d334382cd74568
7
- data.tar.gz: 48c521884a40c8a85f0604d2ac24f3ae197f52dcb80660fbc2bee81f3bdd1b4ba9323b148deb8d386c71e2bc156c2079b4163044033b80a1423134e4bed50f44
6
+ metadata.gz: ce7cae5bdfa7d53aa5fbf8e189d5db98d94871bd8dd683f739a7d35297e91ae9834bc009445f2f2bc2d365de48ce5ae5daa4f2a7b1160bb57abbee9f10ad967e
7
+ data.tar.gz: cd5f90d1a8bbce07db67fd3f582b2b1365204ed9bbbabf8135dee0b08ab1f1e09ed82917af015bac8552a9011ce02259abd716bae4e7c2db64abcf303ad0fc4f
@@ -1,5 +1,7 @@
1
1
  module Escobar
2
2
  module GitHub
3
+ REPOSITORY_REGEX = %r{https:\/\/api\.github\.com\/repos\/([-_\.0-9a-zA-Z]+\/[-_\.0-9a-zA-Z]+)} # rubocop:disable LineLength
4
+
3
5
  class RepoNotFound < StandardError; end
4
6
  # Top-level class for interacting with GitHub API
5
7
  class Client
@@ -39,12 +39,8 @@ module Escobar
39
39
  "https://dashboard.heroku.com/apps/#{app.name}/activity/builds/#{id}"
40
40
  end
41
41
 
42
- def repository_regex
43
- %r{https:\/\/api\.github\.com\/repos\/([-_\.0-9a-z]+\/[-_\.0-9a-z]+)}
44
- end
45
-
46
42
  def repository
47
- github_url && github_url.match(repository_regex)[1]
43
+ github_url && github_url.match(Escobar::GitHub::REPOSITORY_REGEX)[1]
48
44
  end
49
45
 
50
46
  def to_job_json
@@ -73,7 +73,8 @@ module Escobar
73
73
  resp = yield
74
74
  raise_on_status(resp)
75
75
  resp
76
- rescue Net::OpenTimeout, Faraday::TimeoutError => e
76
+ rescue Net::OpenTimeout, Faraday::TimeoutError,
77
+ Faraday::Error::ConnectionFailed => e
77
78
  raise Escobar::Client::TimeoutError.wrap(e)
78
79
  rescue Faraday::Error::ClientError => e
79
80
  raise Escobar::Client::HTTPError.from_error(e)
@@ -41,11 +41,7 @@ module Escobar
41
41
  end
42
42
 
43
43
  def repository
44
- github_url && github_url.match(repository_regex)[1]
45
- end
46
-
47
- def repository_regex
48
- %r{https:\/\/api\.github\.com\/repos\/([-_\.0-9a-z]+\/[-_\.0-9a-z]+)}
44
+ github_url && github_url.match(Escobar::GitHub::REPOSITORY_REGEX)[1]
49
45
  end
50
46
 
51
47
  def status
@@ -1,3 +1,3 @@
1
1
  module Escobar
2
- VERSION = "0.4.9".freeze
2
+ VERSION = "0.4.11".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escobar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Donohoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-04 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday