gitable 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/gitable.gemspec CHANGED
@@ -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.2.0"
4
+ s.version = "0.2.1"
5
5
  s.authors = ["Martin Emde"]
6
6
  s.email = ["martin.emde@gmail.com"]
7
7
  s.homepage = "http://github.org/martinemde/gitable"
data/lib/gitable/uri.rb CHANGED
@@ -20,7 +20,6 @@ module Gitable
20
20
  add = super # >:( at inconsistency
21
21
 
22
22
  if Gitable::ScpURI.scp?(uri)
23
- # nil host is an Addressable misunderstanding (therefore it might be scp style)
24
23
  Gitable::ScpURI.parse(uri)
25
24
  else
26
25
  new(add.omit(:password,:query,:fragment).to_hash)
@@ -110,6 +109,13 @@ module Gitable
110
109
  ssh? || (!normalized_user.nil? && normalized_password.nil?)
111
110
  end
112
111
 
112
+ # Detect URIs that will require interactive authentication
113
+ #
114
+ # @return [Boolean] true if the URI has a user, but is not using ssh
115
+ def interactive_authenticated?
116
+ authenticated? && !ssh?
117
+ end
118
+
113
119
  # Set an extension name, replacing one if it exists.
114
120
  #
115
121
  # If there is no basename (i.e. no words in the path) this method call will
@@ -156,16 +162,5 @@ module Gitable
156
162
  end
157
163
  basename
158
164
  end
159
-
160
- protected
161
-
162
- def validate
163
- return if @validation_deferred
164
- super
165
-
166
- if normalized_user && normalized_scheme != 'ssh'
167
- raise InvalidURIError, "URIs with 'user@' other than ssh:// and scp-style are not supported."
168
- end
169
- end
170
165
  end
171
166
  end
data/spec/gitable_spec.rb CHANGED
@@ -94,7 +94,6 @@ describe Gitable::URI do
94
94
  [
95
95
  "http://", # nothing but scheme
96
96
  "blah:", # pretty much nothing
97
- "http://user@example.com/path.git", # unsupported http with user part
98
97
  "user@:path.git", # no host
99
98
  "user@host:", # no path
100
99
  ].each do |uri|
@@ -151,6 +150,7 @@ describe Gitable::URI do
151
150
  :local? => false,
152
151
  :ssh? => false,
153
152
  :authenticated? => false,
153
+ :interactive_authenticated? => false,
154
154
  :to_web_uri => Addressable::URI.parse("https://host.xz/path/to/repo"),
155
155
  }
156
156
 
@@ -202,6 +202,16 @@ describe Gitable::URI do
202
202
  })
203
203
  end
204
204
 
205
+ describe_uri "https://user@host.xz/path/to/repo.git/" do
206
+ it { subject.to_s.should == @uri }
207
+ it_sets expected.merge({
208
+ :scheme => "https",
209
+ :user => "user",
210
+ :interactive_authenticated? => true,
211
+ :authenticated? => true,
212
+ })
213
+ end
214
+
205
215
  describe_uri "https://host.xz:8888/path/to/repo.git/" do
206
216
  it { subject.to_s.should == @uri }
207
217
  it_sets expected.merge({
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Martin Emde
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-18 00:00:00 -08:00
18
+ date: 2011-02-22 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency