bump 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bump (0.3.3)
4
+ bump (0.3.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/bump.gemspec CHANGED
@@ -1,5 +1,5 @@
1
1
  Gem::Specification.new "bump" do |s|
2
- s.version = "0.3.3"
2
+ s.version = "0.3.4"
3
3
  s.author = "Gregory Marcilhacy"
4
4
  s.email = "g.marcilhacy@gmail.com"
5
5
  s.homepage = "https://github.com/gregorym/bump"
data/lib/bump.rb CHANGED
@@ -5,9 +5,9 @@ module Bump
5
5
  class UnfoundVersionFileError < StandardError; end
6
6
 
7
7
  class Bump
8
- BUMPS = %w(major minor patch pre)
9
- PRERELEASE = ["alpha","beta","rc",nil]
10
- OPTIONS = BUMPS | ["current"]
8
+ BUMPS = %w(major minor patch pre)
9
+ PRERELEASE = ["alpha","beta","rc",nil]
10
+ OPTIONS = BUMPS | ["current"]
11
11
  VERSION_REGEX = /(\d+\.\d+\.\d+(?:-(?:#{PRERELEASE.compact.join('|')}))?)/
12
12
 
13
13
  def self.defaults
@@ -84,8 +84,9 @@ module Bump
84
84
  end
85
85
 
86
86
  def self.version_from_gemspec
87
- return unless file = find_version_file("*.gemspec")
88
- return unless version = File.read(file)[/\.version\s*=\s*["']#{VERSION_REGEX}["']/, 1]
87
+ return unless file = find_version_file("*.gemspec")
88
+ version = File.read(file)[/\.version\s*=\s*["']#{VERSION_REGEX}["']/, 1]
89
+ return unless version = File.read(file)[/Gem::Specification.new.+ ["']#{VERSION_REGEX}["']/, 1] if version.nil?
89
90
  [version, file]
90
91
  end
91
92
 
data/spec/bump_spec.rb CHANGED
@@ -104,6 +104,21 @@ describe Bump do
104
104
  end
105
105
  end
106
106
 
107
+ context ".version in gemspec within the initializer" do
108
+ before do
109
+ write gemspec, <<-RUBY.sub(" "*6, "")
110
+ Gem::Specification.new "bump", "4.2.3" do
111
+ end
112
+ RUBY
113
+ end
114
+
115
+ it "should bump patch" do
116
+ bump("patch").should include("4.2.4")
117
+ read(gemspec).should include('"4.2.4"')
118
+ end
119
+ end
120
+
121
+
107
122
  context "VERSION in version.rb" do
108
123
  before do
109
124
  write_version_rb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
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-10-25 00:00:00.000000000 Z
12
+ date: 2012-10-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: g.marcilhacy@gmail.com