bump 0.3.10 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
  gemspec
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bump (0.3.10)
4
+ bump (0.3.11)
5
5
 
6
6
  GEM
7
- remote: http://rubygems.org/
7
+ remote: https://rubygems.org/
8
8
  specs:
9
9
  diff-lcs (1.1.3)
10
10
  rake (10.0.2)
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Introduction
2
- Bump is a gem that will simplify the way you build gems.
2
+ Bump is a gem that will simplify the way you build gems and chef-cookbooks.
3
3
 
4
4
 
5
5
  # Installation
@@ -8,13 +8,13 @@ Bump is a gem that will simplify the way you build gems.
8
8
 
9
9
  # Usage
10
10
 
11
- Current version of your gem:
11
+ Current version:
12
12
 
13
13
  bump current
14
14
 
15
15
  Current version: 0.1.2
16
16
 
17
- Bump your gemfile (major, minor, patch, pre):
17
+ Bump (major, minor, patch, pre):
18
18
 
19
19
  bump patch
20
20
 
@@ -23,13 +23,13 @@ Bump version 0.1.2 to 0.1.3
23
23
  ### Options
24
24
 
25
25
  ### --no-commit
26
- If you don't want to make a commit after bumping your gem, add the `--no-commit` option.
26
+ If you don't want to make a commit after bumping, add the `--no-commit` option.
27
27
 
28
28
  bump patch --no-commit
29
29
 
30
30
 
31
31
  ### --no-bundle
32
- If you don't want to run the `bundle` command after bumping your gem, add the `--no-bundle` option.
32
+ If you don't want to run the `bundle` command after bumping, add the `--no-bundle` option.
33
33
 
34
34
  bump patch --no-bundle
35
35
 
@@ -54,6 +54,7 @@ Bump::Bump.current # -> "1.2.3"
54
54
  - VERSION file with "1.2.3"
55
55
  - gemspec with `gem.version = "1.2.3"` or `Gem:Specification.new "gem-name", "1.2.3" do`
56
56
  - lib/**/version.rb file with `VERSION = "1.2.3"`
57
+ - metadata.rb with `version "1.2.3"`
57
58
 
58
59
  # Todo
59
60
 
data/bump.gemspec CHANGED
@@ -1,5 +1,5 @@
1
1
  Gem::Specification.new "bump" do |s|
2
- s.version = "0.3.10"
2
+ s.version = "0.3.11"
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
@@ -72,6 +72,7 @@ module Bump
72
72
  version_from_gemspec ||
73
73
  version_from_version ||
74
74
  version_from_lib_rb ||
75
+ version_from_chef ||
75
76
  raise(UnfoundVersionFileError)
76
77
  )
77
78
  raise UnfoundVersionError unless version
@@ -101,6 +102,12 @@ module Bump
101
102
  extract_version_from_file(file)
102
103
  end
103
104
 
105
+ def self.version_from_chef
106
+ file = find_version_file("metadata.rb")
107
+ return unless file && File.read(file) =~ /^version\s+(['"])(#{VERSION_REGEX})['"]/
108
+ [$2, file]
109
+ end
110
+
104
111
  def self.extract_version_from_file(file)
105
112
  return unless version = File.read(file)[VERSION_REGEX]
106
113
  [version, file]
data/spec/bump_spec.rb CHANGED
@@ -320,6 +320,20 @@ describe Bump do
320
320
  end
321
321
  end
322
322
 
323
+ context "version in metadata.rb" do
324
+ let(:version) { "1.2.3" }
325
+ let(:version_file) { "metadata.rb" }
326
+
327
+ before do
328
+ write version_file, "foo :bar\nversion '#{version}'\nbar :baz\n"
329
+ end
330
+
331
+ it "should bump version" do
332
+ bump("minor").should include("1.3.0")
333
+ read(version_file).should include("1.3.0")
334
+ end
335
+ end
336
+
323
337
  private
324
338
 
325
339
  def bump(command="", options={})
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.10
4
+ version: 0.3.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: