gem_toys 0.2.0 → 0.6.1
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 +30 -0
- data/README.md +21 -11
- data/lib/gem_toys/template.rb +14 -81
- data/lib/gem_toys/template/common_code.rb +53 -13
- data/lib/gem_toys/template/release.rb +159 -0
- data/lib/gem_toys/template/versions.rb +31 -0
- data/lib/gem_toys/version.rb +1 -1
- metadata +60 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4618c51d0060981f796f40c91b6e746f6cc9860adcdbae6b291e9740b4f617df
|
|
4
|
+
data.tar.gz: 42efd278a9c5821c85eb776dae8f1dde46ac957d1c98842c716f5f769de313f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a8a580cb0ec036fcd80c6c27ef1ecf289c9d87e5696d044b585bcf2ffe05c6ef22c96fee1f2836aa0f9e9f875545b2b3cb501b5d1d3b75fd4bca4edf78b5ac9
|
|
7
|
+
data.tar.gz: 0ae8062f7f01ed27afdf635dbc06a25495a6d6039470a469e6ea5213eecaa66301afce1a9561bc87bd3401822f98e5c6b2443a249926ca8d0eecf0bcf18f70cf
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
## master (unreleased)
|
|
4
4
|
|
|
5
|
+
## 0.6.1 (2021-02-10)
|
|
6
|
+
|
|
7
|
+
## 0.6.0 (2021-02-10)
|
|
8
|
+
|
|
9
|
+
* Support Ruby 3.
|
|
10
|
+
* Fix error with undefined `FileUtils`.
|
|
11
|
+
* Fix error with `release` tool via updating `alt_memery` to a fixed version.
|
|
12
|
+
* Update development dependencies.
|
|
13
|
+
|
|
14
|
+
## 0.5.0 (2020-11-29)
|
|
15
|
+
|
|
16
|
+
* Add `versions` tool with `releases` alias.
|
|
17
|
+
* Add `version` tool.
|
|
18
|
+
* Add an ability to release new `major`, `minor` or `patch` version.
|
|
19
|
+
Just specify keyword instead of number and it'll increase correctly.
|
|
20
|
+
* Print `git diff` for files which will be commited on `release`.
|
|
21
|
+
* Drop Ruby 2.4 support.
|
|
22
|
+
[Support of Ruby 2.4 has ended](https://www.ruby-lang.org/en/news/2020/04/05/support-of-ruby-2-4-has-ended/).
|
|
23
|
+
* Add and use `memery` dependency.
|
|
24
|
+
* Update `rubocop`, `remark`.
|
|
25
|
+
|
|
26
|
+
## 0.4.0 (2020-09-21)
|
|
27
|
+
|
|
28
|
+
* Improve version update script, support files with other String constants.
|
|
29
|
+
* Update bundle.
|
|
30
|
+
|
|
31
|
+
## 0.3.0 (2020-07-11)
|
|
32
|
+
|
|
33
|
+
* Add support for Ruby 2.4
|
|
34
|
+
|
|
5
35
|
## 0.2.0 (2020-07-09)
|
|
6
36
|
|
|
7
37
|
* Add `:version_file_path` and `:unreleased_title` options
|
data/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Gem Toys
|
|
2
2
|
|
|
3
|
-

|
|
3
|
+
[](https://cirrus-ci.com/github/AlexWayfer/gem_toys)
|
|
4
4
|
[](https://codecov.io/gh/AlexWayfer/gem_toys)
|
|
5
5
|
[](https://codeclimate.com/github/AlexWayfer/gem_toys)
|
|
6
|
-
](https://depfu.com/repos/github/AlexWayfer/gem_toys)
|
|
7
7
|
[](https://inch-ci.org/github/AlexWayfer/gem_toys)
|
|
8
|
-
[](https://github.com/AlexWayfer/gem_toys/blob/master/LICENSE)
|
|
8
|
+
[](https://github.com/AlexWayfer/gem_toys/blob/master/LICENSE.txt)
|
|
9
9
|
[](https://rubygems.org/gems/gem_toys)
|
|
10
10
|
|
|
11
11
|
[Toys](https://github.com/dazuma/toys) template for gems, like building, releasing, etc.
|
|
@@ -35,19 +35,30 @@ gem install gem_toys
|
|
|
35
35
|
```ruby
|
|
36
36
|
# .toys.rb
|
|
37
37
|
require 'gem_toys'
|
|
38
|
-
expand GemToys::Template
|
|
38
|
+
expand GemToys::Template,
|
|
39
|
+
unreleased_title: '## Unreleased' ## default is `## master (unreleased)`
|
|
39
40
|
|
|
40
41
|
# `gem` namespace created, aliases are optional, but handful
|
|
41
42
|
alias_tool :g, :gem
|
|
42
43
|
```
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
### Build
|
|
46
|
+
|
|
47
|
+
`toys gem build` builds a gem with the current version and move it to the `pkg/` directory.
|
|
48
|
+
|
|
49
|
+
### Install
|
|
50
|
+
|
|
51
|
+
`toys gem install` [builds](#build) a gem and install it locally.
|
|
52
|
+
|
|
53
|
+
### Release
|
|
54
|
+
|
|
55
|
+
`toys gem release` does:
|
|
45
56
|
|
|
46
57
|
1. Update `lib/*gem_name*/version.rb` file.
|
|
47
58
|
Can be refined with `:version_file_path` option on `expand`.
|
|
48
59
|
2. Insert Markdown title with changes from `## master (unreleased)` in a `CHANGELOG.md` file.
|
|
49
60
|
Can be refined with `:unreleased_title` option on `expand`.
|
|
50
|
-
3.
|
|
61
|
+
3. [Builds](#build) a gem.
|
|
51
62
|
4. Ask you for manual check, if you want (print anything of OK).
|
|
52
63
|
You also can change manually a content of `CHANGELOG.md`, for example, before committing.
|
|
53
64
|
5. Commit these files.
|
|
@@ -58,13 +69,12 @@ At invocation it will:
|
|
|
58
69
|
## Development
|
|
59
70
|
|
|
60
71
|
After checking out the repo, run `bundle install` to install dependencies.
|
|
61
|
-
|
|
72
|
+
|
|
73
|
+
Then, run `toys rspec` to run the tests.
|
|
62
74
|
|
|
63
75
|
To install this gem onto your local machine, run `toys gem install`.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
for the version, push git commits and tags, and push the `.gem` file
|
|
67
|
-
to [rubygems.org](https://rubygems.org).
|
|
76
|
+
|
|
77
|
+
To release a new version, run `toys gem release %version%`. See how it works [here](#release).
|
|
68
78
|
|
|
69
79
|
## Contributing
|
|
70
80
|
|
data/lib/gem_toys/template.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'date'
|
|
4
3
|
require 'toys-core'
|
|
5
4
|
|
|
6
5
|
require_relative 'template/common_code'
|
|
@@ -32,6 +31,8 @@ module GemToys
|
|
|
32
31
|
@template = template
|
|
33
32
|
|
|
34
33
|
sh 'gem build'
|
|
34
|
+
|
|
35
|
+
require 'fileutils'
|
|
35
36
|
FileUtils.mkdir_p pkg_directory
|
|
36
37
|
FileUtils.mv "#{context_directory}/#{gem_file_name}", current_gem_file
|
|
37
38
|
end
|
|
@@ -46,94 +47,26 @@ module GemToys
|
|
|
46
47
|
end
|
|
47
48
|
end
|
|
48
49
|
|
|
49
|
-
tool :
|
|
50
|
-
required_arg :version
|
|
51
|
-
|
|
50
|
+
tool :version do
|
|
52
51
|
to_run do
|
|
53
52
|
@template = template
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
## Update CHANGELOG
|
|
58
|
-
update_changelog_file
|
|
59
|
-
|
|
60
|
-
## Build new gem file
|
|
61
|
-
exec_tool 'gem build'
|
|
62
|
-
|
|
63
|
-
wait_for_manual_check
|
|
64
|
-
|
|
65
|
-
## Checkout to a new git branch, required for protected `master` with CI
|
|
66
|
-
# sh "git switch -c v#{version}"
|
|
67
|
-
|
|
68
|
-
commit_changes
|
|
69
|
-
|
|
70
|
-
## Tag commit
|
|
71
|
-
puts 'Tagging the commit...'
|
|
72
|
-
sh "git tag -a v#{version} -m 'Version #{version}'"
|
|
73
|
-
|
|
74
|
-
## Push commit
|
|
75
|
-
puts 'Pushing commit...'
|
|
76
|
-
sh 'git push'
|
|
77
|
-
|
|
78
|
-
## Push tags
|
|
79
|
-
puts 'Pushing tags...'
|
|
80
|
-
sh 'git push --tags'
|
|
81
|
-
|
|
82
|
-
puts 'Pushing gem...'
|
|
83
|
-
sh "gem push #{current_gem_file}"
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
private
|
|
87
|
-
|
|
88
|
-
def update_version_file
|
|
89
|
-
puts 'Updating version file...'
|
|
90
|
-
|
|
91
|
-
File.write version_file_path, version_file_content.sub(/'.+'/, "'#{version}'")
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
TODAY = Date.today.to_s
|
|
95
|
-
|
|
96
|
-
def update_changelog_file
|
|
97
|
-
puts 'Updating changelog file...'
|
|
98
|
-
|
|
99
|
-
@changelog_lines = File.readlines(changelog_file_path)
|
|
100
|
-
|
|
101
|
-
existing_line = find_version_line_in_changelog_file
|
|
102
|
-
|
|
103
|
-
if existing_line
|
|
104
|
-
return if (existing_date = existing_line.match(/\((.*)\)/)[1]) == TODAY
|
|
105
|
-
|
|
106
|
-
abort "There is already #{version} version with date #{existing_date}"
|
|
54
|
+
version = rubygems_versions.find(-> { current_version_hash }) do |rubygems_version|
|
|
55
|
+
rubygems_version[:number] == current_version
|
|
107
56
|
end
|
|
108
57
|
|
|
109
|
-
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def find_version_line_in_changelog_file
|
|
113
|
-
@changelog_lines.find { |line| line.start_with? "## #{version} " }
|
|
58
|
+
puts_versions [version]
|
|
114
59
|
end
|
|
60
|
+
end
|
|
115
61
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
@changelog_lines.index("#{unreleased_title}\n") + 2,
|
|
120
|
-
'#' * unreleased_title.scan(/^#+/).first.size + " #{version} (#{TODAY})\n\n"
|
|
121
|
-
).join
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
def commit_changes
|
|
125
|
-
puts 'Committing changes...'
|
|
126
|
-
|
|
127
|
-
sh "git add #{version_file_path} #{changelog_file_path}"
|
|
128
|
-
|
|
129
|
-
sh "git commit -m 'Update version to #{version}'"
|
|
130
|
-
end
|
|
62
|
+
require_relative 'template/versions'
|
|
63
|
+
expand Template::Versions,
|
|
64
|
+
version_file_path: template.version_file_path
|
|
131
65
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
end
|
|
66
|
+
require_relative 'template/release'
|
|
67
|
+
expand Template::Release,
|
|
68
|
+
version_file_path: template.version_file_path,
|
|
69
|
+
unreleased_title: template.unreleased_title
|
|
137
70
|
end
|
|
138
71
|
end
|
|
139
72
|
end
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'memery'
|
|
4
|
+
|
|
3
5
|
module GemToys
|
|
4
6
|
## Template with gem tools, should be expanded in toys file
|
|
5
7
|
class Template
|
|
6
8
|
## Module for common code between nested tools
|
|
7
9
|
module CommonCode
|
|
10
|
+
include Memery
|
|
11
|
+
|
|
8
12
|
private
|
|
9
13
|
|
|
10
|
-
def project_name
|
|
11
|
-
|
|
14
|
+
memoize def project_name
|
|
15
|
+
File.basename context_directory
|
|
12
16
|
end
|
|
13
17
|
|
|
14
|
-
def version_file_path
|
|
15
|
-
@version_file_path
|
|
16
|
-
@template.version_file_path ||
|
|
18
|
+
memoize def version_file_path
|
|
19
|
+
@template.version_file_path ||
|
|
17
20
|
begin
|
|
18
21
|
project_path = project_name.tr '-', '/'
|
|
19
22
|
File.join context_directory, 'lib', project_path, 'version.rb'
|
|
@@ -24,25 +27,62 @@ module GemToys
|
|
|
24
27
|
File.read version_file_path
|
|
25
28
|
end
|
|
26
29
|
|
|
27
|
-
def current_version
|
|
28
|
-
|
|
30
|
+
memoize def current_version
|
|
31
|
+
version_file_content.match(/VERSION = '(.+)'/)[1]
|
|
29
32
|
end
|
|
30
33
|
|
|
31
|
-
def
|
|
32
|
-
|
|
34
|
+
memoize def changelog_file_name
|
|
35
|
+
'CHANGELOG.md'
|
|
33
36
|
end
|
|
34
37
|
|
|
35
|
-
def
|
|
36
|
-
|
|
38
|
+
memoize def changelog_file_path
|
|
39
|
+
File.join context_directory, changelog_file_name
|
|
37
40
|
end
|
|
38
41
|
|
|
39
|
-
def
|
|
40
|
-
|
|
42
|
+
memoize def gem_file_name
|
|
43
|
+
"#{project_name}-#{current_version}.gem"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
memoize def pkg_directory
|
|
47
|
+
"#{context_directory}/pkg"
|
|
41
48
|
end
|
|
42
49
|
|
|
43
50
|
def current_gem_file
|
|
44
51
|
"#{pkg_directory}/#{gem_file_name}"
|
|
45
52
|
end
|
|
53
|
+
|
|
54
|
+
memoize def rubygems_connection
|
|
55
|
+
require 'faraday'
|
|
56
|
+
require 'faraday_middleware'
|
|
57
|
+
|
|
58
|
+
Faraday.new 'https://rubygems.org/api/v1' do |conn|
|
|
59
|
+
conn.response :json, parser_options: { symbolize_names: true }
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
memoize def rubygems_versions
|
|
64
|
+
rubygems_connection.get("versions/#{project_name}.json").body
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def current_version_hash
|
|
68
|
+
{ number: current_version, created_at: 'unreleased' }
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def puts_versions(versions)
|
|
72
|
+
require 'date'
|
|
73
|
+
|
|
74
|
+
longest_version_number = versions.map { |version| version[:number].length }.max
|
|
75
|
+
|
|
76
|
+
versions.each do |version|
|
|
77
|
+
created_at = begin
|
|
78
|
+
DateTime.parse(version[:created_at]).strftime('%b %e %Y %R')
|
|
79
|
+
rescue Date::Error
|
|
80
|
+
version[:created_at]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
puts "#{version[:number].ljust(longest_version_number)} (#{created_at})"
|
|
84
|
+
end
|
|
85
|
+
end
|
|
46
86
|
end
|
|
47
87
|
end
|
|
48
88
|
end
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GemToys
|
|
4
|
+
class Template
|
|
5
|
+
## Template with gem release tool, expanding internally
|
|
6
|
+
class Release
|
|
7
|
+
include Toys::Template
|
|
8
|
+
|
|
9
|
+
attr_reader :version_file_path, :unreleased_title
|
|
10
|
+
|
|
11
|
+
def initialize(version_file_path:, unreleased_title:)
|
|
12
|
+
@version_file_path = version_file_path
|
|
13
|
+
@unreleased_title = unreleased_title
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
on_expand do |template|
|
|
17
|
+
tool :release do
|
|
18
|
+
required_arg :new_version
|
|
19
|
+
|
|
20
|
+
to_run do
|
|
21
|
+
require 'date'
|
|
22
|
+
|
|
23
|
+
@template = template
|
|
24
|
+
|
|
25
|
+
@today = Date.today.to_s
|
|
26
|
+
|
|
27
|
+
handle_new_version
|
|
28
|
+
|
|
29
|
+
update_version_file
|
|
30
|
+
|
|
31
|
+
## Update CHANGELOG
|
|
32
|
+
update_changelog_file
|
|
33
|
+
|
|
34
|
+
## Build new gem file
|
|
35
|
+
exec_tool 'gem build'
|
|
36
|
+
|
|
37
|
+
wait_for_manual_check
|
|
38
|
+
|
|
39
|
+
## Checkout to a new git branch, required for protected `master` with CI
|
|
40
|
+
# sh "git switch -c v#{@new_version}"
|
|
41
|
+
|
|
42
|
+
commit_changes
|
|
43
|
+
|
|
44
|
+
## Tag commit
|
|
45
|
+
puts 'Tagging the commit...'
|
|
46
|
+
sh "git tag -a v#{@new_version} -m 'Version #{@new_version}'"
|
|
47
|
+
|
|
48
|
+
## Push commit
|
|
49
|
+
puts 'Pushing commit...'
|
|
50
|
+
sh 'git push'
|
|
51
|
+
|
|
52
|
+
## Push tags
|
|
53
|
+
puts 'Pushing tags...'
|
|
54
|
+
sh 'git push --tags'
|
|
55
|
+
|
|
56
|
+
puts 'Pushing gem...'
|
|
57
|
+
sh "gem push #{current_gem_file}"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
private
|
|
61
|
+
|
|
62
|
+
self::VERSION_TYPES = %w[
|
|
63
|
+
major
|
|
64
|
+
minor
|
|
65
|
+
patch
|
|
66
|
+
].freeze
|
|
67
|
+
|
|
68
|
+
def handle_new_version
|
|
69
|
+
## https://github.com/dazuma/toys/issues/103
|
|
70
|
+
@new_version =
|
|
71
|
+
if (version_index = self.class::VERSION_TYPES.index(new_version))
|
|
72
|
+
current_version_parts =
|
|
73
|
+
current_version.split('.')[0..(self.class::VERSION_TYPES.count - 1)]
|
|
74
|
+
handle_keyword_in_new_version current_version_parts, version_index
|
|
75
|
+
else
|
|
76
|
+
new_version
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
clear_memery_cache! :current_version
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def handle_keyword_in_new_version(current_version_parts, version_index)
|
|
83
|
+
current_version_parts.map.with_index do |version_part, index|
|
|
84
|
+
if index < version_index
|
|
85
|
+
version_part
|
|
86
|
+
elsif index == version_index
|
|
87
|
+
Integer(version_part) + 1
|
|
88
|
+
else
|
|
89
|
+
0
|
|
90
|
+
end
|
|
91
|
+
end.join('.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def update_version_file
|
|
95
|
+
puts 'Updating version file...'
|
|
96
|
+
|
|
97
|
+
File.write(
|
|
98
|
+
version_file_path,
|
|
99
|
+
version_file_content.sub(/(VERSION = )'.+'/, "\\1'#{@new_version}'")
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def update_changelog_file
|
|
104
|
+
puts 'Updating changelog file...'
|
|
105
|
+
|
|
106
|
+
@changelog_lines = File.readlines(changelog_file_path)
|
|
107
|
+
|
|
108
|
+
existing_line = @changelog_lines.find { |line| line.start_with? "## #{@new_version} " }
|
|
109
|
+
|
|
110
|
+
if existing_line
|
|
111
|
+
return if (existing_date = existing_line.match(/\((.*)\)/)[1]) == @today
|
|
112
|
+
|
|
113
|
+
abort "There is already #{version} version with date #{existing_date}"
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
File.write changelog_file_path, new_changelog_content
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def new_changelog_content
|
|
120
|
+
unreleased_title = @template.unreleased_title
|
|
121
|
+
|
|
122
|
+
unreleased_title_index = @changelog_lines.index("#{unreleased_title}\n")
|
|
123
|
+
|
|
124
|
+
abort_without_unreleased_title unless unreleased_title_index
|
|
125
|
+
|
|
126
|
+
@changelog_lines.insert(
|
|
127
|
+
unreleased_title_index + 2,
|
|
128
|
+
'#' * unreleased_title.scan(/^#+/).first.size + " #{@new_version} (#{@today})\n\n"
|
|
129
|
+
).join
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def abort_without_unreleased_title
|
|
133
|
+
abort <<~TEXT
|
|
134
|
+
`#{@template.unreleased_title}` not found in the `#{changelog_file_name}` as the title for unreleased changes.
|
|
135
|
+
Please, use `:unreleased_title` option if you have non-default one.
|
|
136
|
+
TEXT
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def commit_changes
|
|
140
|
+
puts 'Committing changes...'
|
|
141
|
+
|
|
142
|
+
sh "git add #{version_file_path} #{changelog_file_path}"
|
|
143
|
+
|
|
144
|
+
sh "git commit -m 'Update version to #{@new_version}'"
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def wait_for_manual_check
|
|
148
|
+
$stdout.puts
|
|
149
|
+
sh "git diff #{version_file_path} #{changelog_file_path}"
|
|
150
|
+
$stdout.puts
|
|
151
|
+
$stdout.puts 'Please, validate files before committing and pushing!'
|
|
152
|
+
$stdout.puts 'Press anything to continue, Ctrl+C to cancel.'
|
|
153
|
+
$stdin.gets
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GemToys
|
|
4
|
+
class Template
|
|
5
|
+
## Template with gem versions tool, expanding internally
|
|
6
|
+
class Versions
|
|
7
|
+
include Toys::Template
|
|
8
|
+
|
|
9
|
+
attr_reader :version_file_path
|
|
10
|
+
|
|
11
|
+
def initialize(version_file_path:)
|
|
12
|
+
@version_file_path = version_file_path
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
on_expand do |template|
|
|
16
|
+
tool :versions do
|
|
17
|
+
to_run do
|
|
18
|
+
@template = template
|
|
19
|
+
|
|
20
|
+
versions = rubygems_versions
|
|
21
|
+
|
|
22
|
+
versions.unshift current_version_hash if current_version != versions.first[:number]
|
|
23
|
+
|
|
24
|
+
puts_versions versions
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
alias_tool :releases, :versions
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
data/lib/gem_toys/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,57 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gem_toys
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Popov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: alt_memery
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '2.1'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '2.1'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: faraday
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: faraday_middleware
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.0'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '1.0'
|
|
13
55
|
- !ruby/object:Gem::Dependency
|
|
14
56
|
name: pry-byebug
|
|
15
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -44,34 +86,28 @@ dependencies:
|
|
|
44
86
|
requirements:
|
|
45
87
|
- - "~>"
|
|
46
88
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 0.
|
|
89
|
+
version: 0.11.0
|
|
48
90
|
type: :development
|
|
49
91
|
prerelease: false
|
|
50
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
93
|
requirements:
|
|
52
94
|
- - "~>"
|
|
53
95
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 0.
|
|
96
|
+
version: 0.11.0
|
|
55
97
|
- !ruby/object:Gem::Dependency
|
|
56
98
|
name: codecov
|
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
|
58
100
|
requirements:
|
|
59
101
|
- - "~>"
|
|
60
102
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 0.
|
|
62
|
-
- - "<"
|
|
63
|
-
- !ruby/object:Gem::Version
|
|
64
|
-
version: 0.1.18
|
|
103
|
+
version: 0.4.2
|
|
65
104
|
type: :development
|
|
66
105
|
prerelease: false
|
|
67
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
68
107
|
requirements:
|
|
69
108
|
- - "~>"
|
|
70
109
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: 0.
|
|
72
|
-
- - "<"
|
|
73
|
-
- !ruby/object:Gem::Version
|
|
74
|
-
version: 0.1.18
|
|
110
|
+
version: 0.4.2
|
|
75
111
|
- !ruby/object:Gem::Dependency
|
|
76
112
|
name: rspec
|
|
77
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -92,28 +128,28 @@ dependencies:
|
|
|
92
128
|
requirements:
|
|
93
129
|
- - "~>"
|
|
94
130
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: 0.
|
|
131
|
+
version: 0.21.2
|
|
96
132
|
type: :development
|
|
97
133
|
prerelease: false
|
|
98
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
99
135
|
requirements:
|
|
100
136
|
- - "~>"
|
|
101
137
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: 0.
|
|
138
|
+
version: 0.21.2
|
|
103
139
|
- !ruby/object:Gem::Dependency
|
|
104
140
|
name: rubocop
|
|
105
141
|
requirement: !ruby/object:Gem::Requirement
|
|
106
142
|
requirements:
|
|
107
143
|
- - "~>"
|
|
108
144
|
- !ruby/object:Gem::Version
|
|
109
|
-
version:
|
|
145
|
+
version: '1.2'
|
|
110
146
|
type: :development
|
|
111
147
|
prerelease: false
|
|
112
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
113
149
|
requirements:
|
|
114
150
|
- - "~>"
|
|
115
151
|
- !ruby/object:Gem::Version
|
|
116
|
-
version:
|
|
152
|
+
version: '1.2'
|
|
117
153
|
- !ruby/object:Gem::Dependency
|
|
118
154
|
name: rubocop-performance
|
|
119
155
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -134,14 +170,14 @@ dependencies:
|
|
|
134
170
|
requirements:
|
|
135
171
|
- - "~>"
|
|
136
172
|
- !ruby/object:Gem::Version
|
|
137
|
-
version: '
|
|
173
|
+
version: '2.0'
|
|
138
174
|
type: :development
|
|
139
175
|
prerelease: false
|
|
140
176
|
version_requirements: !ruby/object:Gem::Requirement
|
|
141
177
|
requirements:
|
|
142
178
|
- - "~>"
|
|
143
179
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '
|
|
180
|
+
version: '2.0'
|
|
145
181
|
description: 'Toys template for gems, like building, releasing, etc.
|
|
146
182
|
|
|
147
183
|
'
|
|
@@ -157,6 +193,8 @@ files:
|
|
|
157
193
|
- lib/gem_toys.rb
|
|
158
194
|
- lib/gem_toys/template.rb
|
|
159
195
|
- lib/gem_toys/template/common_code.rb
|
|
196
|
+
- lib/gem_toys/template/release.rb
|
|
197
|
+
- lib/gem_toys/template/versions.rb
|
|
160
198
|
- lib/gem_toys/version.rb
|
|
161
199
|
homepage: https://github.com/AlexWayfer/gem_toys
|
|
162
200
|
licenses:
|
|
@@ -174,13 +212,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
174
212
|
- - ">="
|
|
175
213
|
- !ruby/object:Gem::Version
|
|
176
214
|
version: '2.5'
|
|
215
|
+
- - "<"
|
|
216
|
+
- !ruby/object:Gem::Version
|
|
217
|
+
version: '4'
|
|
177
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
219
|
requirements:
|
|
179
220
|
- - ">="
|
|
180
221
|
- !ruby/object:Gem::Version
|
|
181
222
|
version: '0'
|
|
182
223
|
requirements: []
|
|
183
|
-
rubygems_version: 3.
|
|
224
|
+
rubygems_version: 3.2.3
|
|
184
225
|
signing_key:
|
|
185
226
|
specification_version: 4
|
|
186
227
|
summary: Toys template for gems
|