gitable 0.1.1 → 0.1.2

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/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.1.1"
4
+ s.version = "0.1.2"
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
@@ -80,6 +80,10 @@ module Gitable
80
80
  !!(normalized_scheme =~ /ssh/)
81
81
  end
82
82
 
83
+ def authenticated?
84
+ ssh? || (user && password.nil?)
85
+ end
86
+
83
87
  # Set an extension name, replacing one if it exists.
84
88
  #
85
89
  # If there is no basename (i.e. no words in the path) this method call will
data/spec/gitable_spec.rb CHANGED
@@ -89,7 +89,6 @@ describe Gitable::URI do
89
89
  [
90
90
  "http://",
91
91
  "blah:",
92
- "git://user@are.not/allowed/on/normal/uris.git" # if I'm reading the docs correctly
93
92
  ].each do |uri|
94
93
  it "raises an Gitable::URI::InvalidURIError with #{uri.inspect}" do
95
94
  lambda {
@@ -111,6 +110,7 @@ describe Gitable::URI do
111
110
  :project_name => "repo",
112
111
  :local? => false,
113
112
  :ssh? => false,
113
+ :authenticated? => false,
114
114
  }
115
115
 
116
116
  describe_uri "rsync://host.xz/path/to/repo.git/" do
@@ -159,6 +159,15 @@ describe Gitable::URI do
159
159
  })
160
160
  end
161
161
 
162
+ describe_uri "https://user@host.xz/path/to/repo.git/" do
163
+ it { subject.to_s.should == @uri }
164
+ it_sets expected.merge({
165
+ :user => "user",
166
+ :scheme => "https",
167
+ :authenticated? => true,
168
+ })
169
+ end
170
+
162
171
  describe_uri "https://host.xz:8888/path/to/repo.git/" do
163
172
  it { subject.to_s.should == @uri }
164
173
  it_sets expected.merge({
@@ -212,6 +221,7 @@ describe Gitable::URI do
212
221
  it_sets expected.merge({
213
222
  :scheme => "ssh",
214
223
  :ssh? => true,
224
+ :authenticated? => true,
215
225
  })
216
226
  end
217
227
 
@@ -221,6 +231,7 @@ describe Gitable::URI do
221
231
  :scheme => "ssh",
222
232
  :user => "user",
223
233
  :ssh? => true,
234
+ :authenticated? => true,
224
235
  })
225
236
  end
226
237
 
@@ -229,6 +240,7 @@ describe Gitable::URI do
229
240
  it_sets expected.merge({
230
241
  :scheme => "ssh",
231
242
  :ssh? => true,
243
+ :authenticated? => true,
232
244
  })
233
245
  end
234
246
 
@@ -238,6 +250,7 @@ describe Gitable::URI do
238
250
  :scheme => "ssh",
239
251
  :port => 8888,
240
252
  :ssh? => true,
253
+ :authenticated? => true,
241
254
  })
242
255
  end
243
256
 
@@ -247,6 +260,7 @@ describe Gitable::URI do
247
260
  :user => "user",
248
261
  :scheme => "ssh",
249
262
  :ssh? => true,
263
+ :authenticated? => true,
250
264
  })
251
265
  end
252
266
 
@@ -257,6 +271,7 @@ describe Gitable::URI do
257
271
  :user => "user",
258
272
  :port => 8888,
259
273
  :ssh? => true,
274
+ :authenticated? => true,
260
275
  })
261
276
  end
262
277
 
@@ -267,6 +282,7 @@ describe Gitable::URI do
267
282
  :user => nil,
268
283
  :path => "/~user/path/to/repo.git/",
269
284
  :ssh? => true,
285
+ :authenticated? => true,
270
286
  })
271
287
  end
272
288
 
@@ -277,6 +293,7 @@ describe Gitable::URI do
277
293
  :user => "user",
278
294
  :path => "/~user/path/to/repo.git/",
279
295
  :ssh? => true,
296
+ :authenticated? => true,
280
297
  })
281
298
  end
282
299
 
@@ -286,6 +303,7 @@ describe Gitable::URI do
286
303
  :scheme => "ssh",
287
304
  :path => "/~/path/to/repo.git",
288
305
  :ssh? => true,
306
+ :authenticated? => true,
289
307
  })
290
308
  end
291
309
 
@@ -296,6 +314,7 @@ describe Gitable::URI do
296
314
  :user => "user",
297
315
  :path => "/~/path/to/repo.git",
298
316
  :ssh? => true,
317
+ :authenticated? => true,
299
318
  })
300
319
  end
301
320
 
@@ -307,6 +326,7 @@ describe Gitable::URI do
307
326
  :user => nil,
308
327
  :path => "/path/to/repo.git/",
309
328
  :ssh? => true,
329
+ :authenticated? => true,
310
330
  })
311
331
  end
312
332
 
@@ -318,6 +338,7 @@ describe Gitable::URI do
318
338
  :user => "user",
319
339
  :path => "/path/to/repo.git/",
320
340
  :ssh? => true,
341
+ :authenticated? => true,
321
342
  })
322
343
  end
323
344
 
@@ -329,6 +350,7 @@ describe Gitable::URI do
329
350
  :user => nil,
330
351
  :path => "~user/path/to/repo.git/",
331
352
  :ssh? => true,
353
+ :authenticated? => true,
332
354
  })
333
355
  end
334
356
 
@@ -340,6 +362,7 @@ describe Gitable::URI do
340
362
  :user => "user",
341
363
  :path => "~user/path/to/repo.git/",
342
364
  :ssh? => true,
365
+ :authenticated? => true,
343
366
  })
344
367
  end
345
368
 
@@ -351,6 +374,7 @@ describe Gitable::URI do
351
374
  :user => nil,
352
375
  :path => "path/to/repo.git",
353
376
  :ssh? => true,
377
+ :authenticated? => true,
354
378
  })
355
379
  end
356
380
 
@@ -362,6 +386,7 @@ describe Gitable::URI do
362
386
  :user => "user",
363
387
  :path => "path/to/repo.git",
364
388
  :ssh? => true,
389
+ :authenticated? => true,
365
390
  })
366
391
  end
367
392
 
@@ -397,6 +422,7 @@ describe Gitable::URI do
397
422
  :fragment => nil,
398
423
  :basename => "gitable.git",
399
424
  :ssh? => true,
425
+ :authenticated? => true,
400
426
  })
401
427
  end
402
428
 
@@ -442,6 +468,7 @@ describe Gitable::URI do
442
468
  :basename => "gitable.git",
443
469
  :project_name => "gitable",
444
470
  :ssh? => true,
471
+ :authenticated? => true,
445
472
  })
446
473
  end
447
474
  end
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: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
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: 2010-12-05 00:00:00 -08:00
18
+ date: 2010-12-06 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency