maid 0.11.2 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 479757df2dd129b8ef466d7bf3af093bc778b8c83cdea5fc595b5ad01da5c26d
4
- data.tar.gz: 96858a78a26b66854433e7b8e60c60d1c2c7fbdc40ec8bae66f9cb7ee89ad831
3
+ metadata.gz: 8f06b2e8a1e67b8d0551b23f60e57f2be5cf708f4697af73132d35b28deea335
4
+ data.tar.gz: 18a2f0976a81595f7c499f440d748aa755289c06b2ba07769524f3625f5ff401
5
5
  SHA512:
6
- metadata.gz: 54abf67a7d658986d21f500d54949a344e7dbd39f1879ab8f39d92dd03eb10cdd465f0a8730398cbd6767e48001f5deb3511685ba6a76bd179e80da27c5f6862
7
- data.tar.gz: 468c5bcd0cbbe7e4ee4470e14378d791e73b4864ab4c6615d2a190b905a2d819260832af60ac4b75c89da50baab95504761062811a11f71e4bee33f36db4711a
6
+ metadata.gz: b6f0a162c7f37c351d0ab1386ee3acb736008015c5307e41ee1d7ea470f8b3cce68cff2f9a2579df3eed18cc4d9caafec721622d013f0276e1eb06a8bb91eea2
7
+ data.tar.gz: 32ee3e34ceabf430e3bfc17ae0bab8b5ae22ebcbf3b69050c0849d7d6b2a1fedeb95d0ca2041460c35a453173df991486ecfa57fa7bf195ee5d91926eb5f1291
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.11.3](https://github.com/maid/maid/compare/v0.11.2...v0.11.3) (2026-09-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **thor:** Return failure status for invalid switches ([#356](https://github.com/maid/maid/issues/356)) ([3443d42](https://github.com/maid/maid/commit/3443d424a4602284b0e499a0bf81db006578a3ba))
7
+
1
8
  ## [0.11.2](https://github.com/maid/maid/compare/v0.11.1...v0.11.2) (2025-11-29)
2
9
 
3
10
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maid (0.11.2)
4
+ maid (0.11.3)
5
5
  deprecated (~> 3.0.0)
6
6
  dimensions (>= 1.0.0, < 2.0)
7
7
  escape (>= 0.0.1, < 0.1.0)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Maid
2
2
 
3
+ [![Sponsored by CloudBreak](https://cloudbreak.app/promotional_banner.svg?source=maid_readme)](https://cloudbreak.app/promotional_banner/visit?source=maid_readme)
4
+
3
5
  [![Gem Version](https://badge.fury.io/rb/maid.svg)](https://badge.fury.io/rb/maid)
4
6
  ![GitHub Release](https://img.shields.io/github/v/release/maid/maid)
5
7
  [![Test](https://github.com/maid/maid/actions/workflows/test.yml/badge.svg)](https://github.com/maid/maid/actions/workflows/test.yml)
data/lib/maid/app.rb CHANGED
@@ -2,10 +2,14 @@ require 'fileutils'
2
2
 
3
3
  require 'thor'
4
4
 
5
- class Maid::App < Thor
5
+ class Maid::App < Thor # rubocop:disable Metrics/ClassLength
6
6
  check_unknown_options!
7
7
  default_task 'introduction'
8
8
 
9
+ def self.exit_on_failure?
10
+ true
11
+ end
12
+
9
13
  desc 'introduction', 'Become aquainted with maid'
10
14
  def introduction
11
15
  say <<~EOF
data/lib/maid/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Maid
4
- VERSION = '0.11.2'
4
+ VERSION = '0.11.3'
5
5
  SUMMARY = 'Be lazy. Let Maid clean up after you, based on rules you define. ' \
6
6
  'Think of it as "Hazel for hackers".'
7
7
  end
@@ -27,6 +27,17 @@ ensure
27
27
  $stderr = STDERR
28
28
  end
29
29
 
30
+ def capture_stderr_and_exit_status
31
+ out = StringIO.new
32
+ $stderr = out
33
+ yield
34
+ [out.string, 0]
35
+ rescue SystemExit => e
36
+ [out.string, e.status]
37
+ ensure
38
+ $stderr = STDERR
39
+ end
40
+
30
41
  module Maid
31
42
  describe App, '#clean' do
32
43
  before do
@@ -74,12 +85,22 @@ module Maid
74
85
  end
75
86
 
76
87
  it 'complains about a MISSPELLED option' do
77
- expect(capture_stderr { App.start(['clean', '--slient']) }).to match(/Unknown/)
78
- expect(capture_stderr { App.start(['clean', '--noop', '--slient']) }).to match(/Unknown/)
88
+ [
89
+ ['clean', '--slient'],
90
+ ['clean', '--noop', '--slient'],
91
+ ].each do |arguments|
92
+ message, exit_status = capture_stderr_and_exit_status { App.start(arguments) }
93
+
94
+ expect(message).to match(/Unknown/)
95
+ expect(exit_status).to eq(1)
96
+ end
79
97
  end
80
98
 
81
99
  it 'complains about an undefined task' do
82
- expect(capture_stderr { App.start(['rules.rb']) }).to match(/Could not find/)
100
+ message, exit_status = capture_stderr_and_exit_status { App.start(['rules.rb']) }
101
+
102
+ expect(message).to match(/Could not find/)
103
+ expect(exit_status).to eq(1)
83
104
  end
84
105
  end
85
106
 
@@ -97,6 +118,13 @@ module Maid
97
118
  expect(App.start(['--version'])).to eq(@app.version)
98
119
  end
99
120
 
121
+ it 'exits unsuccessfully for an invalid switch' do
122
+ message, exit_status = capture_stderr_and_exit_status { App.start(['-version']) }
123
+
124
+ expect(message).to match(/Unknown switches "-version"/)
125
+ expect(exit_status).to eq(1)
126
+ end
127
+
100
128
  context 'with the "long" option' do
101
129
  before do
102
130
  # FIXME: This is ugly. Maybe use `Maid.start(%w(version --long))` instead.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Oakes
8
8
  - Coaxial
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-29 00:00:00.000000000 Z
11
+ date: 2026-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deprecated