gitvers 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitvers/repository.rb +8 -2
- data/lib/gitvers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1994228f8a0a9b3d8eb2f2a0812b80aed7eccd07
|
4
|
+
data.tar.gz: 2d430d0271403e47d6b2bb575793f9021f636902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc188f71f182bb522fa7e355e7ef65b95bff2a520372398e4f1e32833063731f4fe442555326b24821d57e5fa82a48bc2f85947fc6ae4b2f2dfe4cabff450f78
|
7
|
+
data.tar.gz: d82c9b8a9d4092dccdb3944ff08a4c3ec3cf351c59816188c017e6c758a9947aebafc7d6dd14e64f7381d7cb0b37d0304ca5c809d150784d3ce663a68b88b7f2
|
data/lib/gitvers/repository.rb
CHANGED
@@ -8,9 +8,15 @@ module Gitvers
|
|
8
8
|
class Repository
|
9
9
|
def initialize(path, branch_name: 'master')
|
10
10
|
@path = path
|
11
|
-
@git_dir = File.join(path, "/.git")
|
12
11
|
@branch_name = branch_name
|
13
|
-
|
12
|
+
|
13
|
+
while path != '/'
|
14
|
+
git_dir = File.join(path, "/.git")
|
15
|
+
path = File.expand_path(File.join(path, '..'))
|
16
|
+
next unless File.exist?(git_dir)
|
17
|
+
@git_dir = git_dir
|
18
|
+
end
|
19
|
+
@git_dir or raise "Invalid git repository #{@path}"
|
14
20
|
end
|
15
21
|
|
16
22
|
def summary
|
data/lib/gitvers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitvers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Goy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|