Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

gh issues web [user] - opens the Issues page

  • Loading branch information...
commit 959ca7c1027c91c10b3e625bd63ea31b0781b1a2 1 parent d3809f0
@drnic drnic authored
View
6 History.txt
@@ -1,4 +1,8 @@
-* no longer using old /network/members API call (which is 500ing at the moment)
+* Commands:
+ * gh issues web [user] - opens the Issues page
+
+* Miscellaneous:
+ * no longer using old /network/members API call (which is 500ing at the moment)
== 0.3.10
View
4 lib/commands/helpers.rb
@@ -250,6 +250,10 @@
"http://github.com/#{user}/#{project}/network_meta"
end
+helper :issues_page_for do |user|
+ "https://github.com/#{user}/#{project}/issues"
+end
+
helper :list_issues_for do |user, state|
"http://github.com/api/v2/yaml/issues/list/#{user}/#{project}/#{state}"
end
View
9 lib/commands/issues.rb
@@ -1,15 +1,16 @@
desc "Project issues tools - sub-commands : open [user], closed [user]"
-flags :user => "Show issues from a certain user's repository"
flags :after => "Only show issues updated after a certain date"
flags :label => "Only show issues with a certain label"
-command :issues do |command|
+command :issues do |command, user|
return if !helper.project
- options[:user] ||= helper.owner
+ user ||= helper.owner
case command
when 'open', 'closed'
- report = YAML.load(Kernel.open(@helper.list_issues_for(options[:user], command)))
+ report = YAML.load(Kernel.open(@helper.list_issues_for(user, command)))
@helper.print_issues(report['issues'], options)
+ when 'web'
+ helper.open helper.issues_page_for(user)
else
helper.print_issues_help
end
View
14 spec/commands/command_issues_spec.rb
@@ -19,4 +19,18 @@
EOS
end
end
+
+ specify "issues web opens the project's issues page" do
+ running :issues, "web" do
+ setup_url_for
+ @helper.should_receive(:open).once.with("https://github.com/user/project/issues")
+ end
+ end
+
+ specify "issues web <user> opens the project's issues page for a user repo" do
+ running :issues, "web", "drnic" do
+ setup_url_for
+ @helper.should_receive(:open).once.with("https://github.com/drnic/project/issues")
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.