Permalink
Browse files

gh home - no longer appends /tree/master to the end of the URL

  • Loading branch information...
drnic committed Nov 26, 2009
1 parent 97d9bcd commit 6f99b3060ba6ab9a7a19b9374df60010b72d6e9a
Showing with 10 additions and 3 deletions.
  1. +5 −0 History.txt
  2. +3 −1 lib/commands/commands.rb
  3. +2 −2 spec/commands/command_home_spec.rb
View
@@ -1,3 +1,8 @@
+== 0.4.1 NOT YET RELEASED
+
+Updated Commands:
+ * gh home - no longer appends /tree/master to the end of the URL
+
== 0.4.0
Releasing to GemCutter!
View
@@ -1,7 +1,9 @@
desc "Open this repo's master branch in a web browser."
command :home do |user|
if helper.project
- helper.open helper.homepage_for(user || helper.owner, 'master')
+ homepage = helper.homepage_for(user || helper.owner, 'master')
+ homepage.gsub!(%r{/tree/master$}, '')
+ helper.open homepage
end
end
@@ -7,14 +7,14 @@
specify "home should open the project home page" do
running :home do
setup_url_for
- @helper.should_receive(:open).once.with("https://github.com/user/project/tree/master")
+ @helper.should_receive(:open).once.with("https://github.com/user/project")
end
end
specify "home defunkt should open the home page of defunkt's fork" do
running :home, "defunkt" do
setup_url_for
- @helper.should_receive(:open).once.with("https://github.com/defunkt/project/tree/master")
+ @helper.should_receive(:open).once.with("https://github.com/defunkt/project")
end
end
end

0 comments on commit 6f99b30

Please sign in to comment.