bump_gem_version 0.1.2 → 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 +6 -1
- 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 +13 -3
- 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: 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,12 +1,17 @@
|
|
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
|
+
|
3
8
|
## [0.1.2] - 2023-02-23
|
4
9
|
|
5
10
|
- Added: `labels` method to bump version according to the first bump type label found from the given list of labels.
|
6
11
|
|
7
12
|
## [0.1.1] - 2023-02-21
|
8
13
|
|
9
|
-
- Changed: Ruby version to `3.1.3
|
14
|
+
- Changed: Ruby version to `3.1.3`.
|
10
15
|
|
11
16
|
## [0.1.0] - 2023-02-21
|
12
17
|
|
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
@@ -33,10 +33,8 @@ module BumpGemVersion
|
|
33
33
|
def bump_gem_version(bump_type)
|
34
34
|
file = current_version[1]
|
35
35
|
new_version = updated_version(bump_type)
|
36
|
-
|
37
36
|
replace_version_in_file(file, new_version)
|
38
|
-
|
39
|
-
system("git commit -m 'Bump version to #{new_version}' --no-verify")
|
37
|
+
replace_version_in_gemfile_lock_file("Gemfile.lock", new_version)
|
40
38
|
end
|
41
39
|
|
42
40
|
def updated_version(bump_type)
|
@@ -91,5 +89,17 @@ module BumpGemVersion
|
|
91
89
|
content.gsub!(VERSION_REGEX, version)
|
92
90
|
File.write(file, content)
|
93
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
|
94
104
|
end
|
95
105
|
end
|