aufgaben 0.8.3 → 0.8.4

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: 7cc3345145e8f5f41ad7ca51ae660cf212e3ed6cf07ccc8e49f32c420a3813d7
4
- data.tar.gz: 8801f172a2dc2f445f5a18df2b8fe84cee2b41487a9ccc2d0084fa4653480266
3
+ metadata.gz: 914a19e9a0b71bd7194cad833f85547ca6e3e0769269089595cdc5a14e28e786
4
+ data.tar.gz: 2e5a9e462cbf48d046b42be4972562633d56014f724c84adc569d8c3f06553cc
5
5
  SHA512:
6
- metadata.gz: 819da1979aabef1ab36bd4c5075233d10958c87dcdf966c8795ce16e0ef1026aa4ccbc3b0c006801003b391585b24cb12202fc0af197d144f3d9a629b57b1ef6
7
- data.tar.gz: 1f2cfbf0c2e39b61e8869de8906e956fff7a83759f10aaae2d3298f2ed36fa5f8f8198c57fcdbceb6f438063032e7cb0dc16b3eca58abca71f00a09ca66cbed6
6
+ metadata.gz: 7d08f4f69f9581f0789e4e775a0dcdb15dda7511956acd0ed44c2f3f0b324122530b7b0f0b2899adc5597384dc51fb3be2e6d56d9dc39458ff3c0f7a43d0c532
7
+ data.tar.gz: 908642fe3a1d55c4343410e29ef462e58a4d3733ece3ed12a5b6e83dfdcd5dcff748bb3675b0f78fd51ca934b9eba6a5d1cc0154d90acf3dbe62b70c3b9410ba
data/CHANGELOG.md CHANGED
@@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## Unreleased
6
6
 
7
- [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.8.3...HEAD)
7
+ [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.8.4...HEAD)
8
+
9
+ ## 0.8.4
10
+
11
+ [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.8.3...0.8.4)
12
+
13
+ - Check if specified files are updated on `release` task [#46](https://github.com/ybiquitous/aufgaben/pull/46)
8
14
 
9
15
  ## 0.8.3
10
16
 
@@ -59,6 +59,10 @@ module Aufgaben
59
59
 
60
60
  sh "git", "--no-pager", "log", "--format=%C(auto)%h %Creset%s", "#{current_version}..HEAD"
61
61
 
62
+ each_file do |file|
63
+ update_version_in file, write: false
64
+ end
65
+
62
66
  if dry_run?
63
67
  msg "This is a dry-run mode. No actual changes. Next, run this without `DRY_RUN=1`."
64
68
  else
@@ -73,7 +77,7 @@ module Aufgaben
73
77
  end
74
78
  sh "git", "add", changelog
75
79
 
76
- Dir.glob(files, File::FNM_EXTGLOB).each do |file|
80
+ each_file do |file|
77
81
  update_version_in file
78
82
  sh "git", "add", file
79
83
  end
@@ -154,12 +158,27 @@ module Aufgaben
154
158
  msg "'#{changelog}' is added."
155
159
  end
156
160
 
157
- def update_version_in(file)
161
+ def each_file(&block)
162
+ Dir.glob(files, File::FNM_EXTGLOB).each(&block)
163
+ end
164
+
165
+ def update_version_in(file, write: true)
158
166
  content = File.read(file)
159
- content = content.gsub(Regexp.new('\b' + Regexp.escape(current_version) + '\b'), new_version)
160
- File.write(file, content)
161
167
 
162
- msg "'#{file}' is updated."
168
+ current_version_pattern = Regexp.new('\b' + Regexp.escape(current_version) + '\b')
169
+ unless current_version_pattern.match?(content)
170
+ abort "The current version '#{current_version}' is not found in '#{file}'!"
171
+ end
172
+
173
+ new_content = content.gsub(current_version_pattern, new_version)
174
+ if content == new_content
175
+ abort "No changes in '#{file}'"
176
+ end
177
+
178
+ if write
179
+ File.write(file, new_content)
180
+ msg "'#{file}' is updated."
181
+ end
163
182
  end
164
183
 
165
184
  def msg(text)
@@ -1,3 +1,3 @@
1
1
  module Aufgaben
2
- VERSION = "0.8.3".freeze
2
+ VERSION = "0.8.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aufgaben
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masafumi Koba
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-28 00:00:00.000000000 Z
11
+ date: 2021-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler