gemy 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/bin/gemy +16 -7
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.1.0
data/bin/gemy CHANGED
@@ -14,7 +14,7 @@ optparse = OptionParser.new do |opts|
14
14
 
15
15
  opts.banner = <<-banner
16
16
  Gem CLI utils:
17
- Simple Tool for managing gem local installation and rmote push.
17
+ Simple Tool for managing gem local installation and remote push.
18
18
  Usage:
19
19
  gemy <command> [options]
20
20
  <command>:
@@ -30,15 +30,20 @@ optparse = OptionParser.new do |opts|
30
30
  end
31
31
 
32
32
  options[:force] = false
33
- opts.on( '-f', '--force', 'execute the command even if the working tree is dirty' ) do
33
+ opts.on( '-f', '--force', 'Executes the command even if the working tree is dirty' ) do
34
34
  options[:force] = true
35
35
  end
36
36
 
37
37
  options[:clean] = false
38
- opts.on( '-c', '--clean', 'clean old installations' ) do
38
+ opts.on( '-c', '--clean', 'Clean old installations' ) do
39
39
  options[:clean] = true
40
40
  end
41
41
 
42
+ options[:bump] = false
43
+ opts.on( '-b', '--bump', 'Bump local version with git SHA1' ) do
44
+ options[:bump] = true
45
+ end
46
+
42
47
  opts.on( '-v', '--version', 'Shows the version and exits' ) do
43
48
  puts gemy_version
44
49
  exit
@@ -66,7 +71,7 @@ end
66
71
 
67
72
  command = ARGV.first
68
73
 
69
- exec 'gemy -h' if command.nil?
74
+ exec "#{$0} -h" if command.nil?
70
75
 
71
76
  puts copy
72
77
 
@@ -76,14 +81,18 @@ when 'install'
76
81
  ensure_clean(:install, options[:force])
77
82
  system %(gem uninstall #{options[:name]} --all --ignore-dependencies --executables) if options[:clean]
78
83
  begin
79
- commit_id = `git log -1 --format="%h" HEAD`.strip
80
- version = "#{gem_version}.#{commit_id}"
84
+ version = if options[:bump]
85
+ commit_id = `git log -1 --format="%h" HEAD`.strip
86
+ "#{gem_version}.#{commit_id}"
87
+ else
88
+ gem_version
89
+ end
81
90
  File.open('VERSION', 'w') {|f| f.puts version }
82
91
  versioned_name = "#{options[:name]}-#{version}.gem"
83
92
  puts versioned_name
84
93
  system %(gem build #{options[:name]}.gemspec)
85
94
  system %(gem install '#{versioned_name}' --local --no-rdoc --no-ri)
86
- puts <<-warning.gsub(/^ {6}/, '')
95
+ puts <<-warning.gsub(/^ {6}/, '') if options[:bump]
87
96
 
88
97
  *******************************************************************************
89
98
  * WARNING *
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-21 00:00:00.000000000 Z
12
+ date: 2012-09-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'Useful if you are a gem author: it eases testing your gem locally,
15
15
  and pushing it to RubyGems'