Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 36df40c

Browse files
committed
2025年04月25日 v. 9.3.4.1: added StageChecker
1 parent c905ca4 commit 36df40c

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ Gemfile.lock
4141

4242
# Version checker
4343
*.remote
44+
45+
.cursor

‎Rakefile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ require_relative './ci/readme_paths_checker'
2525
require_relative './ci/tests_checker'
2626
require_relative './ci/version_checker'
2727
require_relative './ci/duplicate_links_checker'
28+
require_relative './ci/stage_checker'
2829
task :ci do
2930
[
3031
::CI::LinksChecker.new,
3132
::CI::ReadmeDuplicatesChecker.new,
3233
::CI::ReadmePathsChecker.new,
3334
::CI::TestsChecker.new,
3435
::CI::VersionChecker.new,
35-
::CI::DuplicateLinksChecker.new
36+
::CI::DuplicateLinksChecker.new,
37+
::CI::StageChecker.new
3638
].each(&:process)
3739
end

‎ci/ci_job.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def run
2020
end
2121

2222
# Use this method in your realization when task completed with error.
23-
# @param {String} details
23+
# @param {Proc} details
2424
# @return {Void}
2525
def end_with_error(details)
2626
details.call

‎ci/stage_checker.rb‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
require_relative './ci_job'
4+
5+
module CI
6+
# CI job that checks all files are staged for commit.
7+
class StageChecker < ::CI::CIJob
8+
# Process StageChecker.
9+
# @return {Void}
10+
def process
11+
git_status = `git status --porcelain`
12+
13+
return if git_status.empty?
14+
15+
end_with_error(-> { puts("StageChecker found unstaged changes:\n#{git_status}") })
16+
end
17+
end
18+
end

‎leetcode-ruby.gemspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require 'English'
55
::Gem::Specification.new do |s|
66
s.required_ruby_version = '>= 3.0'
77
s.name = 'leetcode-ruby'
8-
s.version = '9.3.4'
8+
s.version = '9.3.4.1'
99
s.license = 'MIT'
1010
s.files = ::Dir['lib/**/*.rb'] + %w[README.md]
1111
s.executable = 'leetcode-ruby'

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /