git-revision 0.0.4 → 1.0.0
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/LICENSE.txt +1 -1
- data/README.md +4 -2
- data/git-revision.gemspec +2 -2
- data/lib/git-revision.rb +7 -2
- metadata +4 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bfa27f5493c24e5c7f3cf14d5837d0b19a045570f5b20d57f71a4d0b4ae3404
|
4
|
+
data.tar.gz: 8e28bdc6f0461ba403a8c01ffe6056f85beb77214626e07c62dbea2831d8fa13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 479e32d0b458bb45def22cc189981e2dfc6f64a5c4bf7c3126edd9352dfcc28c02990fd32f73a6799c6a43420ba25916bb8c5cebfc1939ae105d98b78a6e2960
|
7
|
+
data.tar.gz: 604dd83e5e679b53ef6341613a29d90b07aaaee904fa7d631daf5a150db82e5e8f077086e7253dd2962cea3e49e0a1a4967b2f5bfdcbc158102c9e9a998ce1a0
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Git Revision
|
2
2
|
|
3
3
|
Git Revision is a simple (45 SLoC) Ruby gem that provides basic information about git source code.
|
4
|
-
You can use it in your apps, [for example](
|
4
|
+
You can use it in your apps, [for example](https://stackoverflow.com/a/8501359), to show deployed version.
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -31,7 +31,8 @@ bundle install
|
|
31
31
|
:authored_date => "Fri Jun 8 17:55:01 2012 +0500",
|
32
32
|
:authored_timestamp => "1339160101",
|
33
33
|
:commit_tag => "4.2.0.beta",
|
34
|
-
:repo_last_tag => "4.2.0.beta"
|
34
|
+
:repo_last_tag => "4.2.0.beta",
|
35
|
+
:long_tag => "v4.2.0.beta-7-60619c1"
|
35
36
|
}
|
36
37
|
```
|
37
38
|
|
@@ -47,6 +48,7 @@ Git::Revision.date # returns authored date of last commit
|
|
47
48
|
Git::Revision.timestamp # returns authored date of last commit in Unix time
|
48
49
|
Git::Revision.tag # returns last commit tag if exists
|
49
50
|
Git::Revision.last_tag # returns last tag in repository if exists
|
51
|
+
Git::Revision.long_tag # returns last tag, number of commits since, and short commit hash
|
50
52
|
```
|
51
53
|
|
52
54
|
## License
|
data/git-revision.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'git-revision'
|
3
|
-
gem.version = '0.0
|
3
|
+
gem.version = '1.0.0'
|
4
4
|
gem.files = `git ls-files`.split($\)
|
5
5
|
gem.require_path = 'lib'
|
6
6
|
gem.license = 'BSD-2-Clause'
|
@@ -8,5 +8,5 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.author = 'Nihad Abbasov'
|
9
9
|
gem.email = 'nihad@42na.in'
|
10
10
|
gem.summary = 'Git Revision provides information about git source code.'
|
11
|
-
gem.homepage = '
|
11
|
+
gem.homepage = 'https://github.com/NARKOZ/git-revision'
|
12
12
|
end
|
data/lib/git-revision.rb
CHANGED
@@ -22,13 +22,17 @@ module Git
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def tag
|
25
|
-
`git
|
25
|
+
`git tag --points-at #{commit} | sort | head -n 1`.strip
|
26
26
|
end
|
27
27
|
|
28
28
|
def last_tag
|
29
29
|
`git describe --tags --abbrev=0`.strip
|
30
30
|
end
|
31
31
|
|
32
|
+
def long_tag
|
33
|
+
`git describe --long`.strip
|
34
|
+
end
|
35
|
+
|
32
36
|
def branch
|
33
37
|
`git rev-parse --abbrev-ref HEAD`.strip
|
34
38
|
end
|
@@ -47,7 +51,8 @@ module Git
|
|
47
51
|
:authored_date => date,
|
48
52
|
:authored_timestamp => timestamp,
|
49
53
|
:commit_tag => tag,
|
50
|
-
:repo_last_tag => last_tag
|
54
|
+
:repo_last_tag => last_tag,
|
55
|
+
:long_tag => long_tag
|
51
56
|
}
|
52
57
|
end
|
53
58
|
end
|
metadata
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-revision
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nihad Abbasov
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
|
-
description:
|
14
12
|
email: nihad@42na.in
|
15
13
|
executables: []
|
16
14
|
extensions: []
|
@@ -20,11 +18,10 @@ files:
|
|
20
18
|
- README.md
|
21
19
|
- git-revision.gemspec
|
22
20
|
- lib/git-revision.rb
|
23
|
-
homepage:
|
21
|
+
homepage: https://github.com/NARKOZ/git-revision
|
24
22
|
licenses:
|
25
23
|
- BSD-2-Clause
|
26
24
|
metadata: {}
|
27
|
-
post_install_message:
|
28
25
|
rdoc_options: []
|
29
26
|
require_paths:
|
30
27
|
- lib
|
@@ -39,8 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
36
|
- !ruby/object:Gem::Version
|
40
37
|
version: '0'
|
41
38
|
requirements: []
|
42
|
-
rubygems_version: 3.
|
43
|
-
signing_key:
|
39
|
+
rubygems_version: 3.6.9
|
44
40
|
specification_version: 4
|
45
41
|
summary: Git Revision provides information about git source code.
|
46
42
|
test_files: []
|