semantic_release 1.0.0 → 1.1.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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +15 -6
- data/lib/semantic_release/configuration.rb +11 -0
- data/lib/semantic_release/rake_task.rb +7 -5
- data/lib/semantic_release/updaters/base_updater.rb +1 -1
- data/lib/semantic_release/updaters/changelog.rb +1 -1
- data/lib/semantic_release/version.rb +1 -1
- data/lib/semantic_release.rb +9 -4
- metadata +3 -6
- data/.rspec +0 -3
- data/.rubocop.yml +0 -19
- data/.semver +0 -1
- data/Rakefile +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a55331e98f6d84634c6bbc2a629737890a88e9e7ad17a533928f74feb725c621
|
4
|
+
data.tar.gz: 9f026fe48e630dc6d43349ed0db545bc736c8ae6ff09abd7d872a5689fcbeba8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0bd2de32e63c96e7373d797797ec977ac44d3533b60658aaff6be0edca37cee72790081ded9b0327745478a547e127c6bae61b8699b6ba89b9d4546bcd703f2
|
7
|
+
data.tar.gz: e7545da7de6ccc9f8df6e4d9adf550b29f3e764d1741ce189e421ec746ca4ea1a8bf93f6ca4f79de752f45007edd58ee3052385ca4fb23fe2469ce781543ce92
|
data/CHANGELOG.md
CHANGED
@@ -1,2 +1,14 @@
|
|
1
|
+
## 1.1.0 (03 February 2025)
|
2
|
+
|
3
|
+
- Add check to prevent re-initialising if semver file already exists
|
4
|
+
- Add configuration options for semver file
|
5
|
+
- Change rake task namespace from `semantic_release` to `release` and make configurable
|
6
|
+
|
7
|
+
## 1.0.1 (02 February 2025)
|
8
|
+
|
9
|
+
- Add blank line after version number in changelog
|
10
|
+
- Remove unnecessary files from gem
|
11
|
+
|
1
12
|
## 1.0.0 (02 February 2025)
|
13
|
+
|
2
14
|
- Initial release
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ This gem helps you to manage the version number of your application or library.
|
|
5
5
|
Use the provided Rake tasks to:
|
6
6
|
|
7
7
|
- bump the major, minor, or patch number of your version
|
8
|
-
- automatically update
|
8
|
+
- automatically update your version file (e.g. `lib/version.rb`)
|
9
9
|
- automatically update your changelog (`CHANGELOG.md` or `history.rdoc`)
|
10
10
|
- automatically create a git commit and tag for the release
|
11
11
|
|
@@ -38,14 +38,23 @@ require "semantic_release/rake_task"
|
|
38
38
|
SemanticRelease::RakeTask.new
|
39
39
|
```
|
40
40
|
|
41
|
+
The name rake tasks and other options are configurable like so:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
require "semantic_release/rake_task"
|
45
|
+
SemanticRelease::RakeTask.new(:semver) do |config|
|
46
|
+
config.semver_file = "semver.json"
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
41
50
|
The following tasks are available:
|
42
51
|
|
43
52
|
```
|
44
|
-
rake
|
45
|
-
rake
|
46
|
-
rake
|
47
|
-
rake
|
48
|
-
rake
|
53
|
+
rake release:init
|
54
|
+
rake release:current
|
55
|
+
rake release:major
|
56
|
+
rake release:minor
|
57
|
+
rake release:patch
|
49
58
|
```
|
50
59
|
|
51
60
|
To get the current version inside your application:
|
@@ -5,11 +5,13 @@ require "semantic_release"
|
|
5
5
|
|
6
6
|
module SemanticRelease
|
7
7
|
class RakeTask < Rake::TaskLib
|
8
|
-
# rubocop:disable Metrics/MethodLength
|
9
|
-
def initialize
|
10
|
-
super
|
8
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
9
|
+
def initialize(name = :release)
|
10
|
+
super()
|
11
11
|
|
12
|
-
|
12
|
+
yield(SemanticRelease.configuration) if block_given?
|
13
|
+
|
14
|
+
namespace name do
|
13
15
|
desc "Initialise version file"
|
14
16
|
task :init do
|
15
17
|
SemanticRelease.init
|
@@ -36,6 +38,6 @@ module SemanticRelease
|
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
39
|
-
# rubocop:enable Metrics/MethodLength
|
41
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
40
42
|
end
|
41
43
|
end
|
@@ -18,7 +18,7 @@ module SemanticRelease
|
|
18
18
|
heading_marker = filepath.end_with?(".rdoc") ? "==" : "##"
|
19
19
|
content = File.read(filepath)
|
20
20
|
File.open(filepath, "w") do |f|
|
21
|
-
f.puts("#{heading_marker} #{current_version} (#{Time.now.strftime("%d %B %Y")})\n")
|
21
|
+
f.puts("#{heading_marker} #{current_version} (#{Time.now.strftime("%d %B %Y")})\n\n")
|
22
22
|
f.print(content)
|
23
23
|
end
|
24
24
|
end
|
data/lib/semantic_release.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "semantic_release/configuration"
|
3
4
|
require_relative "semantic_release/semver"
|
4
5
|
require_relative "semantic_release/version"
|
5
6
|
Dir[File.join(__dir__, "semantic_release", "updaters", "*.rb")].each { |file| require file }
|
@@ -7,15 +8,19 @@ Dir[File.join(__dir__, "semantic_release", "updaters", "*.rb")].each { |file| re
|
|
7
8
|
module SemanticRelease
|
8
9
|
class Error < StandardError; end
|
9
10
|
|
10
|
-
|
11
|
+
def self.configuration
|
12
|
+
@configuration ||= Configuration.new
|
13
|
+
end
|
11
14
|
|
12
15
|
def self.init
|
16
|
+
raise Error, "#{configuration.semver_file} already exists" if File.exist?(configuration.semver_file)
|
17
|
+
|
13
18
|
version = Semver.new
|
14
|
-
version.save(
|
19
|
+
version.save(configuration.semver_file)
|
15
20
|
end
|
16
21
|
|
17
22
|
def self.current_version
|
18
|
-
Semver.load(
|
23
|
+
Semver.load(configuration.semver_file).to_s
|
19
24
|
end
|
20
25
|
|
21
26
|
def self.inc_major
|
@@ -34,7 +39,7 @@ module SemanticRelease
|
|
34
39
|
end
|
35
40
|
|
36
41
|
def self.increment(term)
|
37
|
-
version = Semver.load(
|
42
|
+
version = Semver.load(configuration.semver_file)
|
38
43
|
version.increment(term)
|
39
44
|
version.save
|
40
45
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_release
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Bull
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-03 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: |
|
13
13
|
This gem helps you to manage the version number of your application or library. It provides Rake tasks to
|
@@ -18,14 +18,11 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
- ".rspec"
|
22
|
-
- ".rubocop.yml"
|
23
|
-
- ".semver"
|
24
21
|
- CHANGELOG.md
|
25
22
|
- LICENSE.txt
|
26
23
|
- README.md
|
27
|
-
- Rakefile
|
28
24
|
- lib/semantic_release.rb
|
25
|
+
- lib/semantic_release/configuration.rb
|
29
26
|
- lib/semantic_release/rake_task.rb
|
30
27
|
- lib/semantic_release/semver.rb
|
31
28
|
- lib/semantic_release/updaters/base_updater.rb
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-rake
|
3
|
-
- rubocop-rspec
|
4
|
-
|
5
|
-
AllCops:
|
6
|
-
TargetRubyVersion: 3.1
|
7
|
-
NewCops: enable
|
8
|
-
|
9
|
-
Layout/LineContinuationLeadingSpace:
|
10
|
-
EnforcedStyle: leading
|
11
|
-
|
12
|
-
Style/Documentation:
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
Style/StringLiterals:
|
16
|
-
EnforcedStyle: double_quotes
|
17
|
-
|
18
|
-
Style/StringLiteralsInInterpolation:
|
19
|
-
EnforcedStyle: double_quotes
|
data/.semver
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"major":1,"minor":0,"patch":0}
|
data/Rakefile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
|
5
|
-
require "rspec/core/rake_task"
|
6
|
-
RSpec::Core::RakeTask.new(:spec)
|
7
|
-
|
8
|
-
require "rubocop/rake_task"
|
9
|
-
RuboCop::RakeTask.new
|
10
|
-
|
11
|
-
require_relative "lib/semantic_release/rake_task"
|
12
|
-
SemanticRelease::RakeTask.new
|
13
|
-
|
14
|
-
task default: %i[spec rubocop]
|