bumpversion 0.3.2 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a583f181e8fa65d58b13c7aa9d7c8444e05ab7d5
4
- data.tar.gz: 150f4f40d44860769b9f2160ffd0790bb1a0eb09
3
+ metadata.gz: d433c8e639a47667e907efe9e0e8e759ddb493e2
4
+ data.tar.gz: e2b3645a109c84892abc25bb132585a4a7a62a13
5
5
  SHA512:
6
- metadata.gz: 00532156bfd8ab63ba24bc024af71656b1f9f2941b9b9f965e02061c2dec3bbe2902ad5a64058c303c9275a1bec6cad7a9820eed5595541792dc02cf32568dfe
7
- data.tar.gz: 32bb4710a7d86d08d6feb7e3465b3faf7f042a66113d636f54813713ea858b3dbd6e6ee6e33a898621c7918b7a5ffcf4e79dfeab7953c4bc69f0ff151e076599
6
+ metadata.gz: fd4a90be5ceca0ec2fdb8544f3a2a610bc24fc4c91f5e99db57566fffe1cbcf481962c781a4eb690d824abf6f1fa5d8cf8b6fb02852601f4aff92529bb206852
7
+ data.tar.gz: 02e5ddc014f105bbd3378ffb817d763dbd31321f7d4d5aac5df9f289bdbdcaa548c101a1c22b78dbda57a86ceb5e54a705917d9b11edbca503b46b72f0331225
@@ -1,4 +1,5 @@
1
1
  require 'trollop'
2
+ require 'bumpversion/version'
2
3
 
3
4
  module Bumpversion
4
5
  class Parser
@@ -8,14 +9,19 @@ module Bumpversion
8
9
  end
9
10
 
10
11
  def mount_banner
12
+ version_number = VERSION
11
13
  Trollop::Parser.new do
14
+ version "Bumpversion #{version_number} ☺"
15
+ usage "bumpversion [options] --part [major|minor|patch]
16
+ where [options] are:"
17
+
12
18
  banner <<-EOS
13
- Bumpversion 0.1.0
19
+ #{version}
14
20
 
15
- Usage:
16
- bumpversion [options]
17
- where [options] are:
21
+ Usage:
22
+ #{usage}
18
23
  EOS
24
+
19
25
  opt :help, 'Show this help!'
20
26
  opt :part, 'The part of the version to increase, [major, minor, patch]', default: 'minor'
21
27
  opt :file, 'The file that will be modified can be multi-files separated by comma.
@@ -1,3 +1,3 @@
1
1
  module Bumpversion
2
- VERSION = '0.3.2'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
@@ -11,6 +11,16 @@ describe Bumpversion::Bumpversion do
11
11
  end
12
12
  end
13
13
 
14
+ context 'mount banner' do
15
+ let(:parser){ Bumpversion::Parser.new({}, {}) }
16
+ let(:capture_stdout){ StringIO.new }
17
+ let(:mount_banner){ parser.mount_banner }
18
+ let!(:educate){ mount_banner.educate(capture_stdout) }
19
+ subject{ capture_stdout.string }
20
+ it{ is_expected.to include "Bumpversion" }
21
+ it{ is_expected.to include Bumpversion::VERSION }
22
+ end
23
+
14
24
  describe 'wihout file' do
15
25
  context 'with current and new version' do
16
26
  let(:arguments) { ['--new-version=1.1.0', '--current-version=1.0.0'] }
@@ -70,10 +80,12 @@ describe Bumpversion::Bumpversion do
70
80
  before do
71
81
  File.write('./spec/files/bumpversion.cfg', "[bumpversion]\ncurrent-version=2.1.1\n")
72
82
  File.write('./spec/files/VERSION', "version=2.1.1\n")
83
+ File.write('./spec/files/VERSION_EXTRA', "version=2.1.1\n")
73
84
  end
74
85
  after(:all) do
75
86
  File.write('./spec/files/bumpversion.cfg', '')
76
87
  File.write('./spec/files/VERSION', '')
88
+ File.write('./spec/files/VERSION_EXTRA', '')
77
89
  end
78
90
  context 'patch' do
79
91
  let(:arguments) { ['--config-file=./spec/files/bumpversion.cfg', '--file=./spec/files/VERSION', '--part=patch'] }
@@ -129,5 +141,24 @@ describe Bumpversion::Bumpversion do
129
141
  expect(File.read('./spec/files/VERSION')).to include("version=3.0.0")
130
142
  end
131
143
  end
144
+ context 'major with extra file' do
145
+ let(:arguments) { ['--config-file=./spec/files/bumpversion.cfg', '--file=./spec/files/VERSION,./spec/files/VERSION_EXTRA', '--part=major'] }
146
+ let(:bump_instance) { Bumpversion::Bumpversion.new arguments }
147
+ let!(:bump_run) { bump_instance.run }
148
+ subject { bump_instance.instance_variable_get(:@options) }
149
+
150
+ it { expect(bump_instance).to be_a Bumpversion::Bumpversion }
151
+ it { is_expected.to be_a Hash }
152
+ it { is_expected.to include :help }
153
+ it { is_expected.to include :part }
154
+ it { is_expected.to include :file }
155
+ it { is_expected.to include current_version: '2.1.1' }
156
+ it { is_expected.to include new_version: '3.0.0' }
157
+ it "do bump file" do
158
+ expect(File.read('./spec/files/bumpversion.cfg')).to include("current-version=3.0.0")
159
+ expect(File.read('./spec/files/VERSION')).to include("version=3.0.0")
160
+ expect(File.read('./spec/files/VERSION_EXTRA')).to include("version=3.0.0")
161
+ end
162
+ end
132
163
  end
133
164
  end
File without changes
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: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dlani Mendes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trollop
@@ -151,6 +151,7 @@ files:
151
151
  - lib/bumpversion/writer.rb
152
152
  - spec/bumpversion_spec.rb
153
153
  - spec/files/VERSION
154
+ - spec/files/VERSION_EXTRA
154
155
  - spec/files/bumpversion.cfg
155
156
  - spec/spec_helper.rb
156
157
  homepage: https://github.com/dlanileonardo/bumpversion
@@ -180,5 +181,6 @@ summary: Auto Bump Version to any project
180
181
  test_files:
181
182
  - spec/bumpversion_spec.rb
182
183
  - spec/files/VERSION
184
+ - spec/files/VERSION_EXTRA
183
185
  - spec/files/bumpversion.cfg
184
186
  - spec/spec_helper.rb