bump_gem_version 0.1.1 → 0.1.3
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 +13 -0
- data/Gemfile.lock +1 -1
- data/README.md +9 -0
- data/lib/bump_gem_version/version.rb +1 -1
- data/lib/bump_gem_version.rb +20 -4
- 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: 4cd19c397da6310e2469d6e7fd5cab35e0654e29bf879c6fcb41b6d192db4882
|
4
|
+
data.tar.gz: 20fe21b1e32cb4592d1740268450b05526648e784475da8f5a21b39499c4b551
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a43f03a98c67a1e84e576ded78d85e1c12812889d691547b0a59889d36f9c7b30d314d885149491652f0b64e874bd96e78d99fe3f5d53529c7cb4d969680f28
|
7
|
+
data.tar.gz: c117e01b1a48a62bc4e6020b58553ef495a0f3db2a0c193cc23d0d5ad52f95bd8671415f914cc89ba1512f3bf53994dfe83841af31e0cdfc769e99ed97497750
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.3] - 2023-02-23
|
4
|
+
|
5
|
+
- Changed: Bump version logic on `Gemfile.lock` file.
|
6
|
+
- Removed: `git` actions from `bump_gem_version` script.
|
7
|
+
|
8
|
+
## [0.1.2] - 2023-02-23
|
9
|
+
|
10
|
+
- Added: `labels` method to bump version according to the first bump type label found from the given list of labels.
|
11
|
+
|
12
|
+
## [0.1.1] - 2023-02-21
|
13
|
+
|
14
|
+
- Changed: Ruby version to `3.1.3`.
|
15
|
+
|
3
16
|
## [0.1.0] - 2023-02-21
|
4
17
|
|
5
18
|
- Initial release
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -20,9 +20,18 @@ gem install bump_gem_version
|
|
20
20
|
|
21
21
|
```sh
|
22
22
|
bump_gem_version current # 0.1.0
|
23
|
+
|
23
24
|
bump_gem_version patch # 0.1.0 -> 0.1.1
|
25
|
+
|
24
26
|
bump_gem_version minor # 0.1.0 -> 0.2.0
|
27
|
+
|
25
28
|
bump_gem_version major # 0.1.0 -> 1.0.0
|
29
|
+
|
30
|
+
# To use with labels
|
31
|
+
bump_gem_version labels bug,patch # 0.1.0 -> 0.1.1
|
32
|
+
bump_gem_version labels feature,minor,patch # 0.1.0 -> 0.2.0
|
33
|
+
bump_gem_version labels breaking,major # 0.1.0 -> 1.0.0
|
34
|
+
bump_gem_version labels ${{ join(github.event.pull_request.labels.*.name, ',') }} # For GitHub PR labels
|
26
35
|
```
|
27
36
|
|
28
37
|
## Development
|
data/lib/bump_gem_version.rb
CHANGED
@@ -22,15 +22,19 @@ module BumpGemVersion
|
|
22
22
|
desc "patch", "Bump the patch version of your gem"
|
23
23
|
def patch = bump_gem_version("patch")
|
24
24
|
|
25
|
+
desc "label", "Bump the version of your gem from the given labels"
|
26
|
+
def labels(labels)
|
27
|
+
bump_type = labels.split(",").find { |label| BUMPS.include?(label) }
|
28
|
+
bump_type ? bump_gem_version(bump_type) : puts("Error: Unable to find a valid bump label.")
|
29
|
+
end
|
30
|
+
|
25
31
|
private
|
26
32
|
|
27
33
|
def bump_gem_version(bump_type)
|
28
34
|
file = current_version[1]
|
29
35
|
new_version = updated_version(bump_type)
|
30
|
-
|
31
36
|
replace_version_in_file(file, new_version)
|
32
|
-
|
33
|
-
system("git commit -m 'Bump version to #{new_version}' --no-verify")
|
37
|
+
replace_version_in_gemfile_lock_file("Gemfile.lock", new_version)
|
34
38
|
end
|
35
39
|
|
36
40
|
def updated_version(bump_type)
|
@@ -52,7 +56,7 @@ module BumpGemVersion
|
|
52
56
|
version_from_version_rb ||
|
53
57
|
version_from_lib_rb
|
54
58
|
)
|
55
|
-
puts "Unable to find the version." unless version
|
59
|
+
puts "Error: Unable to find the version." unless version
|
56
60
|
|
57
61
|
[version, file]
|
58
62
|
end
|
@@ -85,5 +89,17 @@ module BumpGemVersion
|
|
85
89
|
content.gsub!(VERSION_REGEX, version)
|
86
90
|
File.write(file, content)
|
87
91
|
end
|
92
|
+
|
93
|
+
def replace_version_in_gemfile_lock_file(file, version)
|
94
|
+
gem_name = current_gem_name
|
95
|
+
content = File.read(file)
|
96
|
+
content.gsub!(/#{gem_name} \((#{VERSION_REGEX})\)/, "#{gem_name} (#{version})")
|
97
|
+
File.write(file, content)
|
98
|
+
end
|
99
|
+
|
100
|
+
def current_gem_name
|
101
|
+
gemspec = Dir.glob("*.gemspec").first
|
102
|
+
File.read(gemspec)[/spec\.name\s+=\s+['"](.+)['"]/i, 1]
|
103
|
+
end
|
88
104
|
end
|
89
105
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bump_gem_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thejus Paul
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|