aufgaben 0.8.4 → 0.8.5

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: 7a5183c060cb857117a2f48b0e944fec202ec940310638fa36a588ee71295f60
4
+ data.tar.gz: 7eb0f5f2afed4376f9e07fe4f03516c4f190f18e4f2dfbd8b84689032dda0e1c
5
5
  SHA512:
6
- metadata.gz: 7d08f4f69f9581f0789e4e775a0dcdb15dda7511956acd0ed44c2f3f0b324122530b7b0f0b2899adc5597384dc51fb3be2e6d56d9dc39458ff3c0f7a43d0c532
7
- data.tar.gz: 908642fe3a1d55c4343410e29ef462e58a4d3733ece3ed12a5b6e83dfdcd5dcff748bb3675b0f78fd51ca934b9eba6a5d1cc0154d90acf3dbe62b70c3b9410ba
6
+ metadata.gz: 6fb90efed4ac4cea0a638890880db35999f91b457ebf24e834e304156b7701e9a642e70f4e450c9a32364dc4629e421ee17e57f31700cad1e7422367e021257a
7
+ data.tar.gz: fde7bec5eb41b82cd32cbe7380ecccb1f54ac04240d57ccc044e904e960e3cd6a7b9bd5b159f0d4536e552a9d1aca24962eb754e2462a94864a4cd4a7e86647e
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.4...HEAD)
7
+ [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.8.5...HEAD)
8
+
9
+ ## 0.8.5
10
+
11
+ [Full diff](https://github.com/ybiquitous/aufgaben/compare/0.8.4...0.8.5)
12
+
13
+ - Check committed files on `release` task [#49](https://github.com/ybiquitous/aufgaben/pull/49)
8
14
 
9
15
  ## 0.8.4
10
16
 
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
@@ -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.8.5".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masafumi Koba