git-utils 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0edf67d43b4a31f657051e8a36faea3284b6ea1b
4
- data.tar.gz: b547a2b6c27f3768d2e138c486e564f1662e441c
3
+ metadata.gz: 26672368e31366a1a0346024f6c63c6e311fa4bc
4
+ data.tar.gz: f508261f8d9caa3501b957dee630578442d594d7
5
5
  SHA512:
6
- metadata.gz: 7cc1a1dbcdd2b1853cd596f27893ef9afb0ac27c577cafca19fa4b43a2a7805d1d0b51a68db6e3af6a5d8b8467f85bb2510d127748f4bacf4af3ede334c55790
7
- data.tar.gz: e32dc6b3dacfa73f120ecab9585d3e7e4b830d01c072b1e2cca06b05abf8584e569599b74897fa80c48a35357aca41949d06f72a62b12259df8a8f3c1940a01e
6
+ metadata.gz: b2750cea08cf0b2cfb8cd5f8ae546b8e30aff8ae5b927caf85607450d71e23710b799077e550faa61850d6f6afc462804e3535503e5bfdfe335a449d3c6b9417
7
+ data.tar.gz: 4b8ffc2a46c52d6fd4d249e0846f7f8ddd4a535394f853d3568104179e14183a684b701a3fb6136e76ecef2210e6a3f8b876d6eeefaec39855b23685db7f0c55
@@ -31,8 +31,6 @@ class Command
31
31
  @origin_url ||= `git config --get remote.origin.url`.strip
32
32
  end
33
33
 
34
-
35
-
36
34
  # Returns the name of the repository service.
37
35
  # It's currently GitHub, Bitbucket, or Stash.
38
36
  # We return blank for an unknown service; the command will still
@@ -4,10 +4,7 @@ class Sync < Command
4
4
 
5
5
  def parser
6
6
  OptionParser.new do |opts|
7
- opts.banner = "Usage: git sync"
8
- opts.on("-b", "--branch", "sync with given branch") do |opt|
9
- self.options.branch = opt
10
- end
7
+ opts.banner = "Usage: git sync [branch]"
11
8
  opts.on_tail("-h", "--help", "this usage guide") do
12
9
  puts opts.to_s; exit 0
13
10
  end
@@ -16,7 +13,7 @@ class Sync < Command
16
13
 
17
14
  # Returns a command appropriate for executing at the command line.
18
15
  def cmd
19
- branch = options[:branch] || 'master'
16
+ branch = self.known_options.first || 'master'
20
17
  c = ["git checkout #{branch}"]
21
18
  c << "git pull"
22
19
  c << "git checkout #{current_branch}"
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Utils
3
- VERSION = "0.6.3"
3
+ VERSION = "0.6.4"
4
4
  end
5
5
  end
@@ -12,6 +12,12 @@ describe Sync do
12
12
  its(:cmd) { should match /git pull/ }
13
13
  its(:cmd) { should match /git checkout #{command.current_branch}/ }
14
14
 
15
+ describe "description" do
16
+ let(:alternate_branch) { 'alternate' }
17
+ before { command.stub(:known_options).and_return([alternate_branch]) }
18
+ its(:cmd) { should match /git checkout #{alternate_branch}/ }
19
+ end
20
+
15
21
  describe "command-line command" do
16
22
  subject { `bin/git-sync --debug` }
17
23
  it { should match /git checkout master/ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hartl