mgit 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mgit/commands/tags.rb +37 -0
- data/lib/mgit/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4447be436da4ce6283adfef2ca2e65f522715644
|
4
|
+
data.tar.gz: 2b898725657dea57e19a3a28a7ec0691007fa234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1deafe5dfa39f02dbc3b2c9be66fe5830acb45c628fb7be70a27c32685d28f59efdd18c8b89e91427f27472cb05d5d7892389503014c08be01e59f3fed2e12d
|
7
|
+
data.tar.gz: bf2c584feefe6d708e5f04ed660132f836322ad89e874a51ac5a4fe4babfe294c4e7e74352044e8658e79b0da78100866b47d61f31d01f2512cc2569b0f7f178
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module MGit
|
2
|
+
class TagsCommand < Command
|
3
|
+
def execute(args)
|
4
|
+
t = []
|
5
|
+
Registry.chdir_each { |repo| t << [repo.name, *latest_tag] }
|
6
|
+
ptable t, :columns => [24, nil]
|
7
|
+
end
|
8
|
+
|
9
|
+
def arity
|
10
|
+
[0, 0]
|
11
|
+
end
|
12
|
+
|
13
|
+
def usage
|
14
|
+
'tags'
|
15
|
+
end
|
16
|
+
|
17
|
+
def description
|
18
|
+
'display the latest tag in repository'
|
19
|
+
end
|
20
|
+
|
21
|
+
register_command :tags
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def latest_tag
|
26
|
+
sha = `git rev-list --tags --max-count=1 2>&1`.strip
|
27
|
+
sha =~ /usage:/ ? ['none', ''] : print_tag(sha)
|
28
|
+
end
|
29
|
+
|
30
|
+
def print_tag(sha)
|
31
|
+
[
|
32
|
+
`git describe #{sha}`.strip,
|
33
|
+
Time.at(`git log -n 1 --format="%at" #{sha}`.strip.to_i).strftime('%Y-%m-%d')
|
34
|
+
]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/mgit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mgit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FlavourSys Technology GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- lib/mgit/commands/remove.rb
|
91
91
|
- lib/mgit/commands/help.rb
|
92
92
|
- lib/mgit/commands/foreach.rb
|
93
|
+
- lib/mgit/commands/tags.rb
|
93
94
|
- lib/mgit/commands/add.rb
|
94
95
|
- lib/mgit/commands/log.rb
|
95
96
|
- lib/mgit/commands/show.rb
|