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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53e99ac42d8a6a1fd13b9065cf419a38f4fc6a8c
4
- data.tar.gz: b3448bef52761cf7f68022b46ab958f109d29626
3
+ metadata.gz: 1994228f8a0a9b3d8eb2f2a0812b80aed7eccd07
4
+ data.tar.gz: 2d430d0271403e47d6b2bb575793f9021f636902
5
5
  SHA512:
6
- metadata.gz: 97680ab504fec7f0f38ac1510b00e0b8bafc54894e263b7cd713bb6d710e3172ad8dbb2d58c818cfe08f8baa26609e8e2658dd8675f4bef302b8377195198ed1
7
- data.tar.gz: 86655ec51a19caeb5626bbc51e1734e4b1b29e4c2ab656213fc234a8ccc41ae79366dc694a2dd650100b4f6a8a7249e7762dcebe453d7b9b10f51babeb4b396b
6
+ metadata.gz: fc188f71f182bb522fa7e355e7ef65b95bff2a520372398e4f1e32833063731f4fe442555326b24821d57e5fa82a48bc2f85947fc6ae4b2f2dfe4cabff450f78
7
+ data.tar.gz: d82c9b8a9d4092dccdb3944ff08a4c3ec3cf351c59816188c017e6c758a9947aebafc7d6dd14e64f7381d7cb0b37d0304ca5c809d150784d3ce663a68b88b7f2
@@ -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
- File.exist?(@git_dir) or raise "Invalid git repository #{@path}"
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
@@ -1,3 +1,3 @@
1
1
  module Gitvers
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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.3
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-10-21 00:00:00.000000000 Z
11
+ date: 2013-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler