git-duo 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/git/duo/cli.rb +2 -0
- data/lib/git/duo/exceptions.rb +1 -0
- data/lib/git/duo/repo.rb +1 -1
- data/lib/git/duo/version.rb +1 -1
- data/lib/git/duo/wrapper.rb +6 -0
- data/test/git/duo/repo_test.rb +5 -2
- data/test/git/duo/wrapper_test.rb +20 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd1a43aa0e8bef0a4db0f3337be1cde1bd8fdd7a
|
4
|
+
data.tar.gz: 0eca19c31267b8deb28d3b26190375a7e876c4fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5648909e39ac86047114b95bffe9d369b171a47ae5b08bf15e6d888da98f50dc378ac1f595b1b88f1232a0ae0c9aecbe4cf5d419c721814bf4ac2d1f2cf07c29
|
7
|
+
data.tar.gz: 598126bfa88c980005dfea55fffa2faba21f381ff41e8d523c1b9953b2ab3c0159cb2121454b6346b8f20e07d96b9edc793591929fa0feb6154c5d3b146b450a
|
data/lib/git/duo/cli.rb
CHANGED
data/lib/git/duo/exceptions.rb
CHANGED
data/lib/git/duo/repo.rb
CHANGED
data/lib/git/duo/version.rb
CHANGED
data/lib/git/duo/wrapper.rb
CHANGED
@@ -3,6 +3,12 @@ module Git
|
|
3
3
|
class Wrapper
|
4
4
|
PIPE_STDOUT_TO_STDERR = '2>&1'
|
5
5
|
|
6
|
+
def self.top_level
|
7
|
+
directory = `git rev-parse --show-toplevel`.strip
|
8
|
+
raise NotAGitRepository unless $?.exitstatus.zero?
|
9
|
+
directory
|
10
|
+
end
|
11
|
+
|
6
12
|
def initialize(directory)
|
7
13
|
@directory = directory
|
8
14
|
end
|
data/test/git/duo/repo_test.rb
CHANGED
@@ -9,10 +9,13 @@ module Git::Duo
|
|
9
9
|
attr_reader :repo, :wrapper
|
10
10
|
|
11
11
|
def test_current_inits_repo_with_current_dir
|
12
|
-
repo = Repo.current
|
13
12
|
expected = Dir.pwd
|
14
13
|
|
15
|
-
|
14
|
+
Dir.chdir('test') do
|
15
|
+
repo = Repo.current
|
16
|
+
|
17
|
+
assert_equal expected, repo.directory
|
18
|
+
end
|
16
19
|
end
|
17
20
|
|
18
21
|
def test_initialize_expands_directory_path
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../../test_helper'
|
2
|
+
|
3
|
+
module Git
|
4
|
+
module Duo
|
5
|
+
class WrapperTest < MiniTest::Test
|
6
|
+
def test_top_level
|
7
|
+
directory = Wrapper.top_level
|
8
|
+
|
9
|
+
expected_directory = File.expand_path('../../../../', __FILE__)
|
10
|
+
assert_equal expected_directory, directory
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_top_level_when_not_in_git
|
14
|
+
assert_raises NotAGitRepository do
|
15
|
+
Dir.chdir('/tmp') { Wrapper.top_level }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Teo Ljungberg
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- test/git/duo/author_test.rb
|
113
113
|
- test/git/duo/pair_test.rb
|
114
114
|
- test/git/duo/repo_test.rb
|
115
|
+
- test/git/duo/wrapper_test.rb
|
115
116
|
- test/test_helper.rb
|
116
117
|
homepage: https://github.com/teoljungberg/git-duo
|
117
118
|
licenses:
|
@@ -142,4 +143,5 @@ test_files:
|
|
142
143
|
- test/git/duo/author_test.rb
|
143
144
|
- test/git/duo/pair_test.rb
|
144
145
|
- test/git/duo/repo_test.rb
|
146
|
+
- test/git/duo/wrapper_test.rb
|
145
147
|
- test/test_helper.rb
|