ghdeploy 0.1.4 → 0.1.5

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: 02552cb792eedd1c69ed5766afa376ac13e2cac6
4
- data.tar.gz: d6ced1f88a80b1af86bf8190e836ac1dbbebe940
3
+ metadata.gz: dadb9420430dcae2f0cc8133b3bb6bbb2edee6ec
4
+ data.tar.gz: 3b86db8ffafb3ff212c568d2fa7cbcf01b54dc02
5
5
  SHA512:
6
- metadata.gz: 9a035e9dde7941a2bc355307a1cb99e79caef25b551de78970d872071ccb11b9b3f31fc2851d3a005eacfc28f08abd1a2e44f02a572d01ab29ec689dda07ec40
7
- data.tar.gz: 49ff9359f712884f346dba045724a335e637ec8bacdcd3f70d66fba8daadee626fd7abf0d5b66b24526ece4b9916f36979acb8ab8de1fa39f3fde817135b6044
6
+ metadata.gz: a98a70e8bd44e37ab36f55e83f08820645de96551f46a795e0a20e75639467e6a637a532d3c293cf7f79f389d510eaf2a22cc0a04e1fc64bdff2c431a2690208
7
+ data.tar.gz: ba3242b91dfbffcc2045319663f250e308ee1955bf9c39065d1d7487783d18f61d00c9dd1bd508fe8a4c2cbcb01f3b2f4802a34c679070e55bc854b764079b81
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ghdeploy (0.1.3)
4
+ ghdeploy (0.1.4)
5
5
  git (~> 1.5)
6
6
  octokit (~> 4.0)
7
7
  thor (~> 0.20)
@@ -12,7 +12,7 @@ class RepoFactFinder
12
12
 
13
13
  def host
14
14
  return @host if @host
15
- url = Git.open('./').remotes.find { |r| r.name == remote_name }.url
15
+ url = remote.url
16
16
  if url.start_with?('http')
17
17
  matches = URL_PATTERN.match(url)
18
18
  @host = "#{matches[2]}://api.#{matches[3]}"
@@ -21,4 +21,20 @@ class RepoFactFinder
21
21
  @host = "https://api.#{host}"
22
22
  end
23
23
  end
24
+
25
+ def repo
26
+ return @repo if @repo
27
+ repo = url.split(/\/|:/).last(2).join('/')
28
+ @repo = repo.gsub(/(\.git)$/, '')
29
+ end
30
+
31
+ private
32
+
33
+ def url
34
+ remote.url
35
+ end
36
+
37
+ def remote
38
+ @remote ||= Git.open('./').remotes.find { |r| r.name == remote_name }
39
+ end
24
40
  end
@@ -1,3 +1,3 @@
1
1
  module Ghdeploy
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghdeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Joyce