aufgaben 0.8.4 → 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: 914a19e9a0b71bd7194cad833f85547ca6e3e0769269089595cdc5a14e28e786
4
- data.tar.gz: 2e5a9e462cbf48d046b42be4972562633d56014f724c84adc569d8c3f06553cc
3
+ metadata.gz: 3de5f02a75dedc2a9a499ee7551348192c9107b2b37c5500647b723ff5a2e693
4
+ data.tar.gz: 5b5b0f8452a05534b51fd80c4429335f0a97aa866018bf59a33cad9a900ba9f1
5
5
  SHA512:
6
- metadata.gz: 7d08f4f69f9581f0789e4e775a0dcdb15dda7511956acd0ed44c2f3f0b324122530b7b0f0b2899adc5597384dc51fb3be2e6d56d9dc39458ff3c0f7a43d0c532
7
- data.tar.gz: 908642fe3a1d55c4343410e29ef462e58a4d3733ece3ed12a5b6e83dfdcd5dcff748bb3675b0f78fd51ca934b9eba6a5d1cc0154d90acf3dbe62b70c3b9410ba
6
+ metadata.gz: a7c70d5e4e31e394450f8c5921f3337c9200283021c6c82851021246bae3247c463d4e1d44392467d673532aea4f0773ea2e962b603e88595246b99f3d7caaf0
7
+ data.tar.gz: 1710c26fd8f7e519077b18c3977f9201e80ef96d352c3b7f6b9cb710211edd2f1ab9a195c4a4565e1b1bb018f812b89127697b995c0c362140275e88b6d3dc4e
data/CHANGELOG.md CHANGED
@@ -4,7 +4,26 @@ 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.4...HEAD)
7
+ [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.10.0...HEAD)
8
+
9
+ ## 0.10.0
10
+
11
+ [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.9.0...0.10.0)
12
+
13
+ - Add new Ruby versions for `bump:ruby` [#52](https://github.com/ybiquitous/aufgaben/pull/52)
14
+ - Manage Ruby release URLs in JSON file [#53](https://github.com/ybiquitous/aufgaben/pull/53)
15
+
16
+ ## 0.9.0
17
+
18
+ [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.8.5...0.9.0)
19
+
20
+ - Support Ruby 3.0.3/2.7.5/2.6.9 for `bump:ruby` [#50](https://github.com/ybiquitous/aufgaben/pull/50)
21
+
22
+ ## 0.8.5
23
+
24
+ [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.8.4...0.8.5)
25
+
26
+ - Check committed files on `release` task [#49](https://github.com/ybiquitous/aufgaben/pull/49)
8
27
 
9
28
  ## 0.8.4
10
29
 
data/lib/aufgaben/base.rb CHANGED
@@ -17,5 +17,9 @@ module Aufgaben
17
17
  def dry_run?
18
18
  ENV["DRY_RUN"] || dry_run
19
19
  end
20
+
21
+ def git(*cmd, &block)
22
+ sh("git", *cmd, &block)
23
+ end
20
24
  end
21
25
  end
@@ -83,8 +83,8 @@ MSG
83
83
  elsif !dry_run?
84
84
  puts "Committing changed files ..."
85
85
  puts ""
86
- sh "git", "add", *changed_files
87
- sh "git", "commit", "-m", commit_message
86
+ git "add", *changed_files
87
+ git "commit", "-m", commit_message
88
88
  end
89
89
  end
90
90
  end
@@ -1,4 +1,5 @@
1
1
  require_relative "./base"
2
+ require "json"
2
3
 
3
4
  module Aufgaben
4
5
  class Bump::Ruby < Bump::Base
@@ -8,25 +9,7 @@ module Aufgaben
8
9
  ].freeze
9
10
 
10
11
  DEFAULT_RELEASE_NOTE_URL = "https://www.ruby-lang.org/en/news".freeze
11
- RELEASE_NOTE_URLS = {
12
- "3.0.2": "https://www.ruby-lang.org/en/news/2021/07/07/ruby-3-0-2-released/",
13
- "3.0.1": "https://www.ruby-lang.org/en/news/2021/04/05/ruby-3-0-1-released/",
14
- "3.0.0": "https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/",
15
- "2.7.4": "https://www.ruby-lang.org/en/news/2021/07/07/ruby-2-7-4-released/",
16
- "2.7.3": "https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-7-3-released/",
17
- "2.7.2": "https://www.ruby-lang.org/en/news/2020/10/02/ruby-2-7-2-released/",
18
- "2.7.1": "https://www.ruby-lang.org/en/news/2020/03/31/ruby-2-7-1-released/",
19
- "2.7.0": "https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/",
20
- "2.6.8": "https://www.ruby-lang.org/en/news/2021/07/07/ruby-2-6-8-released/",
21
- "2.6.7": "https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-6-7-released/",
22
- "2.6.6": "https://www.ruby-lang.org/en/news/2020/03/31/ruby-2-6-6-released/",
23
- "2.6.5": "https://www.ruby-lang.org/en/news/2019/10/01/ruby-2-6-5-released/",
24
- "2.6.4": "https://www.ruby-lang.org/en/news/2019/08/28/ruby-2-6-4-released/",
25
- "2.6.3": "https://www.ruby-lang.org/en/news/2019/04/17/ruby-2-6-3-released/",
26
- "2.6.2": "https://www.ruby-lang.org/en/news/2019/03/13/ruby-2-6-2-released/",
27
- "2.6.1": "https://www.ruby-lang.org/en/news/2019/01/30/ruby-2-6-1-released/",
28
- "2.6.0": "https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/",
29
- }.freeze
12
+ RELEASE_NOTE_URLS = JSON.parse(File.read(File.join(__dir__, "..", "..", "ruby_release_urls.json")), symbolize_names: true).freeze
30
13
 
31
14
  def initialize(name = :ruby, ns = default_namespace, depends: [])
32
15
  self.files = DEFAULT_FILES.dup
@@ -34,8 +34,8 @@ module Aufgaben
34
34
 
35
35
  msg "If you want to do this on dry-run mode, set 'DRY_RUN=1'." unless dry_run?
36
36
 
37
- sh "git", "checkout", default_branch, "--quiet"
38
- sh "git", "pull", "origin", default_branch, "--quiet"
37
+ git "checkout", default_branch, "--quiet"
38
+ git "pull", "origin", default_branch, "--quiet"
39
39
  sh "bundle", "install", "--quiet"
40
40
 
41
41
  if current_version.empty?
@@ -47,7 +47,7 @@ module Aufgaben
47
47
  end
48
48
  end
49
49
 
50
- sh "git", "diff", "--exit-code", "--quiet" do |ok|
50
+ git "diff", "--exit-code", "--quiet" do |ok|
51
51
  abort "Uncommitted changes found!" unless ok
52
52
  end
53
53
 
@@ -57,7 +57,7 @@ module Aufgaben
57
57
  msg "Releasing a new version: #{current_version} -> #{colored_new_version}"
58
58
  end
59
59
 
60
- sh "git", "--no-pager", "log", "--format=%C(auto)%h %Creset%s", "#{current_version}..HEAD"
60
+ git "--no-pager", "log", "--format=%C(auto)%h %Creset%s", "#{current_version}..HEAD"
61
61
 
62
62
  each_file do |file|
63
63
  update_version_in file, write: false
@@ -75,16 +75,18 @@ module Aufgaben
75
75
  else
76
76
  add_changelog with: new_version
77
77
  end
78
- sh "git", "add", changelog
78
+ git "add", changelog
79
79
 
80
80
  each_file do |file|
81
81
  update_version_in file
82
- sh "git", "add", file
82
+ git "add", file
83
83
  end
84
84
 
85
- sh "git", "commit", "--quiet", "--message", "Version #{new_version}"
86
- sh "git", "tag", "--annotate", "--message", "Version #{new_version}", new_version
87
- sh "git", "show", "--pretty"
85
+ git "commit", "--quiet", "--message", "Version #{new_version}"
86
+ git "tag", "--annotate", "--message", "Version #{new_version}", new_version
87
+ git "show", "--pretty"
88
+
89
+ check_committed_files
88
90
 
89
91
  git_push = Color.new("git push --follow-tags").green
90
92
  msg "The tag '#{colored_new_version}' is added. Run '#{git_push}'."
@@ -158,8 +160,25 @@ module Aufgaben
158
160
  msg "'#{changelog}' is added."
159
161
  end
160
162
 
163
+ def check_committed_files
164
+ expected = [*expanded_files, changelog].sort
165
+ actual = `git diff --name-only HEAD^...HEAD`.lines(chomp: true).sort
166
+
167
+ if expected != actual
168
+ abort <<~MSG
169
+ The committed files are not what was expected.
170
+ Expected: #{expected}
171
+ Actual: #{actual}
172
+ MSG
173
+ end
174
+ end
175
+
176
+ def expanded_files
177
+ @expanded_files ||= Dir.glob(files, File::FNM_EXTGLOB)
178
+ end
179
+
161
180
  def each_file(&block)
162
- Dir.glob(files, File::FNM_EXTGLOB).each(&block)
181
+ expanded_files.each(&block)
163
182
  end
164
183
 
165
184
  def update_version_in(file, write: true)
@@ -1,3 +1,3 @@
1
1
  module Aufgaben
2
- VERSION = "0.8.4".freeze
2
+ VERSION = "0.10.0".freeze
3
3
  end
@@ -0,0 +1,28 @@
1
+ {
2
+ "3.1.2": "https://www.ruby-lang.org/en/news/2022/04/12/ruby-3-1-2-released/",
3
+ "3.1.1": "https://www.ruby-lang.org/en/news/2022/02/18/ruby-3-1-1-released/",
4
+ "3.1.0": "https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/",
5
+ "3.0.4": "https://www.ruby-lang.org/en/news/2022/04/12/ruby-3-0-4-released/",
6
+ "3.0.3": "https://www.ruby-lang.org/en/news/2021/11/24/ruby-3-0-3-released/",
7
+ "3.0.2": "https://www.ruby-lang.org/en/news/2021/07/07/ruby-3-0-2-released/",
8
+ "3.0.1": "https://www.ruby-lang.org/en/news/2021/04/05/ruby-3-0-1-released/",
9
+ "3.0.0": "https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/",
10
+ "2.7.6": "https://www.ruby-lang.org/en/news/2022/04/12/ruby-2-7-6-released/",
11
+ "2.7.5": "https://www.ruby-lang.org/en/news/2021/11/24/ruby-2-7-5-released/",
12
+ "2.7.4": "https://www.ruby-lang.org/en/news/2021/07/07/ruby-2-7-4-released/",
13
+ "2.7.3": "https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-7-3-released/",
14
+ "2.7.2": "https://www.ruby-lang.org/en/news/2020/10/02/ruby-2-7-2-released/",
15
+ "2.7.1": "https://www.ruby-lang.org/en/news/2020/03/31/ruby-2-7-1-released/",
16
+ "2.7.0": "https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/",
17
+ "2.6.10": "https://www.ruby-lang.org/en/news/2022/04/12/ruby-2-6-10-released/",
18
+ "2.6.9": "https://www.ruby-lang.org/en/news/2021/11/24/ruby-2-6-9-released/",
19
+ "2.6.8": "https://www.ruby-lang.org/en/news/2021/07/07/ruby-2-6-8-released/",
20
+ "2.6.7": "https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-6-7-released/",
21
+ "2.6.6": "https://www.ruby-lang.org/en/news/2020/03/31/ruby-2-6-6-released/",
22
+ "2.6.5": "https://www.ruby-lang.org/en/news/2019/10/01/ruby-2-6-5-released/",
23
+ "2.6.4": "https://www.ruby-lang.org/en/news/2019/08/28/ruby-2-6-4-released/",
24
+ "2.6.3": "https://www.ruby-lang.org/en/news/2019/04/17/ruby-2-6-3-released/",
25
+ "2.6.2": "https://www.ruby-lang.org/en/news/2019/03/13/ruby-2-6-2-released/",
26
+ "2.6.1": "https://www.ruby-lang.org/en/news/2019/01/30/ruby-2-6-1-released/",
27
+ "2.6.0": "https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/"
28
+ }
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.4
4
+ version: 0.10.0
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-09-07 00:00:00.000000000 Z
11
+ date: 2022-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -71,6 +71,7 @@ files:
71
71
  - lib/aufgaben/color.rb
72
72
  - lib/aufgaben/release.rb
73
73
  - lib/aufgaben/version.rb
74
+ - lib/ruby_release_urls.json
74
75
  homepage: https://github.com/ybiquitous/aufgaben
75
76
  licenses:
76
77
  - MIT
@@ -93,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
94
  - !ruby/object:Gem::Version
94
95
  version: '0'
95
96
  requirements: []
96
- rubygems_version: 3.2.22
97
+ rubygems_version: 3.2.33
97
98
  signing_key:
98
99
  specification_version: 4
99
100
  summary: The collection of useful Rake tasks.