git_local 0.0.7 → 0.0.8

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: 1052d082820f442848e45f0a03f9494d0ead675f
4
- data.tar.gz: 36cf4e4b212aa6fac28e4378d9fc84f8aeaefa02
3
+ metadata.gz: dbda12a56bce862f7a3aa3db2e8a3c321117b49c
4
+ data.tar.gz: 283d7b31670a371b926a10dd1d29376c4b13ab1f
5
5
  SHA512:
6
- metadata.gz: c426481be677b222d81c9b58e9015876f0d555252636dacaccaee6dedfabbde552bd878b24194b7996e211ba17869de5f2bf9ab17e1f7049e2a15b2f01b90d24
7
- data.tar.gz: 8c7626addd880dcd3fc3c6483629076a168fb68c02dcdea9b129dd73f30ceb0f9b7cdd18b72332cba571b4b056b734ecb656555f535cf10e636aa4cf9cf09591
6
+ metadata.gz: 8eda22ed05ab8f70153aa8553c5f44ceed4b4e09783876063cc51efe65d4926a15dcff170173e077964c602fb41c928522d444f602c07c8e35fc418ad0bc0ac1
7
+ data.tar.gz: 0b99c6ae86427664bd126952d5c369cd8700f6cb5cae960f232452495e3e4a0bc67aaa54ac9af7cb8741db6c44532ba4eeda1f0fdc2c54b8073abdc0597d968a
@@ -6,12 +6,15 @@ module GitLocal
6
6
  class InvalidArgument < StandardError
7
7
  end
8
8
 
9
- def initialize(org:, repo:, branch:, local_directory:)
9
+ GITHUB_HOST = "github.com".freeze
10
+
11
+ def initialize(org:, repo:, branch:, local_directory:, host: GITHUB_HOST)
10
12
  check_for_special_characters(org, repo, branch, local_directory)
11
- @org = org
12
- @repo = repo
13
13
  @branch = branch
14
+ @host = host
14
15
  @local_directory = local_directory
16
+ @org = org
17
+ @repo = repo
15
18
  end
16
19
 
17
20
  def get
@@ -74,12 +77,12 @@ module GitLocal
74
77
 
75
78
  private
76
79
 
77
- attr_reader :org, :repo, :branch, :local_directory
80
+ attr_reader :branch, :host, :local_directory, :org, :repo
78
81
 
79
82
  def clone_and_checkout
80
83
  FileUtils.makedirs(repo_path) unless Dir.exist?(repo_path)
81
84
 
82
- popened_io = IO.popen("(cd #{repo_path} && git clone git@github.com:#{org_repo}.git --branch #{branch} --single-branch #{branch} && cd #{path}) 2>&1")
85
+ popened_io = IO.popen("(cd #{repo_path} && git clone git@#{host}:#{org_repo}.git --branch #{branch} --single-branch #{branch} && cd #{path}) 2>&1")
83
86
  out = popened_io.map(&:chomp) || []
84
87
  Process.wait(popened_io.pid)
85
88
 
@@ -1,3 +1,3 @@
1
1
  module GitLocal
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Galvanize Product
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.5.1
139
+ rubygems_version: 2.6.6
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: A lightweight git command line wrapper in Ruby