From cfb369f11a644c43545f2919ef728c2f1da21c69 Mon Sep 17 00:00:00 2001 From: Jeremy Bolding Date: Fri, 11 Dec 2015 16:59:10 -0600 Subject: [PATCH 1/2] Update zorro --- bin/zorro | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/zorro b/bin/zorro index 058ab03..f0affb0 100755 --- a/bin/zorro +++ b/bin/zorro @@ -3,6 +3,7 @@ require 'rubygems' require 'commander/import' require 'yaml' +require 'launchy' # Without .zorro.yml # @@ -42,13 +43,13 @@ command :bitbucket do |c| case options.open when 'branches' - `open https://bitbucket.org/#{options.account}/#{options.repo}/branches` + Launchy.open "https://bitbucket.org/#{options.account}/#{options.repo}/branches" when 'pulls' - `open https://bitbucket.org/#{options.account}/#{options.repo}/pull-requests` + Launchy.open "https://bitbucket.org/#{options.account}/#{options.repo}/pull-requests" when 'source' - `open https://bitbucket.org/#{options.account}/#{options.repo}/src` + Launchy.open "https://bitbucket.org/#{options.account}/#{options.repo}/src`" when 'root' - `open https://bitbucket.org/#{options.account}/#{options.repo}` + Launchy.open "https://bitbucket.org/#{options.account}/#{options.repo}" end end end @@ -67,6 +68,6 @@ command :trello do |c| config_file = File.join(File.expand_path('.'), '.zorro.yml') options.default YAML.load_file(config_file)['trello'] if File.exists?(config_file) - `open https://trello.com/b/#{options.id}` + Launchy.open "https://trello.com/b/#{options.id}" end end From 26588e0c591e6a12ceec504faf0b0bfa73d76f27 Mon Sep 17 00:00:00 2001 From: Jeremy Bolding Date: Fri, 11 Dec 2015 19:32:55 -0600 Subject: [PATCH 2/2] Added Github Support. --- bin/zorro | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/bin/zorro b/bin/zorro index f0affb0..61e55c8 100755 --- a/bin/zorro +++ b/bin/zorro @@ -32,7 +32,7 @@ command :bitbucket do |c| c.description = 'Helps you interact with Bitbucket' c.example 'Opens the repository branches', 'zorro --account bitbucket_username --repo my_repo --open branches' - c.option '--account STRING', String, 'You bitbucket account name' + c.option '--account STRING', String, 'Your bitbucket account name' c.option '--repo STRING', String, 'Repository name' c.option '--open STRING', String, 'You can use (branches, pulls or source)' @@ -54,6 +54,35 @@ command :bitbucket do |c| end end +command :github do |c| + c.syntax = 'zorro github [options]' + c.description = 'Helps you interact with Github' + c.example 'Opens up repository issues', 'zorro github --account github_username --repo github_repo --open issues' + + c.option '--account STRING', String, 'Your Github Username' + c.option '--repo STRING', String, 'Repository name' + c.option '--open STRING', String, ' You can use (pulls, issues,settings,graphs,pulse,wiki)' + c.action do |args, options| + config_file = File.join(File.expand_path('.'),'.zorro.yml') + options.default YAML.load_file(config_file)['github'] if File.exists?(config_file) + + case options.open + when 'pulls' + Launchy.open "https://github.com/#{options.account}/#{options.repo}/pulls" + when 'issues' + Launchy.open "https://github.com/#{options.account}/#{options.repo}/issues" + when 'wiki' + Launchy.open "https://github.com/#{options.account}/#{options.repo}/wiki" + when 'graphs' + Launchy.open "https://github.com/#{options.account}/#{options.repo}/graphs" + when 'pulse' + Launchy.open "https://github.com/#{options.account}/#{options.repo}/pulse" + when 'settings' + Launchy.open "https://github.com/#{options.account}/#{options.repo}/settings" + end + end +end + default_command :bitbucket command :trello do |c|