mgit 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9b3bfc54404924e4ed38ea5a98aa62a11707fa4
4
- data.tar.gz: c72619042d01acef75e949a9e957bf63f84421c8
3
+ metadata.gz: 4447be436da4ce6283adfef2ca2e65f522715644
4
+ data.tar.gz: 2b898725657dea57e19a3a28a7ec0691007fa234
5
5
  SHA512:
6
- metadata.gz: 09e18f231d617d8ecd65e59f690d337a0cfa11de889d33e52babb830476ddb9003b96eb113bef2e4764157f30d63c661f85dd2f4b7ac9b5e92b97a67a65b0ae6
7
- data.tar.gz: 658fb29f923abb609ab78972d3dfedf379ae7d338d78293f99d97338b34723b6eeb999a88295da7f70ad1b220bfc8d3f0d90d30f00d359fb8058c2d0f0c12c0a
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
@@ -1,3 +1,3 @@
1
1
  module MGit
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
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.1
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-09 00:00:00.000000000 Z
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