git-hub 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -103,7 +103,6 @@ task :publish => "gem:publish" do
103
103
  system "git tag v#{Hub::Version}"
104
104
  sh "git push origin v#{Hub::Version}"
105
105
  sh "git push origin master"
106
- sh "gem push pkg/git-hub-#{Hub::Version}.gem"
107
106
  sh "git clean -fd"
108
107
  exec "rake pages"
109
108
  end
@@ -191,7 +191,7 @@ module Hub
191
191
  def cherry_pick(args)
192
192
  unless args.include?('-m') or args.include?('--mainline')
193
193
  case ref = args.words.last
194
- when %r{^(https?:)//github.com/(.+?)/(.+?)/commit/([a-f1-9]{7,40})}
194
+ when %r{^(https?:)//github.com/(.+?)/(.+?)/commit/([a-f0-9]{7,40})}
195
195
  scheme, user, repo, sha = $1, $2, $3, $4
196
196
  args[args.index(ref)] = sha
197
197
  when /^(\w+)@([a-f1-9]{7,40})$/
@@ -224,9 +224,7 @@ module Hub
224
224
  # > git remote add origin git@github.com:USER/REPO.git
225
225
  def init(args)
226
226
  if args.delete('-g')
227
- # Can't do anything if we don't have a USER set.
228
-
229
- url = github_url(:private => true)
227
+ url = github_url(:private => true, :repo => File.basename(Dir.pwd))
230
228
  args.after "git remote add origin #{url}"
231
229
  end
232
230
  end
@@ -499,7 +497,7 @@ help
499
497
  #
500
498
  # Returns a Boolean.
501
499
  def command?(name)
502
- `type -t #{command}`
500
+ `type -t #{name}`
503
501
  $?.success?
504
502
  end
505
503
 
@@ -110,12 +110,14 @@ module Hub
110
110
  '%s//github.com/%s/%s%s' % [scheme, user, repo, path]
111
111
  else
112
112
  if secure
113
- 'git@github.com:%s/%s.git'
113
+ url = 'git@github.com:%s/%s.git'
114
114
  elsif http_clone?
115
- 'http://github.com/%s/%s.git'
115
+ url = 'http://github.com/%s/%s.git'
116
116
  else
117
- 'git://github.com/%s/%s.git'
118
- end % [user, repo]
117
+ url = 'git://github.com/%s/%s.git'
118
+ end
119
+
120
+ url % [user, repo]
119
121
  end
120
122
  end
121
123
  end
@@ -1,3 +1,3 @@
1
1
  module Hub
2
- Version = VERSION = '1.3.1'
2
+ Version = VERSION = '1.3.2'
3
3
  end
@@ -0,0 +1 @@
1
+ webmock 1.3.0
@@ -294,12 +294,19 @@ class HubTest < Test::Unit::TestCase
294
294
  end
295
295
 
296
296
  def test_cherry_pick_url
297
- url = 'http://github.com/mislav/hub/commit/a319d88#comments'
297
+ url = 'http://github.com/mislav/hub/commit/a319d88'
298
298
  h = Hub("cherry-pick #{url}")
299
299
  assert_equal "git fetch mislav", h.command
300
300
  assert_equal "git cherry-pick a319d88", h.after
301
301
  end
302
302
 
303
+ def test_cherry_pick_url_with_fragment
304
+ url = 'http://github.com/mislav/hub/commit/abcdef0123456789#comments'
305
+ h = Hub("cherry-pick #{url}")
306
+ assert_equal "git fetch mislav", h.command
307
+ assert_equal "git cherry-pick abcdef0123456789", h.after
308
+ end
309
+
303
310
  def test_cherry_pick_url_with_remote_add
304
311
  url = 'http://github.com/xoebus/hub/commit/a319d88'
305
312
  h = Hub("cherry-pick #{url}")
@@ -347,9 +354,10 @@ class HubTest < Test::Unit::TestCase
347
354
  end
348
355
 
349
356
  def test_init
357
+ dirname = File.basename(Dir.pwd)
350
358
  h = Hub("init -g")
351
359
  assert_equal "git init", h.command
352
- assert_equal "git remote add origin git@github.com:tpw/hub.git", h.after
360
+ assert_equal "git remote add origin git@github.com:tpw/#{dirname}.git", h.after
353
361
  end
354
362
 
355
363
  def test_init_no_login
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 3
8
- - 1
9
- version: 1.3.1
8
+ - 2
9
+ version: 1.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Chris Wanstrath
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-29 00:00:00 -07:00
17
+ date: 2010-07-24 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -42,6 +42,7 @@ files:
42
42
  - man/hub.1.html
43
43
  - man/hub.1.ronn
44
44
  - test/alias_test.rb
45
+ - test/deps.rip
45
46
  - test/fakebin/git
46
47
  - test/fakebin/open
47
48
  - test/helper.rb