gem_toys 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b023bf7a74055e177396b6f315eda52ed9737d2d18de86c0213d7a740c5089f
4
- data.tar.gz: c2ae112eca387b13cead398223022eb219e2900ae4ce3ef2b7c8b9116ef78728
3
+ metadata.gz: be3b572d39236cf68b7d1c1a56e4a68792176a594047af91302799954898dab3
4
+ data.tar.gz: 2073632a59bb127935d67114d0f7753db0c12606a30f67db6fe704b70bba06a4
5
5
  SHA512:
6
- metadata.gz: 73979e0c344259f99b1605680e9369121bd7fbbb740ba1af6019e2b48d56596b76691d096ec3a7433de04bd60aea9c9769fe74c9059b8a10bb650d92bb0d513a
7
- data.tar.gz: bf1432b40babf5b2c8c2d21a3d2e4689327545a3589435a818fcef98c81c037e1a9f76a5f5b5d03cd196b09e5c0fc14b8b6284d15d8435e837b2ced68e086ceb
6
+ metadata.gz: c11e21b77d865010227986b4b96d5b3291cc447edff5f7df60e6572c2e2e96cb83b983c718d7c1b00b4ad328c3a921da9dba2fc23f7ad6a1d5b02e9da7ca6c16
7
+ data.tar.gz: 7f9a2d20007c1d2d4a097de4f378eceb19401254e16583cbd2b46fdab50777d5972b62efd9026cde51f3c171574cdd134f14adf6c5ee346259d515f6235dbc25
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## master (unreleased)
3
+ ## Unreleased
4
+
5
+ ## 0.10.0 (2021-10-15)
6
+
7
+ * Process cases with non-JSON String from RubyGems.org.
8
+ * Update development dependencies.
9
+ * Resolve new offenses from RuboCop.
10
+ * Change default for unreleased in Changelog.
4
11
 
5
12
  ## 0.9.0 (2021-08-26)
6
13
 
data/README.md CHANGED
@@ -38,8 +38,8 @@ require 'gem_toys'
38
38
  expand GemToys::Template,
39
39
  ## default is `CHANGELOG.md`
40
40
  changelog_file_name: 'ChangeLog.md',
41
- ## default is `## master (unreleased)`
42
- unreleased_title: '## Unreleased',
41
+ ## default is `## Unreleased`
42
+ unreleased_title: '## main (unreleased)',
43
43
  ## default is `"lib/#{project_name_with_slashes_instead_dashes}/version.rb"`
44
44
  version_file_path: 'lib/my-awesome_gem.rb',
45
45
  ## default is `v`, so tags are like `v4.1.0`
@@ -63,7 +63,7 @@ alias_tool :g, :gem
63
63
 
64
64
  1. Update `lib/*gem_name*/version.rb` file.
65
65
  Can be refined with `:version_file_path` option on `expand`.
66
- 2. Insert Markdown title with changes from `## master (unreleased)` in a `CHANGELOG.md` file.
66
+ 2. Insert Markdown title with changes from `## Unreleased` in a `CHANGELOG.md` file.
67
67
  Can be refined with `:unreleased_title` option on `expand`.
68
68
  3. [Builds](#build) a gem.
69
69
  4. Ask you for manual check, if you want (print anything of OK).
@@ -51,13 +51,21 @@ module GemToys
51
51
  require 'faraday'
52
52
  require 'faraday_middleware'
53
53
 
54
- Faraday.new 'https://rubygems.org/api/v1' do |conn|
55
- conn.response :json, parser_options: { symbolize_names: true }
54
+ Faraday.new 'https://rubygems.org/api/v1' do |connection|
55
+ connection.response :json,
56
+ content_type: /\bjson$/,
57
+ parser_options: { symbolize_names: true }
56
58
  end
57
59
  end
58
60
 
59
61
  memoize def rubygems_versions
60
- rubygems_connection.get("versions/#{project_name}.json").body
62
+ response = rubygems_connection.get("versions/#{project_name}.json").body
63
+
64
+ return response if response.is_a?(Array)
65
+
66
+ return [] if response == 'This rubygem could not be found.'
67
+
68
+ raise "Unexpected response from RubyGems.org: #{response.inspect}"
61
69
  end
62
70
 
63
71
  def current_version_hash
@@ -32,7 +32,7 @@ module GemToys
32
32
 
33
33
  @changelog_lines.insert(
34
34
  unreleased_title_index + 2,
35
- '#' * unreleased_title.scan(/^#+/).first.size + " #{@new_version} (#{@today})\n\n"
35
+ ('#' * unreleased_title.scan(/^#+/).first.size) + " #{@new_version} (#{@today})\n\n"
36
36
  ).join
37
37
  end
38
38
 
@@ -19,7 +19,9 @@ module GemToys
19
19
 
20
20
  versions = rubygems_versions
21
21
 
22
- versions.unshift current_version_hash if current_version != versions.first[:number]
22
+ if versions.empty? || current_version != versions.first[:number]
23
+ versions.unshift current_version_hash
24
+ end
23
25
 
24
26
  puts_versions versions
25
27
  end
@@ -15,7 +15,7 @@ module GemToys
15
15
  changelog_file_name: 'CHANGELOG.md',
16
16
  version_file_path: nil,
17
17
  version_tag_prefix: 'v',
18
- unreleased_title: '## master (unreleased)'
18
+ unreleased_title: '## Unreleased'
19
19
  )
20
20
  @changelog_file_name = changelog_file_name
21
21
  @version_file_path = version_file_path
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GemToys
4
- VERSION = '0.9.0'
4
+ VERSION = '0.10.0'
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.9.0
4
+ version: 0.10.0
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-08-25 00:00:00.000000000 Z
11
+ date: 2021-10-15 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.19.0
159
+ version: 1.21.0
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.19.0
166
+ version: 1.21.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rubocop-performance
169
169
  requirement: !ruby/object:Gem::Requirement