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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzE0ZTY2Yjc1ZTI4MmU0N2VkMmZkNTQ3ODBlM2UzYWE5NjY3ZDhlOQ==
4
+ MDAyYWRhZmQ4YmE3ZTY5YWNlOTI0YWI1NjhiYTg3NWUxNWIyZjc0Zg==
5
5
  data.tar.gz: !binary |-
6
- OGY2ZDZjZTk3OTNiMDU2MDdkNjNiZTgwNDY3MjVkY2M5MzVjNjg2ZA==
6
+ NTlkZWEyMGYyMTMzZmUyNWNjY2FhMzg5NDU2ZTM0OTlmMmViYmJiYg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzI3MmM5ZjkyNGRkZDA1N2YwMGE5OThjZmE1MDBlN2E3MDVkM2Q0MjJjNWI1
10
- MWUzY2U5YTI4OTUyYWMzY2UzNjM2NTQxN2RmNDg0MTUzNWQ5M2NiMzc4M2I2
11
- YmE4YWZhODRiNjVkOGZjNzBjZmFkNWJjOTc1ODk0MDVkMTRiODU=
9
+ ZDRlMzdlOGJjYWU4ZGJiNjY5NTFjMzdhNTViYjZmZDlkNzBhODJjYzhhMDA3
10
+ NTI3NWMxZTJmNGQxNGFhMzUzOTRkNTY0ZGMxN2VkZmU4ZjIzOTJmMjRjN2Yx
11
+ NWY2ZDFjZDE5M2U3ZmFiNTJlNWFkYTQyZDY3NzVjNDk1ZGM3NWI=
12
12
  data.tar.gz: !binary |-
13
- Y2ZmNjhiZDllODY0NjZmM2E4NjM5ZGMwYWVjYWQxMmM2NmI0MmMwNDRkMjA0
14
- ODBhYzljNmJiZjBhZGE3ZGNkZGMyNTA5YTNmNzU0NWJmZjFlZGEwNmM5OTQ4
15
- YWU1MTJjZGJkZDIyODg2YjA1NzFlMWYxMzZmZjQ2OThmYTRmNjY=
13
+ OGJhNjcwNDk3Mjg2MjE4NWM0NzAyMGFiZWJlMzg3YzI0OWJjZTYxMDg3NTdk
14
+ YzQ3MzU3MjZlZWQwMzYxNWZjM2UwM2E2Zjg3MTYwZjJiOWRiNmJlMDhiOTkx
15
+ OWQ5Y2NiMWRmZDA2OTFhNDcyZWZkYmYyMTJhMGU2NjkzY2YyNzg=
@@ -1,11 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
3
  - 1.9.3
4
+ - 2.0.0
6
5
  - jruby
7
- - rbx-18mode
8
6
  - rbx-19mode
9
- - ruby-head
10
- - ree
11
- bundler_args: --without rcov
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "gitable"
4
- s.version = "0.3.0"
4
+ s.version = "0.3.1"
5
5
  s.authors = ["Martin Emde"]
6
6
  s.email = ["martin.emde@gmail.com"]
7
7
  s.homepage = "http://github.org/martinemde/gitable"
@@ -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
  ##
@@ -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.parse(other_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.
@@ -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 the same uri when passed a Gitable::URI" do
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
- expect(Gitable::URI.parse(gitable)).to eq(gitable)
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.0
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-19 00:00:00.000000000 Z
11
+ date: 2013-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable