gem_toys 0.10.0 → 0.11.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be3b572d39236cf68b7d1c1a56e4a68792176a594047af91302799954898dab3
4
- data.tar.gz: 2073632a59bb127935d67114d0f7753db0c12606a30f67db6fe704b70bba06a4
3
+ metadata.gz: 112ee3b1f0047eb32d9beedccc1249e000164a10513365de206c8d1bf06a0691
4
+ data.tar.gz: 9876889866f9d38eeceb03ea04303845088e5fc429e7f8a9e5312dc0a35cce83
5
5
  SHA512:
6
- metadata.gz: c11e21b77d865010227986b4b96d5b3291cc447edff5f7df60e6572c2e2e96cb83b983c718d7c1b00b4ad328c3a921da9dba2fc23f7ad6a1d5b02e9da7ca6c16
7
- data.tar.gz: 7f9a2d20007c1d2d4a097de4f378eceb19401254e16583cbd2b46fdab50777d5972b62efd9026cde51f3c171574cdd134f14adf6c5ee346259d515f6235dbc25
6
+ metadata.gz: 4e6342e7bb1b2485caa3b08a9c0bda86961f47626f7236d808c5bfebd15fb37b4f28021ed43b9faaccd669b9f0b66cd237842301bc28578d48d35d258a3f3b98
7
+ data.tar.gz: 6ba75096de3694778131890372df8b5ba4fad5a3d3f1386635d6b86f75efa7dae98bda97be352998d246656b271cfcdc3549071a22508424c197a6f7828cc230
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.11.2 (2021-11-07)
6
+
7
+ * Fix version for gem staff after manual refresh too.
8
+
9
+ ## 0.11.1 (2021-11-07)
10
+
11
+ * Fix new version for git staff after manual refresh.
12
+
13
+ ## 0.11.0 (2021-10-29)
14
+
15
+ * Revert version and changelog files changes at rejection.
16
+ * Revert version file changes at changelog fails.
17
+ * Update development dependencies.
18
+
5
19
  ## 0.10.0 (2021-10-15)
6
20
 
7
21
  * Process cases with non-JSON String from RubyGems.org.
@@ -28,6 +28,10 @@ module GemToys
28
28
  end
29
29
 
30
30
  memoize def current_version
31
+ parse_version_from_file
32
+ end
33
+
34
+ def parse_version_from_file
31
35
  version_file_content.match(/VERSION = '(.+)'/)[1]
32
36
  end
33
37
 
@@ -28,7 +28,10 @@ module GemToys
28
28
 
29
29
  unreleased_title_index = @changelog_lines.index("#{unreleased_title}\n")
30
30
 
31
- abort_without_unreleased_title unless unreleased_title_index
31
+ unless unreleased_title_index
32
+ sh "git restore --worktree #{version_file_path}"
33
+ abort_without_unreleased_title
34
+ end
32
35
 
33
36
  @changelog_lines.insert(
34
37
  unreleased_title_index + 2,
@@ -8,16 +8,17 @@ module GemToys
8
8
  private
9
9
 
10
10
  def process_git
11
- new_version_git_tag = "#{@template.version_tag_prefix}#{@new_version}"
11
+ ## `current_version` should be refreshed before this method invocation
12
+ version_git_tag = "#{@template.version_tag_prefix}#{current_version}"
12
13
 
13
14
  ## Checkout to a new git branch, required for protected `master` with CI
14
- # sh "git switch -c #{new_version_git_tag}"
15
+ # sh "git switch -c #{version_git_tag}"
15
16
 
16
17
  commit_changes
17
18
 
18
19
  ## Tag commit
19
20
  puts 'Tagging the commit...'
20
- sh "git tag -a #{new_version_git_tag} -m 'Version #{@new_version}'"
21
+ sh "git tag -a #{version_git_tag} -m 'Version #{current_version}'"
21
22
 
22
23
  ## Push commit
23
24
  puts 'Pushing commit...'
@@ -33,7 +34,7 @@ module GemToys
33
34
 
34
35
  sh "git add #{version_file_path} #{changelog_file_path}"
35
36
 
36
- sh "git commit -m 'Update version to #{@new_version}'"
37
+ sh "git commit -m 'Update version to #{current_version}'"
37
38
  end
38
39
  end
39
40
  end
@@ -76,8 +76,6 @@ module GemToys
76
76
  else
77
77
  new_version
78
78
  end
79
-
80
- clear_memery_cache! :current_version
81
79
  end
82
80
 
83
81
  def handle_keyword_in_new_version(current_version_parts, version_index)
@@ -119,14 +117,23 @@ module GemToys
119
117
 
120
118
  menu.prompt = 'Are these changes correct? '
121
119
 
122
- menu.choice(:yes)
123
- menu.choice(:no) { abort }
120
+ menu.choice(:yes) do
121
+ ## `current_version` is using in `git` and `gem` commands
122
+ clear_memery_cache! :current_version
123
+ end
124
+ menu.choice(:no) { handle_refusing_to_continue }
124
125
  menu.choice(:refresh) do
125
- handle_new_version
126
126
  wait_for_manual_check
127
127
  end
128
128
  end
129
129
  end
130
+
131
+ def handle_refusing_to_continue
132
+ [version_file_path, changelog_file_path].each do |file_path|
133
+ sh "git restore --worktree #{file_path}"
134
+ end
135
+ abort
136
+ end
130
137
  end
131
138
  end
132
139
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GemToys
4
- VERSION = '0.10.0'
4
+ VERSION = '0.11.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_toys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-15 00:00:00.000000000 Z
11
+ date: 2021-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alt_memery
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.21.0
159
+ version: 1.22.2
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.21.0
166
+ version: 1.22.2
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rubocop-performance
169
169
  requirement: !ruby/object:Gem::Requirement