gem_toys 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +2 -1
- data/lib/gem_toys/template/common_code.rb +5 -1
- data/lib/gem_toys/template/release.rb +13 -1
- data/lib/gem_toys/version.rb +1 -1
- 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: 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
data/README.md
CHANGED
@@ -35,7 +35,8 @@ 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
|
@@ -31,8 +31,12 @@ module GemToys
|
|
31
31
|
version_file_content.match(/VERSION = '(.+)'/)[1]
|
32
32
|
end
|
33
33
|
|
34
|
+
memoize def changelog_file_name
|
35
|
+
'CHANGELOG.md'
|
36
|
+
end
|
37
|
+
|
34
38
|
memoize def changelog_file_path
|
35
|
-
File.join context_directory,
|
39
|
+
File.join context_directory, changelog_file_name
|
36
40
|
end
|
37
41
|
|
38
42
|
memoize def gem_file_name
|
@@ -118,12 +118,24 @@ module GemToys
|
|
118
118
|
|
119
119
|
def new_changelog_content
|
120
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
|
+
|
121
126
|
@changelog_lines.insert(
|
122
|
-
|
127
|
+
unreleased_title_index + 2,
|
123
128
|
'#' * unreleased_title.scan(/^#+/).first.size + " #{@new_version} (#{@today})\n\n"
|
124
129
|
).join
|
125
130
|
end
|
126
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
|
+
|
127
139
|
def commit_changes
|
128
140
|
puts 'Committing changes...'
|
129
141
|
|
data/lib/gem_toys/version.rb
CHANGED