hub 1.10.0 → 1.10.1
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/lib/hub/context.rb +10 -1
- data/lib/hub/github_api.rb +2 -1
- data/lib/hub/version.rb +1 -1
- data/test/hub_test.rb +0 -106
- metadata +17 -7
data/lib/hub/context.rb
CHANGED
@@ -98,7 +98,7 @@ module Hub
|
|
98
98
|
end
|
99
99
|
|
100
100
|
repo_methods = [
|
101
|
-
:current_branch,
|
101
|
+
:current_branch,
|
102
102
|
:current_project, :upstream_project,
|
103
103
|
:repo_owner, :repo_host,
|
104
104
|
:remotes, :remotes_group, :origin_remote
|
@@ -107,6 +107,15 @@ module Hub
|
|
107
107
|
def_delegators :local_repo, *repo_methods
|
108
108
|
private :repo_name, *repo_methods
|
109
109
|
|
110
|
+
def master_branch
|
111
|
+
if local_repo(false)
|
112
|
+
local_repo.master_branch
|
113
|
+
else
|
114
|
+
# FIXME: duplicates functionality of LocalRepo#master_branch
|
115
|
+
Branch.new nil, 'refs/heads/master'
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
110
119
|
class LocalRepo < Struct.new(:git_reader, :dir)
|
111
120
|
include GitReaderMethods
|
112
121
|
|
data/lib/hub/github_api.rb
CHANGED
data/lib/hub/version.rb
CHANGED
data/test/hub_test.rb
CHANGED
@@ -572,112 +572,6 @@ class HubTest < Test::Unit::TestCase
|
|
572
572
|
"echo https://github.com/defunkt/hub/compare/1.0...1.1"
|
573
573
|
end
|
574
574
|
|
575
|
-
def test_hub_browse
|
576
|
-
assert_command "browse mojombo/bert", "open https://github.com/mojombo/bert"
|
577
|
-
end
|
578
|
-
|
579
|
-
def test_hub_browse_commit
|
580
|
-
assert_command "browse mojombo/bert commit/5d5582", "open https://github.com/mojombo/bert/commit/5d5582"
|
581
|
-
end
|
582
|
-
|
583
|
-
def test_hub_browse_tracking_nothing
|
584
|
-
stub_tracking_nothing
|
585
|
-
assert_command "browse mojombo/bert", "open https://github.com/mojombo/bert"
|
586
|
-
end
|
587
|
-
|
588
|
-
def test_hub_browse_url
|
589
|
-
assert_command "browse -u mojombo/bert", "echo https://github.com/mojombo/bert"
|
590
|
-
end
|
591
|
-
|
592
|
-
def test_hub_browse_self
|
593
|
-
assert_command "browse resque", "open https://github.com/tpw/resque"
|
594
|
-
end
|
595
|
-
|
596
|
-
def test_hub_browse_subpage
|
597
|
-
assert_command "browse resque commits",
|
598
|
-
"open https://github.com/tpw/resque/commits/master"
|
599
|
-
assert_command "browse resque issues",
|
600
|
-
"open https://github.com/tpw/resque/issues"
|
601
|
-
assert_command "browse resque wiki",
|
602
|
-
"open https://github.com/tpw/resque/wiki"
|
603
|
-
end
|
604
|
-
|
605
|
-
def test_hub_browse_on_branch
|
606
|
-
stub_branch('refs/heads/feature')
|
607
|
-
stub_tracking('feature', 'mislav', 'experimental')
|
608
|
-
|
609
|
-
assert_command "browse resque", "open https://github.com/tpw/resque"
|
610
|
-
assert_command "browse resque commits",
|
611
|
-
"open https://github.com/tpw/resque/commits/master"
|
612
|
-
|
613
|
-
assert_command "browse",
|
614
|
-
"open https://github.com/mislav/hub/tree/experimental"
|
615
|
-
assert_command "browse -- tree",
|
616
|
-
"open https://github.com/mislav/hub/tree/experimental"
|
617
|
-
assert_command "browse -- commits",
|
618
|
-
"open https://github.com/mislav/hub/commits/experimental"
|
619
|
-
end
|
620
|
-
|
621
|
-
def test_hub_browse_on_complex_branch
|
622
|
-
stub_branch('refs/heads/feature/foo')
|
623
|
-
stub_tracking('feature/foo', 'mislav', 'feature/bar')
|
624
|
-
|
625
|
-
assert_command 'browse',
|
626
|
-
'open https://github.com/mislav/hub/tree/feature/bar'
|
627
|
-
end
|
628
|
-
|
629
|
-
def test_hub_browse_no_branch
|
630
|
-
stub_branch(nil)
|
631
|
-
assert_command 'browse', 'open https://github.com/defunkt/hub'
|
632
|
-
end
|
633
|
-
|
634
|
-
def test_hub_browse_current
|
635
|
-
assert_command "browse", "open https://github.com/defunkt/hub"
|
636
|
-
assert_command "browse --", "open https://github.com/defunkt/hub"
|
637
|
-
end
|
638
|
-
|
639
|
-
def test_hub_browse_current_https_uri
|
640
|
-
stub_repo_url "https://github.com/defunkt/hub"
|
641
|
-
assert_command "browse", "open https://github.com/defunkt/hub"
|
642
|
-
end
|
643
|
-
|
644
|
-
def test_hub_browse_commit_from_current
|
645
|
-
assert_command "browse -- commit/6616e4", "open https://github.com/defunkt/hub/commit/6616e4"
|
646
|
-
end
|
647
|
-
|
648
|
-
def test_hub_browse_no_tracking
|
649
|
-
stub_tracking_nothing
|
650
|
-
assert_command "browse", "open https://github.com/defunkt/hub"
|
651
|
-
end
|
652
|
-
|
653
|
-
def test_hub_browse_no_tracking_on_branch
|
654
|
-
stub_branch('refs/heads/feature')
|
655
|
-
stub_tracking_nothing('feature')
|
656
|
-
assert_command "browse", "open https://github.com/defunkt/hub"
|
657
|
-
end
|
658
|
-
|
659
|
-
def test_hub_browse_current_wiki
|
660
|
-
stub_repo_url 'git://github.com/defunkt/hub.wiki.git'
|
661
|
-
|
662
|
-
assert_command "browse", "open https://github.com/defunkt/hub/wiki"
|
663
|
-
assert_command "browse -- wiki", "open https://github.com/defunkt/hub/wiki"
|
664
|
-
assert_command "browse -- commits", "open https://github.com/defunkt/hub/wiki/_history"
|
665
|
-
assert_command "browse -- pages", "open https://github.com/defunkt/hub/wiki/_pages"
|
666
|
-
end
|
667
|
-
|
668
|
-
def test_hub_browse_current_subpage
|
669
|
-
assert_command "browse -- network",
|
670
|
-
"open https://github.com/defunkt/hub/network"
|
671
|
-
assert_command "browse -- anything/everything",
|
672
|
-
"open https://github.com/defunkt/hub/anything/everything"
|
673
|
-
end
|
674
|
-
|
675
|
-
def test_hub_browse_deprecated_private
|
676
|
-
with_browser_env('echo') do
|
677
|
-
assert_includes "Warning: the `-p` flag has no effect anymore\n", hub("browse -p defunkt/hub")
|
678
|
-
end
|
679
|
-
end
|
680
|
-
|
681
575
|
def test_hub_browse_no_repo
|
682
576
|
stub_repo_url(nil)
|
683
577
|
assert_equal "Usage: hub browse [<USER>/]<REPOSITORY>\n", hub("browse")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-05-
|
13
|
+
date: 2012-05-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,15 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: webmock
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ! '>='
|
@@ -33,7 +38,12 @@ dependencies:
|
|
33
38
|
version: '0'
|
34
39
|
type: :development
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
37
47
|
description: ! " `hub` is a command line utility which adds GitHub knowledge to `git`.\n\n
|
38
48
|
\ It can used on its own or as a `git` wrapper.\n\n Normal:\n\n $ hub clone
|
39
49
|
rtomayko/tilt\n\n Expands to:\n $ git clone git://github.com/rtomayko/tilt.git\n\n
|
@@ -95,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
105
|
version: '0'
|
96
106
|
requirements: []
|
97
107
|
rubyforge_project:
|
98
|
-
rubygems_version: 1.8.
|
108
|
+
rubygems_version: 1.8.24
|
99
109
|
signing_key:
|
100
110
|
specification_version: 3
|
101
111
|
summary: Command-line wrapper for git and GitHub
|