raketeer 0.2.8 → 0.2.13

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: 643b4e0e40f07b06dbbeb4e657c933a120913bccd8f11092d2fef59880205ccb
4
- data.tar.gz: eb8cd4d531b70b30194cd262e86ed2a0f43363ccd05bef0480c451f57f9d18c3
3
+ metadata.gz: ec89678553f96bde861d1db36fdf62362a986aae57d48920fcedb4b8d648d1ee
4
+ data.tar.gz: b5b1796833f6ab053e4e8582bb12e221d205bac73a90d2253713d81e206b7585
5
5
  SHA512:
6
- metadata.gz: '098c9e27b22dce5a44dc0030e5d4b784baca723ee3fdea62fb949a7cb470dc9b770094b40000dc914e36351f3ab37c6d3e0d7a41b3a8886a984afdef2854eb97'
7
- data.tar.gz: 70fec0564a8d1a560d365cfd6eca9d9091bd9aa77797701484ec632d437b09924c07c633bd099c2ef656ab277e0566465b15e17d7de78901162def2e77cba249
6
+ metadata.gz: 63a541a44b2cee494a9a113944c390297affdda18e745d6726b755bb9d766f9bbc8ceed58944146e2878a5e57750a83cdbeb036ad8b01758311020894d918209
7
+ data.tar.gz: 035bf26706bc7913dcac4b194a1a3d0ac6816812c76c5aed0713abdf2b7d8cb17942d2762a4592f281755a6bc8ce45db20e88b892d1d0b2854220e7f47e76cd8
data/CHANGELOG.md CHANGED
@@ -1,8 +1,49 @@
1
1
  # Changelog | Raketeer
2
2
 
3
- Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ Format is based on [Keep a Changelog v1.0.0](https://keepachangelog.com/en/1.0.0),
6
+ and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [[Unreleased]](https://github.com/esotericpig/raketeer/compare/v0.2.13...HEAD)
9
+ -
10
+
11
+
12
+ ## [v0.2.13] - [2021-06-22](https://github.com/esotericpig/raketeer/compare/v0.2.12...v0.2.13)
13
+ ### Fixed
14
+ - Changed `bump` to reset lower version numbers.
15
+ - If `v1.1.1`, major +1 will become => `v2.0.0` (not `v2.1.1`).
16
+ - If `v1.1.1`, minor +1 will become => `v1.2.0` (not `v1.2.1`).
17
+ - Patch +1 will continue to work the same.
18
+ - It's debatable whether this is a *fix* or a *change*, but I'm labeling it as a *fix*, as this way is more usable and expected.
19
+ - I debated whether to also drop off the pre-release and build-metadata, but it's a hard decision. Even though the version changed, maybe it's still a pre-release and/or still needs the same build-metadata. You could argue that bumping the major version should always drop it off, but I'm not sure. For now, they are unaffected by this change. In the future, major (only) +1 might also drop pre-release & build-metadata.
20
+
21
+
22
+ ## [v0.2.12] - [2021-06-18](https://github.com/esotericpig/raketeer/compare/v0.2.11...v0.2.12)
23
+ ### Changed
24
+ - Changed `bump` to also update GitHub compare links in Changelogs.
25
+ - Example link in Changelog:
26
+ - `## [v0.2.11] - [2021-06-15](https://github.com/esotericpig/raketeer/compare/v0.2.10...v0.2.11)`
27
+ - Updates `v0.2.10...v0.2.11` to `v0.2.11...<new_version>`.
28
+
29
+
30
+ ## [v0.2.11] - [2021-06-15](https://github.com/esotericpig/raketeer/compare/v0.2.10...v0.2.11)
31
+ ### Changed
32
+ - Added SPDX license ID to source files.
33
+
34
+
35
+ ## [v0.2.10] - 2021-05-30
36
+ ### Changed
37
+ - Formatted all code using RuboCop.
38
+
39
+ ### Fixed
40
+ - Updated Bundler and Gems because of GitHub security warning.
41
+
42
+
43
+ ## [v0.2.9] - 2020-03-01
44
+ ### Changed
45
+ - Changed Gemspec description (mainly for testing other project Raketary)
4
46
 
5
- ## [[Unreleased]](https://github.com/esotericpig/raketeer/compare/v0.2.8...master)
6
47
 
7
48
  ## [v0.2.8] - 2020-03-01
8
49
  ### Added
@@ -10,6 +51,7 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
10
51
  - GitHubPkgTask (lib/raketeer/github_pkg_task.rb)
11
52
  - Publish/Push your `pkg/*.gem` release(s) to GitHub Packages
12
53
 
54
+
13
55
  ## [v0.2.7] - 2019-12-18
14
56
  ### Added
15
57
  - Add more info to README
@@ -21,6 +63,7 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
21
63
  ### Fixed
22
64
  - Check env vars for bundle task in bump task
23
65
 
66
+
24
67
  ## [v0.2.6] - 2019-08-03
25
68
  ### Changed
26
69
  - Refactored BumpTask for a new project I'm working on to use this project in a CLI
@@ -28,6 +71,7 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
28
71
  ### Fixed
29
72
  - SemVer's initialize_copy()
30
73
 
74
+
31
75
  ## [v0.2.5] - 2019-08-02
32
76
  ### Added
33
77
  - Added a strict mode (regex) to BumpTask, BumpVer, FilesBumper, & SemVer
@@ -35,6 +79,7 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
35
79
  ### Fixed
36
80
  - Fixed the 'Nothing written (up-to-date)' feature in BumpTask (minor)
37
81
 
82
+
38
83
  ## [v0.2.4] - 2019-08-02
39
84
  ### Added
40
85
  - BumpTask & 'raketeer/bump'
@@ -49,10 +94,12 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
49
94
  ### Changed
50
95
  - Util.find_main_executable() to not search for 'bin/*.rb' since almost no project uses an extension in the bin directory
51
96
 
97
+
52
98
  ## [v0.2.3] - 2019-07-30
53
99
  ### Fixed
54
100
  - Fixed 'yield' typo in some tasks
55
101
 
102
+
56
103
  ## [v0.2.2] - 2019-07-29
57
104
  ### Added
58
105
  - RunTask & 'raketeer/run'
@@ -63,10 +110,12 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
63
110
  - Refactored some code (minor)
64
111
  - Changed some documentation (minor)
65
112
 
113
+
66
114
  ## [v0.2.1] - 2019-07-24
67
115
  ### Changed
68
116
  - Fixed minor/cosmetic typo
69
117
 
118
+
70
119
  ## [v0.2.0] - 2019-07-24
71
120
  ### Added
72
121
  - All (lib/raketeer/all.rb); used to be Raketeers
@@ -77,18 +126,8 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77
126
  ### Removed
78
127
  - Raketeers (lib/raketeer/raketeers.rb); renamed to All
79
128
 
129
+
80
130
  ## [v0.1.0] - 2019-07-23
81
131
  ### Added
82
- - .gitignore
83
- - CHANGELOG.md
84
- - Gemfile
85
- - LICENSE.txt
86
- - README.md
87
- - Rakefile
88
- - raketeer.gemspec
89
- - lib/raketeer.rb
90
- - lib/raketeer/irb_task.rb
91
- - lib/raketeer/nokogiri_install_tasks.rb
92
- - lib/raketeer/nokogiri_installs.rb
93
- - lib/raketeer/raketeers.rb
94
- - lib/raketeer/version.rb
132
+ - IRB task
133
+ - Nokogiri installs
data/Gemfile CHANGED
@@ -1,24 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
- #--
5
- # This file is part of Raketeer.
6
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
7
- #
8
- # Raketeer is free software: you can redistribute it and/or modify
9
- # it under the terms of the GNU Lesser General Public License as published by
10
- # the Free Software Foundation, either version 3 of the License, or
11
- # (at your option) any later version.
12
- #
13
- # Raketeer is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Lesser General Public License for more details.
17
- #
18
- # You should have received a copy of the GNU Lesser General Public License
19
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
20
- #++
21
-
22
4
 
23
5
  source 'https://rubygems.org'
24
6
 
data/README.md CHANGED
@@ -28,16 +28,17 @@ With the RubyGems CLI package manager:
28
28
  In your *Gemspec* (*&lt;project&gt;.gemspec*):
29
29
 
30
30
  ```Ruby
31
- spec.add_development_dependency 'raketeer', '~> X.X.X'
31
+ spec.add_development_dependency 'raketeer', '~> 0.2'
32
32
  ```
33
33
 
34
34
  In your *Gemfile*:
35
35
 
36
36
  ```Ruby
37
- gem 'raketeer', '~> X.X.X', :group => [:development, :test]
37
+ gem 'raketeer', '~> 0.2', group: [:development, :test]
38
+
38
39
  # or...
39
- gem 'raketeer', :git => 'https://github.com/esotericpig/raketeer.git',
40
- :tag => 'vX.X.X', :group => [:development, :test]
40
+ gem 'raketeer', git: 'https://github.com/esotericpig/raketeer.git',
41
+ tag: 'v0.2.10', group: [:development, :test]
41
42
  ```
42
43
 
43
44
  Manually:
@@ -51,8 +52,6 @@ $ bundle exec rake install:local
51
52
 
52
53
  ## [Using](#contents)
53
54
 
54
- **TODO:** flesh out Using section
55
-
56
55
  **Rakefile**
57
56
 
58
57
  In your *Rakefile*, you can either include all tasks...
@@ -149,7 +148,9 @@ require 'raketeer/bump_task'
149
148
  Raketeer::BumpTask.new() do |task|
150
149
  task.strict = true
151
150
  end
151
+ ```
152
152
 
153
+ ```Ruby
153
154
  require 'raketeer/github_pkg_task'
154
155
 
155
156
  Raketeer::GitHubPkgTask.new() do |task|
@@ -172,7 +173,7 @@ $ bundle exec rake -T
172
173
  [GNU LGPL v3+](LICENSE.txt)
173
174
 
174
175
  > Raketeer (<https://github.com/esotericpig/raketeer>)
175
- > Copyright (c) 2019-2020 Jonathan Bradley Whited (@esotericpig)
176
+ > Copyright (c) 2019-2021 Jonathan Bradley Whited
176
177
  >
177
178
  > Raketeer is free software: you can redistribute it and/or modify
178
179
  > it under the terms of the GNU Lesser General Public License as published by
data/Rakefile CHANGED
@@ -1,24 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
- #--
5
- # This file is part of Raketeer.
6
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
7
- #
8
- # Raketeer is free software: you can redistribute it and/or modify
9
- # it under the terms of the GNU Lesser General Public License as published by
10
- # the Free Software Foundation, either version 3 of the License, or
11
- # (at your option) any later version.
12
- #
13
- # Raketeer is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Lesser General Public License for more details.
17
- #
18
- # You should have received a copy of the GNU Lesser General Public License
19
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
20
- #++
21
-
22
4
 
23
5
  require 'bundler/gem_tasks'
24
6
 
data/lib/raketeer.rb CHANGED
@@ -1,23 +1,11 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019-2020 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: LGPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -34,7 +22,7 @@ require 'raketeer/version'
34
22
 
35
23
 
36
24
  ###
37
- # @author Jonathan Bradley Whited (@esotericpig)
25
+ # @author Jonathan Bradley Whited
38
26
  # @since 0.1.0
39
27
  ###
40
28
  module Raketeer
data/lib/raketeer/all.rb CHANGED
@@ -1,23 +1,11 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019-2020 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: LGPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -31,8 +19,8 @@ require 'raketeer/run' # @since 0.2.2
31
19
  module Raketeer
32
20
  ###
33
21
  # Defines all Raketeer tasks in your Rakefile.
34
- #
35
- # @author Jonathan Bradley Whited (@esotericpig)
22
+ #
23
+ # @author Jonathan Bradley Whited
36
24
  # @since 0.2.0
37
25
  ###
38
26
  module All
data/lib/raketeer/bump.rb CHANGED
@@ -1,23 +1,11 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: LGPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -25,11 +13,11 @@ require 'raketeer/bump_task'
25
13
 
26
14
  module Raketeer
27
15
  ###
28
- # @author Jonathan Bradley Whited (@esotericpig)
16
+ # @author Jonathan Bradley Whited
29
17
  # @since 0.2.4
30
18
  ###
31
19
  module Bump
32
20
  end
33
21
  end
34
22
 
35
- Raketeer::BumpTask.new() # @since 0.2.4
23
+ Raketeer::BumpTask.new # @since 0.2.4
@@ -1,23 +1,11 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: LGPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -31,7 +19,7 @@ require 'raketeer/util'
31
19
 
32
20
  module Raketeer
33
21
  ###
34
- # @author Jonathan Bradley Whited (@esotericpig)
22
+ # @author Jonathan Bradley Whited
35
23
  # @since 0.2.4
36
24
  ###
37
25
  class BumpTask < Rake::TaskLib
@@ -45,30 +33,30 @@ module Raketeer
45
33
  attr_accessor :ruby_files # Looks for {ruby_var}
46
34
  attr_accessor :ruby_var
47
35
  attr_accessor :strict
48
-
36
+
49
37
  alias_method :bump_bundle?,:bump_bundle
50
38
  alias_method :dry_run?,:dry_run
51
39
  alias_method :strict?,:strict
52
-
40
+
53
41
  def initialize(name=:bump)
54
42
  super()
55
-
43
+
56
44
  @bump_bundle = false
57
45
  @bump_files = Rake::FileList[]
58
46
  @bundle_cmd = 'bundle'
59
47
  @changelogs = Rake::FileList['CHANGELOG.md']
60
48
  @dry_run = false
61
- @git_msg = %q(git commit -m 'Bump version to v%{version}')
49
+ @git_msg = "git commit -m 'Bump version to v%{version}'"
62
50
  @name = name
63
51
  @ruby_files = Rake::FileList[File.join('lib','**','version.rb')]
64
52
  @ruby_var = 'VERSION'
65
53
  @strict = false
66
-
67
- yield self if block_given?()
68
- define()
54
+
55
+ yield self if block_given?
56
+ define
69
57
  end
70
-
71
- def define()
58
+
59
+ def define
72
60
  desc 'Show/Set/Bump the version'
73
61
  task @name,[:version] do |task,args|
74
62
  bump_all(BumpVer.new(
@@ -80,249 +68,269 @@ module Raketeer
80
68
  build_meta: ENV['build']
81
69
  ))
82
70
  end
83
-
71
+
84
72
  namespace @name do
85
73
  desc 'Bump/Set the major version'
86
74
  task :major,[:major] do |task,args|
87
75
  bump_ver = BumpVer.new(major: args.major)
88
-
76
+
89
77
  # You can't erase the major version (required)
90
- bump_ver.major = '+1' if bump_ver.major.nil?() || bump_ver.major.empty?()
91
-
78
+ bump_ver.major = '+1' if bump_ver.major.nil? || bump_ver.major.empty?
79
+
92
80
  bump_all(bump_ver)
93
81
  end
94
-
82
+
95
83
  desc 'Bump/Set the minor version'
96
84
  task :minor,[:minor] do |task,args|
97
85
  bump_ver = BumpVer.new(minor: args.minor)
98
- bump_ver.minor = '+1' if bump_ver.minor.nil?()
99
-
86
+ bump_ver.minor = '+1' if bump_ver.minor.nil?
87
+
100
88
  bump_all(bump_ver)
101
89
  end
102
-
90
+
103
91
  desc 'Bump/Set the patch version'
104
92
  task :patch,[:patch] do |task,args|
105
93
  bump_ver = BumpVer.new(patch: args.patch)
106
- bump_ver.patch = '+1' if bump_ver.patch.nil?()
107
-
94
+ bump_ver.patch = '+1' if bump_ver.patch.nil?
95
+
108
96
  bump_all(bump_ver)
109
97
  end
110
-
98
+
111
99
  desc 'Set/Erase the pre-release version'
112
100
  task :pre,[:pre] do |task,args|
113
101
  bump_ver = BumpVer.new(prerelease: args.pre)
114
- bump_ver.prerelease = '' if bump_ver.prerelease.nil?()
115
-
102
+ bump_ver.prerelease = '' if bump_ver.prerelease.nil?
103
+
116
104
  bump_all(bump_ver)
117
105
  end
118
-
106
+
119
107
  desc 'Set/Erase the build metadata'
120
108
  task :build,[:build] do |task,args|
121
109
  bump_ver = BumpVer.new(build_meta: args.build)
122
- bump_ver.build_meta = '' if bump_ver.build_meta.nil?()
123
-
110
+ bump_ver.build_meta = '' if bump_ver.build_meta.nil?
111
+
124
112
  bump_all(bump_ver)
125
113
  end
126
-
114
+
127
115
  desc 'Bump the Gemfile.lock version'
128
116
  task :bundle do
129
- check_env()
130
- bump_bundle_file()
117
+ check_env
118
+ bump_bundle_file
131
119
  end
132
-
120
+
133
121
  desc "Show the help/usage for #{name} tasks"
134
122
  task :help do
135
- print_help()
123
+ print_help
136
124
  end
137
125
  end
138
126
  end
139
-
127
+
140
128
  def bump_all(bump_ver)
141
- check_env()
142
-
129
+ check_env
130
+
143
131
  sem_vers = []
144
-
132
+
145
133
  # Order matters for outputting the most accurate version
146
134
  sem_vers << bump_ruby_files(bump_ver)
147
135
  sem_vers << bump_bump_files(bump_ver)
148
136
  sem_vers << bump_changelogs(bump_ver)
149
-
150
- sem_vers.compact!()
151
-
152
- if sem_vers.empty?()
137
+
138
+ sem_vers.compact!
139
+
140
+ if sem_vers.empty?
153
141
  puts '! No versions found'
154
-
142
+
155
143
  return
156
144
  end
157
-
158
- if @bump_bundle && !bump_ver.empty?()
159
- bump_bundle_file()
145
+
146
+ if @bump_bundle && !bump_ver.empty?
147
+ bump_bundle_file
160
148
  end
161
-
149
+
162
150
  # Always output it, in case the user just wants to see what the git message
163
151
  # should be without making changes.
164
- if !@git_msg.nil?()
152
+ if !@git_msg.nil?
165
153
  puts '[Git]:'
166
- puts '= ' + (@git_msg % {version: sem_vers[0].to_s()})
154
+ puts '= ' + (@git_msg % {version: sem_vers[0].to_s})
167
155
  end
168
156
  end
169
-
157
+
170
158
  def bump_bump_files(bump_ver)
171
- return nil if @bump_files.empty?()
172
-
159
+ return nil if @bump_files.empty?
160
+
173
161
  bumper = FilesBumper.new(@bump_files,bump_ver,@dry_run,@strict)
174
-
175
- bumper.bump_files() do
176
- next if bumper.changes > 0 || !bumper.sem_ver.nil?()
162
+
163
+ bumper.bump_files do
164
+ next if bumper.changes > 0 || !bumper.sem_ver.nil?
177
165
  next if bumper.line !~ SemVer.regex(@strict)
178
-
179
- break if bumper.bump_line!() != :no_ver && bumper.bump_ver_empty?()
166
+
167
+ break if bumper.bump_line! != :no_ver && bumper.bump_ver_empty?
180
168
  end
181
-
169
+
182
170
  return bumper.version
183
171
  end
184
-
185
- def bump_bundle_file()
172
+
173
+ def bump_bundle_file
186
174
  sh_cmd = [@bundle_cmd,'list']
187
-
175
+
188
176
  puts "[#{sh_cmd.join(' ')}]:"
189
-
177
+
190
178
  if @dry_run
191
179
  puts '= Nothing written (dry run)'
192
-
180
+
193
181
  return
194
182
  end
195
-
196
- sh(*sh_cmd,{:verbose => false})
183
+
184
+ sh(*sh_cmd,verbose: false)
197
185
  end
198
-
186
+
199
187
  # @see https://keepachangelog.com/en/1.0.0/
200
188
  def bump_changelogs(bump_ver)
201
- return nil if @changelogs.empty?()
202
-
189
+ return nil if @changelogs.empty?
190
+
203
191
  bumper = FilesBumper.new(@changelogs,bump_ver,@dry_run,@strict) do
204
192
  @header_bumped = false
205
193
  @unreleased_bumped = false
206
194
  end
207
-
195
+
208
196
  header_regex = /\A(\s*##\s*\[+\D*)(#{SemVer.regex(@strict)})(.*)\z/m
209
197
  unreleased_regex = /\A.*Unreleased.*http.*\.{3}/
210
-
211
- bumper.bump_files() do
198
+
199
+ bumper.bump_files do
212
200
  if @header_bumped && @unreleased_bumped
213
- break if bumper.bump_ver_empty?()
201
+ break if bumper.bump_ver_empty?
214
202
  next
215
203
  end
216
-
204
+
217
205
  if bumper.line =~ unreleased_regex
218
206
  next if @unreleased_bumped
219
-
207
+
220
208
  # Match from the end, in case the URL has a number (like '%20')
221
209
  match = bumper.line.match(/(#{SemVer.regex(@strict)})(\.{3}.*)\z/m)
222
-
223
- next if match.nil?() || match.length < 3 || (i = match.begin(0)) < 1
224
-
210
+
211
+ next if match.nil? || match.length < 3 || (i = match.begin(0)) < 1
212
+
225
213
  match = [bumper.line[0..i - 1],match[1],match[-1]]
226
-
227
- next if match.any?() {|m| m.nil?() || m.strip().empty?()}
228
-
229
- orig_line = bumper.line.dup()
214
+
215
+ next if match.any? {|m| m.nil? || m.strip.empty? }
216
+
217
+ orig_line = bumper.line.dup
230
218
  bumper.line = match[1]
231
-
219
+
232
220
  if (result = bumper.bump_line!(add_change: false)) != :no_ver
233
221
  @unreleased_bumped = true
234
-
222
+
235
223
  if result == :same_ver
236
224
  bumper.line = orig_line
237
-
225
+
238
226
  next
239
227
  end
240
-
228
+
241
229
  bumper.line = match[0] << bumper.line << match[2]
242
-
230
+
243
231
  bumper.add_change(bumper.line,push: false)
244
232
  else
245
233
  bumper.line = orig_line
246
234
  end
247
- elsif !(match = bumper.line.match(header_regex)).nil?()
235
+ elsif !(match = bumper.line.match(header_regex)).nil?
248
236
  next if @header_bumped || match.length < 4
249
-
237
+
250
238
  match = [match[1],match[2],match[-1]]
251
-
252
- next if match.any?() {|m| m.nil?() || m.strip().empty?()}
253
-
254
- orig_line = bumper.line.dup()
239
+
240
+ next if match.any? {|m| m.nil? || m.strip.empty? }
241
+
242
+ orig_line = bumper.line.dup
255
243
  bumper.line = match[1]
256
-
244
+
257
245
  if (result = bumper.bump_line!(add_change: false)) != :no_ver
258
246
  @header_bumped = true
259
-
247
+
260
248
  if result == :same_ver
261
249
  bumper.line = orig_line
262
-
250
+
263
251
  next
264
252
  end
265
-
266
- bumper.line = match[0] << bumper.line
267
-
253
+
254
+ bumper.line = (match[0] << bumper.line)
255
+
268
256
  # Replace the date with today's date for the new Markdown header, if it exists
269
- match[2].sub!(/\d+\s*\-\s*\d+\s*\-\s*\d+(.*)\z/m,"#{Date.today().strftime('%F')}\\1")
257
+ match[2].sub!(/\d+\s*\-\s*\d+\s*\-\s*\d+(.*)\z/m,"#{Date.today.strftime('%F')}\\1")
258
+
259
+ # Fix the link if there is one:
260
+ # https://github.com/esotericpig/raketeer/compare/v0.2.10...v0.2.11
261
+ versions_regex = /
262
+ (?<beg_ver>#{SemVer.regex(@strict)})
263
+ (?<sep>\.{3}[^\d\s]{,11}) # 11 for 'v', 'version', or something else.
264
+ (?<end_ver>#{SemVer.regex(@strict)})
265
+ /xmi
266
+ versions_match = match[2].match(versions_regex)
267
+
268
+ if versions_match
269
+ match[2].sub!(versions_regex,
270
+ "#{versions_match[:end_ver]}" \
271
+ "#{versions_match[:sep]}" \
272
+ "#{bumper.sem_ver}"
273
+ )
274
+ end
275
+
270
276
  bumper.line << match[2]
271
-
277
+
272
278
  bumper.add_change(bumper.line,push: true)
273
- bumper.line << "\n" # Don't print this newline to the console
279
+
280
+ # Add after add_change(), so not printed to console.
281
+ bumper.line << "\n\n"
274
282
  end
275
-
283
+
276
284
  # We are adding a new Markdown header, so always set the line back to its original value
277
285
  bumper.line = orig_line
278
286
  end
279
287
  end
280
-
288
+
281
289
  return bumper.version
282
290
  end
283
-
291
+
284
292
  def bump_ruby_files(bump_ver)
285
- return nil if @ruby_files.empty?()
286
-
293
+ return nil if @ruby_files.empty?
294
+
287
295
  bumper = FilesBumper.new(@ruby_files,bump_ver,@dry_run,@strict)
288
296
  version_var_regex = /\A(\s*#{Regexp.quote(@ruby_var)}\s*=\D*)(#{SemVer.regex(@strict)})(.*)\z/m
289
-
290
- bumper.bump_files() do
291
- next if bumper.changes > 0 || !bumper.sem_ver.nil?()
292
- next if (match = bumper.line.match(version_var_regex)).nil?()
297
+
298
+ bumper.bump_files do
299
+ next if bumper.changes > 0 || !bumper.sem_ver.nil?
300
+ next if (match = bumper.line.match(version_var_regex)).nil?
293
301
  next if match.length < 4
294
- next if match[1..2].any?() {|m| m.nil?() || m.strip().empty?()}
295
-
296
- orig_line = bumper.line.dup()
302
+ next if match[1..2].any? {|m| m.nil? || m.strip.empty? }
303
+
304
+ orig_line = bumper.line.dup
297
305
  bumper.line = match[2]
298
-
306
+
299
307
  if (result = bumper.bump_line!(add_change: false)) != :no_ver
300
308
  if result == :same_ver
301
309
  bumper.line = orig_line
302
-
303
- break if bumper.bump_ver_empty?()
310
+
311
+ break if bumper.bump_ver_empty?
304
312
  next
305
313
  end
306
-
314
+
307
315
  bumper.line = match[1] << bumper.line
308
- bumper.line << match[-1] unless match[-1].nil?()
309
-
316
+ bumper.line << match[-1] unless match[-1].nil?
317
+
310
318
  bumper.add_change(bumper.line,push: false)
311
319
  else
312
320
  bumper.line = orig_line
313
321
  end
314
322
  end
315
-
323
+
316
324
  return bumper.version
317
325
  end
318
-
319
- def check_env()
326
+
327
+ def check_env
320
328
  @dry_run = Util.get_env_bool('dryrun',@dry_run)
321
329
  @strict = Util.get_env_bool('strict',@strict)
322
330
  end
323
-
324
- def print_help()
325
- puts <<-EOH
331
+
332
+ def print_help
333
+ puts <<-HELP
326
334
  rake #{@name} # Print the current version
327
335
 
328
336
  # You can run a dry run for any task (will not write to files)
@@ -348,7 +356,7 @@ rake #{@name}:pre[alpha.4] # Set the pre-release version
348
356
  rake #{@name}:build # Erase the build metadata
349
357
  rake #{@name}:build[beta.5] # Set the build metadata
350
358
  rake #{@name}:bundle # Bump the Gemfile.lock version
351
- EOH
359
+ HELP
352
360
  end
353
361
  end
354
362
  end