reissue 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b29a6f2ef60fb2fcd7c8a87473a6331b7761c6396f1274128821540f562ec06c
4
- data.tar.gz: fd813df98ea7a642b4b65895db0155a5ba34100f65358fbd0fb65863fcb992d4
3
+ metadata.gz: d7a30f436a8c3bdf476c8ef3a7547536e292b3b81cf207ff8efe92404eacf2e9
4
+ data.tar.gz: 20d5e0d023af7778e0de3d71859088b5baa216bc00c7ef09a46732e1dcc0712a
5
5
  SHA512:
6
- metadata.gz: ed99a9041e9ab54640c75d5eb5ff6dc86688a120069d8b5d9c866f0299c15c883bc4e7aecb7cd511c43e44dc4667d4f029e7cbab794ad84a4d45b9c43a7b8da7
7
- data.tar.gz: f693b77d20a53cd92619efc3d3c984d93788b98caaac3d88a853bed175b8c7f589f8d4837196769dd8f9f6f7650a5c23dab1a956140c4bf774f5001df6b953d1
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.0] - 2024-07-02
8
+ ## [0.2.2] - 2024-09-06
9
9
 
10
10
  ### Added
11
11
 
12
- - Reissue::Markdown class to implement the Reissue::Parser.parse behavior
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
- - Handle multiline changes
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.8] - Unreleased
23
-
24
- ### Changed
20
+ ## [0.2.1] - 2024-07-29
25
21
 
26
- - Update the README.md to specify the default values for some configuration.
22
+ ### Added
27
23
 
28
- ## [0.1.7] - 2024-06-10
24
+ - Release notes and the checksum for the 0.2.0 version
29
25
 
30
- ### Fixed
26
+ ### Changed
31
27
 
32
- - Pass the version_redo_proc to the Reissue.call in the reissue task.
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
@@ -16,5 +16,5 @@ require_relative "lib/reissue/gem"
16
16
 
17
17
  Reissue::Task.create :reissue do |task|
18
18
  task.version_file = "lib/reissue/version.rb"
19
- task.commit = true
19
+ task.push_finalize = :branch
20
20
  end
@@ -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].filter_map { |str| str unless str.empty? }.join("\n\n")
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
- attr_accessor :updated_paths
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reissue
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
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.0
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-07-02 00:00:00.000000000 Z
11
+ date: 2024-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake