lib/hub/commands.rb
# Handles common functionality of browser commands like `browse`
# and `compare`. Yields a block that returns params for `github_url`.
Handles common functionality of browser commands like `browse`
and `compare`. Yields a block that returns params for `github_url`.
Handles common functionality of browser commands like ` browse ` and ` compare ` . Yields a block that returns params for ` github_url ` .
def browse_command(args)
      url_only = args.delete('-u')
      $stderr.puts "Warning: the `-p` flag has no effect anymore" if args.delete('-p')
      params = yield
      args.executable = url_only ? 'echo' : browser_launcher
      args.push github_url({:web => true, :private => true}.update(params))
    end
def browse_command ( args ) url_only = args . delete ( '-u' ) $stderr . puts "Warning: the `-p` flag has no effect anymore" if args . delete ( '-p' ) params = yield args . executable = url_only ? 'echo' : browser_launcher args . push github_url ( { :web => true , :private => true } . update ( params ) ) end
Handles common functionality of browser commands like `browse`
and `compare`.
Handles common functionality of browser commands like ` browse ` and ` compare ` .
args