reissue 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -21
- data/README.md +9 -0
- data/lib/reissue/parser.rb +3 -3
- data/lib/reissue/printer.rb +9 -3
- data/lib/reissue/version.rb +1 -1
- data/lib/reissue/version_updater.rb +38 -7
- data/lib/reissue.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f27889f6d76a5e88ff44237fff80ff0364d9659bc8d656d23a508a6c5950dd44
|
4
|
+
data.tar.gz: 102c22650f1cc0e74775efe6b79646bc4f4aec3063aef2a9b8c6c0492849725e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef4281eae4ac476c5373b3980df1a5680664fa5a29eef206ff11649363e032d50d877dda2c6fb0d568fcd431de8a00653b8f13383f73cd7dbc4054ecfe0c8456
|
7
|
+
data.tar.gz: 56581361691afd94738f157cf7b0d85d0fdfe9e449575ca95ea61d5f8c1de0a9c3d329e2a12162c0165082e41425016cb78482a088018128f06ac0a6ab7ecb4c
|
data/CHANGELOG.md
CHANGED
@@ -1,35 +1,26 @@
|
|
1
|
-
#
|
1
|
+
# Changelog
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
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.1.
|
8
|
+
## [0.1.3] - 2024-06-09
|
9
9
|
|
10
|
-
###
|
10
|
+
### Added
|
11
11
|
|
12
|
-
-
|
12
|
+
- Support for alhpa characters in version numbers
|
13
|
+
- Support for English names for Greek alphabet letters in version numbers
|
13
14
|
|
14
|
-
|
15
|
+
### Fixed
|
15
16
|
|
16
|
-
|
17
|
+
- Reissue.finalize returns the version and value as an array
|
18
|
+
- Documentation on the refined redo method in Gem::Version
|
19
|
+
- Limit major numbers to Integers
|
20
|
+
- Handle empty changelog files
|
17
21
|
|
18
|
-
|
19
|
-
- handling of brackets in the changelog version numbers
|
20
|
-
- Reissue::Parser class to parse the changelog file
|
21
|
-
- Reissue::Printer class to print the changelog file
|
22
|
-
- Reissue::Task class to handle the creation of reissue tasks
|
23
|
-
- Return version and date from Reissue.finalize
|
24
|
-
- Ability to limit the number of versions to maintain
|
25
|
-
- Gem release support
|
26
|
-
- Description of how to use and configure the gem in the README.md
|
22
|
+
## [0.1.2] - 2024-06-08
|
27
23
|
|
28
24
|
### Fixed:
|
29
25
|
|
30
|
-
-
|
31
|
-
- format of the changelog file
|
32
|
-
|
33
|
-
### Removed:
|
34
|
-
|
35
|
-
- dependency on the keepachangelog gem
|
26
|
+
- Fix references to Gem::Version from the top level
|
data/README.md
CHANGED
@@ -12,6 +12,15 @@ update the changelog with a new version and a date.
|
|
12
12
|
|
13
13
|
Use Reissue to prepare your first commit going into the new version.
|
14
14
|
|
15
|
+
Standard procedure for releasing projects with Reissue:
|
16
|
+
|
17
|
+
1. Create a version with some number like 0.1.0.
|
18
|
+
2. Add commits to the project. These will be associated with the version 0.1.0.
|
19
|
+
3. When you are releasing your project, finalize it by running
|
20
|
+
`rake reissue:finalize` to update the Unreleased version in your changelog.
|
21
|
+
4. Bump the version to 0.1.1 with `rake reissue[patch]` and commit those changes.
|
22
|
+
Future commits will be associated with the version 0.1.1 until your next release.
|
23
|
+
|
15
24
|
## Installation
|
16
25
|
|
17
26
|
Install the gem and add to the application's Gemfile by executing:
|
data/lib/reissue/parser.rb
CHANGED
@@ -30,14 +30,14 @@ module Reissue
|
|
30
30
|
|
31
31
|
def parse_title(scanner)
|
32
32
|
scanner.scan(/# ([\w\s]+)$/)
|
33
|
-
title = scanner[1].strip
|
33
|
+
title = scanner[1].to_s.strip
|
34
34
|
{"title" => title}
|
35
35
|
end
|
36
36
|
|
37
37
|
def parse_preamble(scanner)
|
38
38
|
preamble = scanner.scan_until(VERSION_MATCH)
|
39
|
-
preamble = preamble.gsub(VERSION_BREAK, "").strip
|
40
|
-
scanner.unscan
|
39
|
+
preamble = preamble.to_s.gsub(VERSION_BREAK, "").strip
|
40
|
+
scanner.unscan unless preamble.empty?
|
41
41
|
{"preamble" => preamble.strip}
|
42
42
|
end
|
43
43
|
|
data/lib/reissue/printer.rb
CHANGED
@@ -2,8 +2,8 @@ module Reissue
|
|
2
2
|
class Printer
|
3
3
|
def initialize(changelog)
|
4
4
|
@changelog = changelog
|
5
|
-
@title = @changelog["title"]
|
6
|
-
@preamble = @changelog["preamble"]
|
5
|
+
@title = @changelog["title"] || "Changelog"
|
6
|
+
@preamble = @changelog["preamble"] || "All project changes are documented in this file."
|
7
7
|
@versions = versions
|
8
8
|
end
|
9
9
|
|
@@ -29,7 +29,13 @@ module Reissue
|
|
29
29
|
format_section(section, changes)
|
30
30
|
end.join("\n\n")
|
31
31
|
[version_string, changes_string].filter_map { |str| str unless str.empty? }.join("\n\n")
|
32
|
-
end.
|
32
|
+
end.then do |data|
|
33
|
+
if data.empty?
|
34
|
+
"## [0.0.0] - Unreleased"
|
35
|
+
else
|
36
|
+
data.join("\n\n")
|
37
|
+
end
|
38
|
+
end
|
33
39
|
end
|
34
40
|
|
35
41
|
def format_section(section, changes)
|
data/lib/reissue/version.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
module Reissue
|
2
|
+
module_function def greeks
|
3
|
+
%w[alpha beta gamma delta epsilon zeta eta theta kappa lambda mu nu xi omicron pi rho sigma tau upsilon phi chi psi omega]
|
4
|
+
end
|
5
|
+
|
2
6
|
# Provides versioning functionality for the application.
|
3
7
|
module Versioning
|
4
8
|
# Provides versioning functionality for the application.
|
@@ -6,15 +10,41 @@ module Reissue
|
|
6
10
|
# Redoes the version based on the specified segment_name.
|
7
11
|
#
|
8
12
|
# @param segment_name [Symbol] The segment_name to redo the version.
|
9
|
-
# Possible values are :major, :minor, or
|
13
|
+
# Possible values are :major, :minor, :patch, or :pre.
|
10
14
|
# @return [Gem::Version] The updated version.
|
11
15
|
def redo(segment_name)
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
new_segments = case segment_name.to_sym
|
17
|
+
when :major
|
18
|
+
[segments[0].next, 0, 0]
|
19
|
+
when :minor
|
20
|
+
[segments[0], segments[1].next, 0]
|
21
|
+
when :patch
|
22
|
+
segments.slice(0, 2) + segments.slice(2..-1).then { |array|
|
23
|
+
array[-1] = array[-1].next
|
24
|
+
[array.map(&:to_s).join]
|
25
|
+
}
|
26
|
+
when :pre
|
27
|
+
segments.slice(0, 3) + segments.slice(3..-1).then { |array|
|
28
|
+
array[-1] = array[-1].next
|
29
|
+
[array.map(&:to_s).join]
|
30
|
+
}
|
31
|
+
else
|
32
|
+
raise ArgumentError, "Invalid segment name: #{segment_name}"
|
33
|
+
end
|
34
|
+
::Gem::Version.create(new_segments.join("."))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
refine ::String do
|
39
|
+
def greek?
|
40
|
+
Reissue.greeks.include?(downcase)
|
41
|
+
end
|
42
|
+
|
43
|
+
def next
|
44
|
+
if greek?
|
45
|
+
Reissue.greeks[Reissue.greeks.index(downcase).next]
|
16
46
|
else
|
17
|
-
|
47
|
+
succ
|
18
48
|
end
|
19
49
|
end
|
20
50
|
end
|
@@ -62,7 +92,8 @@ module Reissue
|
|
62
92
|
# Regular expression pattern for matching the version string.
|
63
93
|
#
|
64
94
|
# @return [Regexp] The version regex pattern.
|
65
|
-
|
95
|
+
VERSION_MATCH = /(?<major>\d+)\.(?<minor>[a-zA-Z\d]+)\.(?<patch>[a-zA-Z\d]+)(?<add>\.(?<pre>[a-zA-Z\d]+))?/
|
96
|
+
def version_regex = VERSION_MATCH
|
66
97
|
|
67
98
|
# Writes the updated version to the specified file.
|
68
99
|
#
|
data/lib/reissue.rb
CHANGED
@@ -42,7 +42,7 @@ module Reissue
|
|
42
42
|
def self.finalize(date = Date.today, changelog_file: "CHANGELOG.md")
|
43
43
|
changelog_updater = ChangelogUpdater.new(changelog_file)
|
44
44
|
changelog = changelog_updater.finalize(date:, changelog_file:)
|
45
|
-
changelog["versions"].first.slice("version", "date")
|
45
|
+
changelog["versions"].first.slice("version", "date").values
|
46
46
|
end
|
47
47
|
|
48
48
|
# Reformats the changelog file to ensure it is correctly formatted.
|