bumpversion 1.0.0 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ee7c37fdf3f69afb4a7b1cf258fc4e19792df1c8cc0d6854d203c951188a33c
4
- data.tar.gz: c148c731dec29928cb268cd737c558ad82fc8fa36bfe4b252e189e931fc41c32
3
+ metadata.gz: 8e00666d98c0afa18d933ebfc38259c0ef63b1f856e4f237b961d9285884fd4a
4
+ data.tar.gz: aedf8c117700fa461b88b7dc7f2f0aa9148a57cf3660190ed8109b3e9622e0dc
5
5
  SHA512:
6
- metadata.gz: fa9c7b28bf7c2cbe6487246e68720b7f052ad30296f8b9e9d9bf88056597eaa4638d8fdcbb4a1d20c57b788f7bebd0d8dfdd0f96446ae913c459021637c8e121
7
- data.tar.gz: e8254cd6fcb8a3b6711dff7f7d5cd85cb931aeed894d73a0c1463a30d0ea7e32831186d579fcff833f10a655ca7bbe37e07887e9a615428b9005639de59c56c3
6
+ metadata.gz: 4915dc60f657dd4aae043c340a549960188c818cfa29608f3c0fe6e8e893d6aafab0efe998ca50782e2d4d49c75080a9c6d71572f1021e4643840507c225fa64
7
+ data.tar.gz: a255667ba4a67ead9f2dcbc921c31743906c9c829d695a79915872204882c8be57a4644e3f9f3f1986d5a51b1972def328a0e78c82486f9b7a7b0640891f9bd9
data/lib/bumpversion.rb CHANGED
@@ -28,6 +28,7 @@ module Bumpversion
28
28
  bump_string = BumpString.new @options
29
29
  @options = bump_string.bump
30
30
  PrettyOutput.sucess("Done!")
31
+
31
32
  @git = GitOperation.new @options
32
33
  end
33
34
 
@@ -45,9 +46,11 @@ module Bumpversion
45
46
  Hook.pre_commit_hook @options
46
47
  PrettyOutput.sucess("Done!")
47
48
 
48
- PrettyOutput.begin("Git Operations")
49
- @git.do!
50
- PrettyOutput.sucess("Done!")
49
+ if @options[:git_commit] || @options[:git_tag] || @options[:git_push]
50
+ PrettyOutput.begin("Git Operations")
51
+ @git.do!
52
+ PrettyOutput.sucess("Done!")
53
+ end
51
54
 
52
55
  PrettyOutput.begin("Pos Commit Hooks")
53
56
  Hook.pos_commit_hook @options
@@ -10,6 +10,7 @@ module Bumpversion
10
10
 
11
11
  def commit!
12
12
  if @options[:git_commit]
13
+ PrettyOutput.info("git commit")
13
14
  file = @options[:file].split(',') + [@options[:config_file]]
14
15
  file += @options[:git_extra_add].split(',') if @options[:git_extra_add]
15
16
  @git.add(file)
@@ -18,12 +19,22 @@ module Bumpversion
18
19
  end
19
20
 
20
21
  def tag!
21
- @git.add_tag("v#{@options[:new_version]}") if @options[:git_tag]
22
+ if @options[:git_tag]
23
+ PrettyOutput.info("git tag")
24
+ @git.add_tag("v#{@options[:new_version]}")
25
+ end
22
26
  end
23
27
 
24
28
  def push!
25
- @git.push if @options[:git_push]
26
- @git.push(@git.remote.name, @git.branch.name, :tags => true) if @options[:git_push] && @options[:git_tag]
29
+ if @options[:git_push]
30
+ @git.push
31
+ if @options[:git_tag]
32
+ PrettyOutput.info("git push with tags")
33
+ @git.push(@git.remote.name, @git.branch.name, :tags => true)
34
+ else
35
+ PrettyOutput.info("git push")
36
+ end
37
+ end
27
38
  end
28
39
 
29
40
  def do!
@@ -19,7 +19,7 @@ module Bumpversion
19
19
  key_given_file = "#{key_given}_file"
20
20
 
21
21
  unless options[key_given.to_sym]
22
- options[key.to_sym] = value
22
+ options[key.to_sym] = %w[yes no].include?(value) ? { "yes" => true, "no" => false }[value] : value
23
23
  options[key_given_file.to_sym] = value
24
24
  end
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module Bumpversion
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
@@ -91,7 +91,7 @@ describe Bumpversion::Bumpversion do
91
91
 
92
92
  describe 'with file' do
93
93
  before do
94
- File.write('./spec/files/bumpversion.cfg', "[bumpversion]\ncurrent-version=2.1.1\n")
94
+ File.write('./spec/files/bumpversion.cfg', "[bumpversion]\ncurrent-version=2.1.1\ngit-commit=no\n")
95
95
  File.write('./spec/files/VERSION', "version=2.1.1\n")
96
96
  File.write('./spec/files/VERSION_EXTRA', "version=2.1.1\n")
97
97
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumpversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dlani Mendes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-11 00:00:00.000000000 Z
11
+ date: 2021-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optimist