maid 0.11.1 → 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 +4 -4
- data/.github/workflows/coverage-upload.yml +7 -5
- data/.github/workflows/lint.yml +3 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +1 -1
- data/README.md +5 -2
- data/lib/maid/app.rb +5 -1
- data/lib/maid/maid.rb +2 -1
- data/lib/maid/version.rb +1 -1
- data/spec/lib/maid/app_spec.rb +31 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f06b2e8a1e67b8d0551b23f60e57f2be5cf708f4697af73132d35b28deea335
|
|
4
|
+
data.tar.gz: 18a2f0976a81595f7c499f440d748aa755289c06b2ba07769524f3625f5ff401
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b6f0a162c7f37c351d0ab1386ee3acb736008015c5307e41ee1d7ea470f8b3cce68cff2f9a2579df3eed18cc4d9caafec721622d013f0276e1eb06a8bb91eea2
|
|
7
|
+
data.tar.gz: 32ee3e34ceabf430e3bfc17ae0bab8b5ae22ebcbf3b69050c0849d7d6b2a1fedeb95d0ca2041460c35a453173df991486ecfa57fa7bf195ee5d91926eb5f1291
|
|
@@ -21,11 +21,13 @@ jobs:
|
|
|
21
21
|
- name: Install dependencies
|
|
22
22
|
run: bundle install
|
|
23
23
|
|
|
24
|
-
- name:
|
|
25
|
-
|
|
26
|
-
with:
|
|
27
|
-
coverageCommand: bundle exec rake
|
|
24
|
+
- name: Generate coverage report
|
|
25
|
+
run: bundle exec rake
|
|
28
26
|
env:
|
|
29
|
-
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_KEY }}
|
|
30
27
|
COVERAGE: true
|
|
31
28
|
ISOLATED: true
|
|
29
|
+
|
|
30
|
+
- uses: qltysh/qlty-action/coverage@v2
|
|
31
|
+
with:
|
|
32
|
+
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
|
|
33
|
+
files: coverage/.resultset.json
|
data/.github/workflows/lint.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
8
|
+
## [0.11.2](https://github.com/maid/maid/compare/v0.11.1...v0.11.2) (2025-11-29)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **Logger:** Provide default logger ([#354](https://github.com/maid/maid/issues/354)) ([2002e58](https://github.com/maid/maid/commit/2002e5846f84fa71addbda0f3909ade871e253c3))
|
|
14
|
+
|
|
1
15
|
## [0.11.1](https://github.com/maid/maid/compare/v0.11.0...v0.11.1) (2025-08-16)
|
|
2
16
|
|
|
3
17
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
# Maid
|
|
2
2
|
|
|
3
|
+
[](https://cloudbreak.app/promotional_banner/visit?source=maid_readme)
|
|
4
|
+
|
|
3
5
|
[](https://badge.fury.io/rb/maid)
|
|
6
|
+

|
|
4
7
|
[](https://github.com/maid/maid/actions/workflows/test.yml)
|
|
5
|
-
[](https://qlty.sh/gh/maid/projects/maid)
|
|
9
|
+
[](https://qlty.sh/gh/maid/projects/maid)
|
|
7
10
|
[](http://stackoverflow.com/questions/tagged/maid)
|
|
8
11
|
|
|
9
12
|
**Be lazy!** Let Maid clean up after you, based on rules you define.
|
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/maid.rb
CHANGED
|
@@ -28,7 +28,8 @@ class Maid::Maid
|
|
|
28
28
|
def initialize(options = {})
|
|
29
29
|
options = DEFAULTS.merge(options.reject { |_k, v| v.nil? })
|
|
30
30
|
|
|
31
|
-
@
|
|
31
|
+
@log_device = options[:log_device]
|
|
32
|
+
@logger = (options[:logger] || DEFAULTS[:logger]).new(device: @log_device)
|
|
32
33
|
|
|
33
34
|
@rules_path = options[:rules_path]
|
|
34
35
|
@trash_path = options[:trash_path] || default_trash_path
|
data/lib/maid/version.rb
CHANGED
data/spec/lib/maid/app_spec.rb
CHANGED
|
@@ -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
|
-
|
|
78
|
-
|
|
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
|
-
|
|
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.
|
|
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:
|
|
11
|
+
date: 2026-09-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: deprecated
|