hub 1.10.5 → 1.10.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of hub might be problematic. Click here for more details.

data/HISTORY.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.10.6 (2013-04-25)
2
+
3
+ * compensate for new GitHub API enforcement
4
+ * fix asking for password on Ruby <= 1.8.6
5
+ * fix `fetch` for forks where username contains a dash
6
+
1
7
  ## 1.10.5 (2013-03-02)
2
8
 
3
9
  * helpful `pull-request` error message when base project is invalid
@@ -35,7 +35,7 @@ module Hub
35
35
  extend Context
36
36
 
37
37
  NAME_RE = /[\w.][\w.-]*/
38
- OWNER_RE = /[a-zA-Z0-9-]+/
38
+ OWNER_RE = /[a-zA-Z0-9][a-zA-Z0-9-]*/
39
39
  NAME_WITH_OWNER_RE = /^(?:#{NAME_RE}|#{OWNER_RE}\/#{NAME_RE})$/
40
40
 
41
41
  CUSTOM_COMMANDS = %w[alias create browse compare fork pull-request]
@@ -81,6 +81,10 @@ module Hub
81
81
  base_project = local_repo.main_project
82
82
  head_project = local_repo.current_project
83
83
 
84
+ unless current_branch
85
+ abort "Aborted: not currently on any branch."
86
+ end
87
+
84
88
  unless base_project
85
89
  abort "Aborted: the origin remote doesn't point to a GitHub repository."
86
90
  end
@@ -312,7 +316,7 @@ module Hub
312
316
  end
313
317
 
314
318
  projects = names.map { |name|
315
- unless name =~ /\W/ or remotes.include?(name) or remotes_group(name)
319
+ unless name !~ /^#{OWNER_RE}$/ or remotes.include?(name) or remotes_group(name)
316
320
  project = github_project(nil, name)
317
321
  repo_info = api_client.repo_info(project)
318
322
  if repo_info.success?
@@ -177,6 +177,7 @@ module Hub
177
177
  create_connection host_url
178
178
  end
179
179
 
180
+ req['User-Agent'] = "Hub #{Hub::VERSION}"
180
181
  apply_authentication(req, url)
181
182
  yield req if block_given?
182
183
 
@@ -403,7 +404,7 @@ module Hub
403
404
  tty_state = `stty -g 2>#{NULL}`
404
405
  system 'stty raw -echo -icanon isig' if $?.success?
405
406
  pass = ''
406
- while char = $stdin.getbyte and !(char == 13 or char == 10)
407
+ while char = getbyte($stdin) and !(char == 13 or char == 10)
407
408
  if char == 127 or char == 8
408
409
  pass[-1,1] = '' unless pass.empty?
409
410
  else
@@ -415,6 +416,15 @@ module Hub
415
416
  system "stty #{tty_state}" unless tty_state.empty?
416
417
  end
417
418
 
419
+ def getbyte(io)
420
+ if io.respond_to?(:getbyte)
421
+ io.getbyte
422
+ else
423
+ # In Ruby <= 1.8.6, getc behaved the same
424
+ io.getc
425
+ end
426
+ end
427
+
418
428
  def proxy_uri(with_ssl)
419
429
  env_name = "HTTP#{with_ssl ? 'S' : ''}_PROXY"
420
430
  if proxy = ENV[env_name] || ENV[env_name.downcase] and !proxy.empty?
@@ -1,3 +1,3 @@
1
1
  module Hub
2
- Version = VERSION = '1.10.5'
2
+ Version = VERSION = '1.10.6'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hub
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.10.5
5
+ version: 1.10.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chris Wanstrath
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-02 00:00:00.000000000 Z
13
+ date: 2013-04-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  prerelease: false