gitvers 0.0.4 → 0.0.5
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 +4 -4
- data/README.md +4 -1
- data/bin/gitvers +0 -0
- data/lib/gitvers/repository.rb +3 -3
- data/lib/gitvers/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b11fe51ee7910637c42c35492733f57f273cd27e
|
4
|
+
data.tar.gz: ade48819bb72019b79a96f83d9dd88083f93c86b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d30b5254805c050264303834377b38ea4cf4efaf44c38487368bd1e8f1f800b02a815c2f7de3fe67da9372449c1fca0100c912e21e165670a8289a2804c747d
|
7
|
+
data.tar.gz: f1b0dd950575f2b60810b4733b793972c68e9e334d1ece325527b13b2b7a47d47b5f9fdce6c1874513558f6c2193edcb14f884b674271470754d636b8ecd4f57
|
data/README.md
CHANGED
@@ -22,13 +22,16 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
### API
|
24
24
|
|
25
|
-
rep = Gitvers::Repository.new(repository_path)
|
25
|
+
rep = Gitvers::Repository.new(repository_path, :commit => 'master')
|
26
26
|
|
27
27
|
puts rep.summary # 1.6.2-34-09938ba (3425)
|
28
28
|
puts rep.full_version # 1.6.2-34-09938ba
|
29
29
|
puts rep.short_version # 1.6.2
|
30
30
|
puts rep.revision_number # 3425
|
31
31
|
|
32
|
+
Commit is optional, default to HEAD. When commit is given, it is
|
33
|
+
used to compute the revision number with `git rev-list`.
|
34
|
+
|
32
35
|
## Known issues
|
33
36
|
|
34
37
|
At present gitvers is limited to an exclusive use of git tags, which means it will
|
data/bin/gitvers
CHANGED
File without changes
|
data/lib/gitvers/repository.rb
CHANGED
@@ -6,9 +6,9 @@ module Gitvers
|
|
6
6
|
end
|
7
7
|
|
8
8
|
class Repository
|
9
|
-
def initialize(path,
|
9
|
+
def initialize(path, commit: 'HEAD')
|
10
10
|
@path = path
|
11
|
-
@
|
11
|
+
@commit_name = commit
|
12
12
|
|
13
13
|
while path != '/'
|
14
14
|
git_dir = File.join(path, "/.git")
|
@@ -35,7 +35,7 @@ module Gitvers
|
|
35
35
|
|
36
36
|
def revision_number
|
37
37
|
check!
|
38
|
-
git(
|
38
|
+
git("rev-list #{@commit_name}").lines.count
|
39
39
|
end
|
40
40
|
|
41
41
|
def versions
|
data/lib/gitvers/version.rb
CHANGED
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Goy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: highline
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Utility to manage version with git tags
|
@@ -60,7 +60,7 @@ executables:
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- .gitignore
|
63
|
+
- ".gitignore"
|
64
64
|
- Gemfile
|
65
65
|
- LICENSE.txt
|
66
66
|
- README.md
|
@@ -81,17 +81,17 @@ require_paths:
|
|
81
81
|
- lib
|
82
82
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.2.2
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Utility to manage version with git tags
|