bump 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -2
- data/lib/bump.rb +20 -2
- data/lib/bump/tasks.rb +8 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e51fb92b564a485b205bc5e725905e6f7bd4420e
|
4
|
+
data.tar.gz: a4a95a2a928ded911a5b8e47e83deb8d03dc374a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cc285263fa2ba6afe4bf7f5c255255acb082256e113917a8f64fdeb2b4d5f11376167cf602bba2eaca8bda9e612479e5a65d8b69cf83da1b079d4c1ea782d76
|
7
|
+
data.tar.gz: d71c9c942424c8a59a6f2fc41d2953266ae2465ef242127cea2a3946f929ee56d53710ae36a695e596288a9782663fa62fef6422ba7d5b72e70e4e9d8dfae11c
|
data/README.md
CHANGED
@@ -56,14 +56,24 @@ or
|
|
56
56
|
require "bump/tasks"
|
57
57
|
|
58
58
|
#
|
59
|
-
# if you want to always tag the
|
59
|
+
# if you want to always tag the version, add:
|
60
60
|
# Bump.tag_by_default = true
|
61
61
|
#
|
62
62
|
|
63
63
|
```
|
64
|
+
|
65
|
+
rake bump:current # display current version
|
64
66
|
|
67
|
+
# bumping using defaults for `COMMIT`, `TAG`, and `BUNDLE`
|
68
|
+
rake bump:major
|
65
69
|
rake bump:patch
|
66
|
-
rake bump:
|
70
|
+
rake bump:minor
|
71
|
+
rake bump:pre
|
72
|
+
|
73
|
+
# bumping with option(s)
|
74
|
+
rake bump:patch TAG=false BUNDLE=false # commit, but don't tag or run `bundle`
|
75
|
+
rake bump:patch COMMIT=false TAG=false # don't commit, don't tag
|
76
|
+
rake bump:minor BUNDLE=false # don't run `bundle`
|
67
77
|
|
68
78
|
### Ruby
|
69
79
|
```Ruby
|
data/lib/bump.rb
CHANGED
@@ -4,6 +4,7 @@ module Bump
|
|
4
4
|
class UnfoundVersionError < StandardError; end
|
5
5
|
class TooManyVersionFilesError < StandardError; end
|
6
6
|
class UnfoundVersionFileError < StandardError; end
|
7
|
+
class RakeArgumentsDeprecatedError < StandardError; end
|
7
8
|
|
8
9
|
class <<self
|
9
10
|
attr_accessor :tag_by_default
|
@@ -19,9 +20,9 @@ module Bump
|
|
19
20
|
|
20
21
|
def defaults
|
21
22
|
{
|
23
|
+
:tag => ::Bump.tag_by_default,
|
22
24
|
:commit => true,
|
23
|
-
:bundle => File.exist?("Gemfile")
|
24
|
-
:tag => ::Bump.tag_by_default
|
25
|
+
:bundle => File.exist?("Gemfile")
|
25
26
|
}
|
26
27
|
end
|
27
28
|
|
@@ -55,8 +56,25 @@ module Bump
|
|
55
56
|
current_info.first
|
56
57
|
end
|
57
58
|
|
59
|
+
def parse_cli_options!(options)
|
60
|
+
options.each do |key, value|
|
61
|
+
options[key] = parse_cli_options_value(value)
|
62
|
+
end
|
63
|
+
options.delete_if{|key, value| value.nil?}
|
64
|
+
end
|
65
|
+
|
58
66
|
private
|
59
67
|
|
68
|
+
def parse_cli_options_value(value)
|
69
|
+
case value
|
70
|
+
when "true" then true
|
71
|
+
when "false" then false
|
72
|
+
when "nil" then nil
|
73
|
+
else
|
74
|
+
value
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
60
78
|
def bump(file, current, next_version, options)
|
61
79
|
replace(file, current, next_version)
|
62
80
|
if options[:bundle] and Dir.glob('*.gemspec').any? and under_version_control?("Gemfile.lock")
|
data/lib/bump/tasks.rb
CHANGED
@@ -15,7 +15,14 @@ namespace :bump do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
task bump, :tag do |_task, args|
|
18
|
-
|
18
|
+
raise RakeArgumentsDeprecatedError,
|
19
|
+
"rake arguments are deprecated, use TAG=false to disable tagging" if args.tag
|
20
|
+
options = {
|
21
|
+
tag: ENV['TAG'],
|
22
|
+
commit: ENV['COMMIT'],
|
23
|
+
bundle: ENV['BUNDLE']
|
24
|
+
}
|
25
|
+
run_bump.call(bump, Bump::Bump.parse_cli_options!(options))
|
19
26
|
end
|
20
27
|
end
|
21
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory Marcilhacy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,30 +28,30 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
description:
|
56
56
|
email: g.marcilhacy@gmail.com
|
57
57
|
executables:
|