bumpy 0.1.0
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.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +27 -0
- data/Rakefile +2 -0
- data/bin/bumpy +50 -0
- data/bumpy.gemspec +19 -0
- data/lib/bumpy/version.rb +3 -0
- data/lib/bumpy.rb +4 -0
- metadata +67 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Hendrik Mans
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Bumpy
|
2
|
+
|
3
|
+
**Bumpy bumps your gem's version number.** It expects your gem's version number to be contained in a file named `./lib/yourgem/version.rb`. Bumpy will parse this file, increase the last part of the contained version number by one, save the file, and create a new git commit (if you're using git).
|
4
|
+
|
5
|
+
Bumpy will happily work with whatever version numbering scheme you're using, as long as the last part is a number. For example, it will increase `0.1.8` to `0.1.9`, or `1.2.0.pre.245` to `1.2.0.pre.246`.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
gem install bumpy
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
From within your gem's source code directory, simply run:
|
14
|
+
|
15
|
+
bumpy
|
16
|
+
|
17
|
+
If you want to jump to a specific version number, you can provide it as a parameter:
|
18
|
+
|
19
|
+
bumpy 2.0.0
|
20
|
+
|
21
|
+
For a complete list of options, run:
|
22
|
+
|
23
|
+
bumpy --help
|
24
|
+
|
25
|
+
Enjoy. :)
|
26
|
+
|
27
|
+
- Hendrik Mans, http://hmans.io
|
data/Rakefile
ADDED
data/bin/bumpy
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'trollop'
|
3
|
+
require 'bumpy'
|
4
|
+
|
5
|
+
opts = Trollop::options do
|
6
|
+
version "bumpy #{Bumpy::VERSION} by Hendrik Mans"
|
7
|
+
banner <<-EOS
|
8
|
+
Bumpy bumps your gem's version number.
|
9
|
+
|
10
|
+
Usage: bumpy [options] [version]
|
11
|
+
|
12
|
+
Available Options:
|
13
|
+
EOS
|
14
|
+
|
15
|
+
|
16
|
+
opt :dryrun, "Dry run (no writing or committing)"
|
17
|
+
opt :no_git, "Don't automatically create git commit"
|
18
|
+
end
|
19
|
+
|
20
|
+
EXPR = %r{VERSION = ['"](.+)['"]}
|
21
|
+
opts[:new_version] = ARGV.shift
|
22
|
+
|
23
|
+
|
24
|
+
Dir['./lib/**/version.rb'].each do |name|
|
25
|
+
contents = File.read(name)
|
26
|
+
if contents =~ EXPR
|
27
|
+
opts[:new_version] ||= begin
|
28
|
+
parts = $1.split('.')
|
29
|
+
parts[-1] = parts[-1].to_i + 1
|
30
|
+
parts.join '.'
|
31
|
+
end
|
32
|
+
|
33
|
+
puts "Bumping version number found in #{name} to #{opts[:new_version]}"
|
34
|
+
contents.sub!(EXPR, "VERSION = \"#{opts[:new_version]}\"")
|
35
|
+
|
36
|
+
unless opts[:dryrun]
|
37
|
+
File.write(name, contents)
|
38
|
+
|
39
|
+
# create git commit
|
40
|
+
if File.exists?('./.git') && !opts[:no_git]
|
41
|
+
puts "Creating git commit"
|
42
|
+
system "git add #{name} && git commit -m 'Bump version to #{opts[:new_version]}'"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
break
|
47
|
+
end
|
48
|
+
|
49
|
+
puts "No version file found. :("
|
50
|
+
end
|
data/bumpy.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/bumpy/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Hendrik Mans"]
|
6
|
+
gem.email = ["hendrik@mans.de"]
|
7
|
+
gem.description = %q{Bumpy bumps your gem's version number.}
|
8
|
+
gem.summary = %q{Bumpy bumps your gem's version number.}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "bumpy"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Bumpy::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency 'trollop'
|
19
|
+
end
|
data/lib/bumpy.rb
ADDED
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bumpy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Hendrik Mans
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-31 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: trollop
|
16
|
+
requirement: &70219180943460 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70219180943460
|
25
|
+
description: Bumpy bumps your gem's version number.
|
26
|
+
email:
|
27
|
+
- hendrik@mans.de
|
28
|
+
executables:
|
29
|
+
- bumpy
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- .gitignore
|
34
|
+
- Gemfile
|
35
|
+
- LICENSE
|
36
|
+
- README.md
|
37
|
+
- Rakefile
|
38
|
+
- bin/bumpy
|
39
|
+
- bumpy.gemspec
|
40
|
+
- lib/bumpy.rb
|
41
|
+
- lib/bumpy/version.rb
|
42
|
+
homepage: ''
|
43
|
+
licenses: []
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options: []
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
requirements: []
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 1.8.11
|
63
|
+
signing_key:
|
64
|
+
specification_version: 3
|
65
|
+
summary: Bumpy bumps your gem's version number.
|
66
|
+
test_files: []
|
67
|
+
has_rdoc:
|