git-process 1.1.3 → 1.1.4
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.
- data/CHANGELOG.md +5 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +1 -0
- data/git-process.gemspec +1 -0
- data/lib/git-process/git_remote.rb +3 -1
- data/lib/git-process/version.rb +1 -1
- data/spec/git_remote_spec.rb +39 -0
- metadata +20 -4
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/git-process.gemspec
CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.add_dependency "json", "~> 1.7.3"
|
13
13
|
gem.add_dependency "trollop", "~> 1.16.2" # CLI options parser
|
14
14
|
gem.add_dependency "highline", "1.6.13" # user CLI interaction. There is a bug in 1.6.14
|
15
|
+
gem.add_dependency "addressable", "~> 2.3.4" # URI processing
|
15
16
|
|
16
17
|
gem.files = `git ls-files`.split($\).delete_if { |f| f =~ /^\./ }
|
17
18
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
@@ -11,6 +11,7 @@
|
|
11
11
|
# limitations under the License.
|
12
12
|
|
13
13
|
require 'git-process/git_config'
|
14
|
+
require 'addressable/uri'
|
14
15
|
#require 'git-process/git_branches'
|
15
16
|
#require 'git-process/git_status'
|
16
17
|
#require 'git-process/git_process_error'
|
@@ -80,7 +81,8 @@ module GitProc
|
|
80
81
|
unless @repo_name
|
81
82
|
url = config["remote.#{name}.url"]
|
82
83
|
raise GitProcessError.new("There is no #{name} url set up.") if url.nil? or url.empty?
|
83
|
-
|
84
|
+
uri = Addressable::URI.parse(url)
|
85
|
+
@repo_name = uri.path.sub(/\.git/, '').sub(/^\//, '')
|
84
86
|
end
|
85
87
|
@repo_name
|
86
88
|
end
|
data/lib/git-process/version.rb
CHANGED
data/spec/git_remote_spec.rb
CHANGED
@@ -84,6 +84,45 @@ describe GitRemote do
|
|
84
84
|
end
|
85
85
|
|
86
86
|
|
87
|
+
describe "#repo_name" do
|
88
|
+
include GitRepoHelper
|
89
|
+
|
90
|
+
it "should work for an ssh address" do
|
91
|
+
remote.add('torigin', 'tuser@github.myco.com:jdigger/git-process.git')
|
92
|
+
|
93
|
+
remote.repo_name.should == 'jdigger/git-process'
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
it 'should work for an http address' do
|
98
|
+
remote.add('torigin', 'http://github.myco.com:8080/jdigger/git-process.git')
|
99
|
+
|
100
|
+
remote.repo_name.should == 'jdigger/git-process'
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
it "should work for an https address" do
|
105
|
+
remote.add('torigin', 'https://github.myco.com/jdigger/git-process.git')
|
106
|
+
|
107
|
+
remote.repo_name.should == 'jdigger/git-process'
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
it "should work for an ssh-configured url address" do
|
112
|
+
remote.add('origin', 'mygithub:jdigger/git-process.git')
|
113
|
+
|
114
|
+
content = "\nHost mygithub\n"+
|
115
|
+
" User tuser\n"+
|
116
|
+
" HostName github.myco.com\n"
|
117
|
+
|
118
|
+
in_tempfile('ssh_config', content) do |file|
|
119
|
+
remote.repo_name.should == 'jdigger/git-process'
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
|
125
|
+
|
87
126
|
describe "#hostname_and_user_from_ssh_config" do
|
88
127
|
include GitRepoHelper
|
89
128
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-process
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 4
|
10
|
+
version: 1.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jim Moore
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-05-02 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: octokit
|
@@ -80,6 +80,22 @@ dependencies:
|
|
80
80
|
- 13
|
81
81
|
version: 1.6.13
|
82
82
|
requirement: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: addressable
|
85
|
+
prerelease: false
|
86
|
+
type: :runtime
|
87
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ~>
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 11
|
93
|
+
segments:
|
94
|
+
- 2
|
95
|
+
- 3
|
96
|
+
- 4
|
97
|
+
version: 2.3.4
|
98
|
+
requirement: *id005
|
83
99
|
description: A set of scripts to make working with git easier and more consistent
|
84
100
|
email:
|
85
101
|
- moore.jim@gmail.com
|