git-version-bump 0.9.1 → 0.10.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/Rakefile +5 -1
  2. data/lib/git-version-bump.rb +4 -6
  3. metadata +4 -4
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
- require_relative 'lib/git-version-bump/rake-tasks'
4
3
 
5
4
  begin
6
5
  Bundler.setup(:default, :development)
@@ -19,3 +18,8 @@ Rake::RDocTask.new do |rd|
19
18
  rd.title = 'git-version-bump'
20
19
  rd.rdoc_files.include("README.md", "lib/**/*.rb")
21
20
  end
21
+
22
+ task :release do
23
+ sh "git push --follow-tags"
24
+ sh "git release"
25
+ end
@@ -2,6 +2,8 @@ require 'tempfile'
2
2
  require 'digest/sha1'
3
3
 
4
4
  module GitVersionBump
5
+ class VersionUnobtainable < StandardError; end
6
+
5
7
  def self.dirty_tree?
6
8
  # Are we in a dirty, dirty tree?
7
9
  system("! git diff --no-ext-diff --quiet --exit-code || ! git diff-index --cached --quiet HEAD")
@@ -37,10 +39,6 @@ module GitVersionBump
37
39
  end
38
40
 
39
41
  def self.version(gem = nil)
40
- @version_cache ||= {}
41
-
42
- return @version_cache[gem] if @version_cache[gem]
43
-
44
42
  git_ver = `git describe --dirty='.1.dirty.#{Time.now.strftime("%Y%m%d.%H%M%S")}' --match='v[0-9]*.[0-9]*.*[0-9]' 2>/dev/null`.
45
43
  strip.
46
44
  gsub(/^v/, '').
@@ -72,8 +70,8 @@ module GitVersionBump
72
70
  # If we got here, something went *badly* wrong -- presumably, we
73
71
  # weren't called from within a loaded gem, and so we've got *no*
74
72
  # idea what's going on. Time to bail!
75
- raise RuntimeError,
76
- "GVB.version(#{gem.inspect}) failed. Is git installed?"
73
+ raise VersionUnobtainable,
74
+ "GVB.version(#{gem.inspect}) failed. Is git installed?"
77
75
  end
78
76
  end
79
77
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-version-bump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.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: 2014-05-07 00:00:00.000000000 Z
12
+ date: 2014-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  segments:
91
91
  - 0
92
- hash: 4358078833643184323
92
+ hash: 879836245496390919
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  segments:
100
100
  - 0
101
- hash: 4358078833643184323
101
+ hash: 879836245496390919
102
102
  requirements: []
103
103
  rubyforge_project:
104
104
  rubygems_version: 1.8.23