gitable 0.3.0 → 0.3.1
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 +8 -8
- data/.travis.yml +1 -6
- data/gitable.gemspec +1 -1
- data/lib/gitable/scp_uri.rb +1 -1
- data/lib/gitable/uri.rb +2 -3
- data/spec/gitable_spec.rb +22 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDAyYWRhZmQ4YmE3ZTY5YWNlOTI0YWI1NjhiYTg3NWUxNWIyZjc0Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTlkZWEyMGYyMTMzZmUyNWNjY2FhMzg5NDU2ZTM0OTlmMmViYmJiYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDRlMzdlOGJjYWU4ZGJiNjY5NTFjMzdhNTViYjZmZDlkNzBhODJjYzhhMDA3
|
10
|
+
NTI3NWMxZTJmNGQxNGFhMzUzOTRkNTY0ZGMxN2VkZmU4ZjIzOTJmMjRjN2Yx
|
11
|
+
NWY2ZDFjZDE5M2U3ZmFiNTJlNWFkYTQyZDY3NzVjNDk1ZGM3NWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGJhNjcwNDk3Mjg2MjE4NWM0NzAyMGFiZWJlMzg3YzI0OWJjZTYxMDg3NTdk
|
14
|
+
YzQ3MzU3MjZlZWQwMzYxNWZjM2UwM2E2Zjg3MTYwZjJiOWRiNmJlMDhiOTkx
|
15
|
+
OWQ5Y2NiMWRmZDA2OTFhNDcyZWZkYmYyMTJhMGU2NjkzY2YyNzg=
|
data/.travis.yml
CHANGED
data/gitable.gemspec
CHANGED
data/lib/gitable/scp_uri.rb
CHANGED
@@ -8,7 +8,7 @@ module Gitable
|
|
8
8
|
# Deprecated: This serves no purpose. You might as well just parse the URI.
|
9
9
|
def self.scp?(uri)
|
10
10
|
$stderr.puts "DEPRECATED: Gitable::ScpURI.scp?. You're better off parsing the URI and checking #scp?."
|
11
|
-
parse(uri).scp?
|
11
|
+
Gitable::URI.parse(uri).scp?
|
12
12
|
end
|
13
13
|
|
14
14
|
##
|
data/lib/gitable/uri.rb
CHANGED
@@ -184,7 +184,8 @@ module Gitable
|
|
184
184
|
#
|
185
185
|
# @return [Boolean] true if the URI probably indicates the same repository.
|
186
186
|
def equivalent?(other_uri)
|
187
|
-
other = Gitable::URI.
|
187
|
+
other = Gitable::URI.parse_when_valid(other_uri)
|
188
|
+
return false unless other
|
188
189
|
|
189
190
|
same_host = normalized_host.to_s == other.normalized_host.to_s
|
190
191
|
|
@@ -199,8 +200,6 @@ module Gitable
|
|
199
200
|
# if the path is absolute, we can assume it's the same for all users (so the user doesn't have to match).
|
200
201
|
same_host && same_path && (path =~ %r#^/# || same_user)
|
201
202
|
end
|
202
|
-
rescue Gitable::URI::InvalidURIError
|
203
|
-
false
|
204
203
|
end
|
205
204
|
|
206
205
|
# Dun da dun da dun, Inspector Gadget.
|
data/spec/gitable_spec.rb
CHANGED
@@ -79,9 +79,25 @@ describe Gitable::URI do
|
|
79
79
|
expect(Gitable::URI.parse(nil)).to be_nil
|
80
80
|
end
|
81
81
|
|
82
|
-
it "returns
|
82
|
+
it "returns a Gitable::URI when passed a URI" do
|
83
|
+
stdlib_uri = URI.parse(@uri)
|
84
|
+
gitable = Gitable::URI.parse(stdlib_uri)
|
85
|
+
expect(gitable).to be_a_kind_of(Gitable::URI)
|
86
|
+
expect(gitable.to_s).to eq(stdlib_uri.to_s)
|
87
|
+
end
|
88
|
+
|
89
|
+
it "returns a Gitable::URI when passed an Addressable::URI" do
|
90
|
+
addr_uri = Addressable::URI.parse(@uri)
|
91
|
+
gitable = Gitable::URI.parse(addr_uri)
|
92
|
+
expect(gitable).to be_a_kind_of(Gitable::URI)
|
93
|
+
expect(gitable.to_s).to eq(addr_uri.to_s)
|
94
|
+
end
|
95
|
+
|
96
|
+
it "returns a duplicate of the uri when passed a Gitable::URI" do
|
83
97
|
gitable = Gitable::URI.parse(@uri)
|
84
|
-
|
98
|
+
parsed = Gitable::URI.parse(gitable)
|
99
|
+
expect(parsed).to eq(gitable)
|
100
|
+
expect(parsed).to_not eq(gitable.object_id)
|
85
101
|
end
|
86
102
|
|
87
103
|
it "raises a TypeError on bad type" do
|
@@ -111,6 +127,10 @@ describe Gitable::URI do
|
|
111
127
|
it "returns nil on parse_when_valid" do
|
112
128
|
expect(Gitable::URI.parse_when_valid(uri)).to be_nil
|
113
129
|
end
|
130
|
+
|
131
|
+
it "is not equivalent to a bad uri" do
|
132
|
+
expect(Gitable::URI.parse('git://github.com/martinemde/gitable.git')).to_not be_equivalent(uri)
|
133
|
+
end
|
114
134
|
end
|
115
135
|
end
|
116
136
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Emde
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|