reissue 0.2.0 → 0.2.2
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 +4 -4
- data/CHANGELOG.md +10 -14
- data/README.md +16 -0
- data/Rakefile +1 -1
- data/lib/reissue/printer.rb +1 -1
- data/lib/reissue/rake.rb +37 -1
- data/lib/reissue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7a30f436a8c3bdf476c8ef3a7547536e292b3b81cf207ff8efe92404eacf2e9
|
4
|
+
data.tar.gz: 20d5e0d023af7778e0de3d71859088b5baa216bc00c7ef09a46732e1dcc0712a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fea5c4c4d7c7c4d7abcd43d038e9566de875892ee2cda0e95730f69c4108fd3a0304f99ec5ab3bcdd17b104719280b7610061973217eb9fc1277d265cb017238
|
7
|
+
data.tar.gz: 24a0fcfb969d6ba3640e3594a268cd192aa5b7316b49e88aa7059f918bfdb9fb0728aaf81df11cd3a61950ffea47af6c30d07725c12c6bdeac5ff742f08991e9
|
data/CHANGELOG.md
CHANGED
@@ -5,28 +5,24 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
7
7
|
|
8
|
-
## [0.2.
|
8
|
+
## [0.2.2] - 2024-09-06
|
9
9
|
|
10
10
|
### Added
|
11
11
|
|
12
|
-
-
|
13
|
-
|
14
|
-
### Removed
|
15
|
-
|
16
|
-
- Reissue::Parser implementation
|
12
|
+
- Add a `reissue:branch` task to create a new branch for the next version
|
13
|
+
- Add a `reissue:push` task to push the new branch to the remote repository
|
17
14
|
|
18
15
|
### Fixed
|
19
16
|
|
20
|
-
-
|
17
|
+
- Require the 'date' library in tests to ensure the Date constant is present
|
18
|
+
- Ensure that `updated_paths` are always enumerable
|
21
19
|
|
22
|
-
## [0.1
|
23
|
-
|
24
|
-
### Changed
|
20
|
+
## [0.2.1] - 2024-07-29
|
25
21
|
|
26
|
-
|
22
|
+
### Added
|
27
23
|
|
28
|
-
|
24
|
+
- Release notes and the checksum for the 0.2.0 version
|
29
25
|
|
30
|
-
###
|
26
|
+
### Changed
|
31
27
|
|
32
|
-
-
|
28
|
+
- Return the new version from the reissue task
|
data/README.md
CHANGED
@@ -52,6 +52,10 @@ This will add the following rake tasks:
|
|
52
52
|
the latest version.
|
53
53
|
- `rake reissue:reformat[version_limit]` - Reformat the CHANGELOG.md file and
|
54
54
|
optionally limit the number of versions to maintain.
|
55
|
+
- `rake reissue:branch[branch-name]` - Create a new branch for the next version.
|
56
|
+
Controlled by the `push_finalize` and `commit_finalize` options.
|
57
|
+
- `rake reissue:push` - Push the changes to the remote repository. Controlled
|
58
|
+
by the `push_finalize` and `commit_finalize` options.
|
55
59
|
|
56
60
|
This will also update the `build` task from rubygems to first run
|
57
61
|
`reissue:finalize` and then build the gem, ensuring that your changelog is
|
@@ -105,6 +109,9 @@ Reissue::Task.create :your_name_and_namespace do |task|
|
|
105
109
|
|
106
110
|
# Optional: Whether or not to commit the results of the finalize task. Defaults to true.
|
107
111
|
task.commit_finalize = false
|
112
|
+
|
113
|
+
# Optional: Whether to push the changes automatically. Defaults to false.
|
114
|
+
task.push_finalize = :branch # or false, or true to push the working branch
|
108
115
|
end
|
109
116
|
```
|
110
117
|
|
@@ -112,6 +119,15 @@ end
|
|
112
119
|
|
113
120
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
114
121
|
|
122
|
+
## Releasing
|
123
|
+
|
124
|
+
Run `rake build:checksum` to build the gem and generate the checksum. This will also update the version number in the gemspec file.
|
125
|
+
|
126
|
+
Run `rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
127
|
+
|
128
|
+
This will leave a new commit with the version number incremented in the version file and the changelog updated with the new version.
|
129
|
+
Push the changes to the repository.
|
130
|
+
|
115
131
|
## Contributing
|
116
132
|
|
117
133
|
Bug reports and pull requests are welcome on GitHub at https://github.com/SOFware/reissue.
|
data/Rakefile
CHANGED
data/lib/reissue/printer.rb
CHANGED
@@ -28,7 +28,7 @@ module Reissue
|
|
28
28
|
changes_string = changes.map do |section, section_changes|
|
29
29
|
format_section(section, section_changes)
|
30
30
|
end.join("\n\n")
|
31
|
-
[version_string, changes_string].
|
31
|
+
[version_string, changes_string].reject { |str| str.empty? }.join("\n\n")
|
32
32
|
end.then do |data|
|
33
33
|
if data.empty?
|
34
34
|
"## [0.0.0] - Unreleased"
|
data/lib/reissue/rake.rb
CHANGED
@@ -32,7 +32,11 @@ module Reissue
|
|
32
32
|
attr_accessor :changelog_file
|
33
33
|
|
34
34
|
# Additional paths to add to the commit.
|
35
|
-
|
35
|
+
attr_writer :updated_paths
|
36
|
+
|
37
|
+
def updated_paths
|
38
|
+
Array(@updated_paths)
|
39
|
+
end
|
36
40
|
|
37
41
|
# Whether to commit the changes. Default: true.
|
38
42
|
attr_accessor :commit
|
@@ -40,6 +44,14 @@ module Reissue
|
|
40
44
|
# Whether to commit the finalize change to the changelog. Default: true.
|
41
45
|
attr_accessor :commit_finalize
|
42
46
|
|
47
|
+
# Whether to branch and push the changes. Default: :branch.
|
48
|
+
# Requires commit_finialize to be true.
|
49
|
+
#
|
50
|
+
# Set this to false to disable pushing.
|
51
|
+
# Set this to true to push to the current branch.
|
52
|
+
# Set this to :branch to push to a new branch.
|
53
|
+
attr_accessor :push_finalize
|
54
|
+
|
43
55
|
def initialize(name = :reissue)
|
44
56
|
@name = name
|
45
57
|
@description = "Prepare the code for work on a new version."
|
@@ -48,10 +60,19 @@ module Reissue
|
|
48
60
|
@changelog_file = "CHANGELOG.md"
|
49
61
|
@commit = true
|
50
62
|
@commit_finalize = true
|
63
|
+
@push_finalize = false
|
51
64
|
@version_limit = 2
|
52
65
|
@version_redo_proc = nil
|
53
66
|
end
|
54
67
|
|
68
|
+
def finalize_with_branch?
|
69
|
+
push_finalize == :branch
|
70
|
+
end
|
71
|
+
|
72
|
+
def push_finalize?
|
73
|
+
!!push_finalize
|
74
|
+
end
|
75
|
+
|
55
76
|
def define
|
56
77
|
desc description
|
57
78
|
task name, [:segment] do |task, args|
|
@@ -74,6 +95,8 @@ module Reissue
|
|
74
95
|
else
|
75
96
|
system("echo '#{bump_message}'")
|
76
97
|
end
|
98
|
+
|
99
|
+
new_version
|
77
100
|
end
|
78
101
|
|
79
102
|
desc "Reformat the changelog file to ensure it is correctly formatted."
|
@@ -92,12 +115,25 @@ module Reissue
|
|
92
115
|
version, date = Reissue.finalize(date, changelog_file:)
|
93
116
|
finalize_message = "Finalize the changelog for version #{version} on #{date}"
|
94
117
|
if commit_finalize
|
118
|
+
Rake::Task["#{name}:branch"].invoke("reissue/#{version}") if finalize_with_branch?
|
95
119
|
system("git add -u")
|
96
120
|
system("git commit -m '#{finalize_message}'")
|
121
|
+
Rake::Task["#{name}:push"].invoke if push_finalize?
|
97
122
|
else
|
98
123
|
system("echo '#{finalize_message}'")
|
99
124
|
end
|
100
125
|
end
|
126
|
+
|
127
|
+
desc "Create a new branch for the next version."
|
128
|
+
task "#{name}:branch", [:branch] do |task, args|
|
129
|
+
raise "No branch name specified" unless args[:branch]
|
130
|
+
system("git checkout -b #{args[:branch]}")
|
131
|
+
end
|
132
|
+
|
133
|
+
desc "Push the current branch to the remote repository."
|
134
|
+
task "#{name}:push" do
|
135
|
+
system("git push origin HEAD")
|
136
|
+
end
|
101
137
|
end
|
102
138
|
end
|
103
139
|
end
|
data/lib/reissue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reissue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|