pennyworth 13.0.0 → 13.2.0

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: 65ec39b7057feb66b3530a5f4ec44b1649093b871b1dcba10b783e45e2b5f181
4
- data.tar.gz: 020e6240c268646bf6522ffc283d50fadd4ad1413126e3328d64c03098af6329
3
+ metadata.gz: b3cebd285e4000aba774c716d9bc944fb6a836bf55170f0c33d9395497934f53
4
+ data.tar.gz: 8c5a01d3f6c905f48a87a1b8a493d8c6c5a3e1acf6a8ac9bfb4dec3bd6852b63
5
5
  SHA512:
6
- metadata.gz: c9a74e10efac0ce02c565883d0cac022813c53ad765b4f912ab1ceee9432fc1e5c1b749180463b0413f96dac92d26838e4a2e4fdf18e50b5b1e8398507f3186f
7
- data.tar.gz: a0f2724e65cf94370288a1f640d74c86c595a83231c30f23765799660ce92b7e4dfbb08bff0808b46b00e625ccc0c8edc2744221238e97be8e7eef27568d5bb1
6
+ metadata.gz: 6ec8f05dc8a522a668727544ae256c206479c9fb6066b93823f47a5c07d64fb83955377da0ee6bc5c487e173d3b86ecd9680a034efb1f90427df3fe3bf42f21e
7
+ data.tar.gz: 932346b9d5607c23daa7baf0fcb85bc7bc5e8afd4c4aed24d3f7dd5162ef795ff402fa83dd79c78ae75e1710c94efdd638fa49590eeab3f56fb648e021e30207
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -351,6 +351,23 @@ This keyword allows you to generate a repeating sequence of the same character(s
351
351
  Type `repeat` to activate and `ENTER` generate. You must supply the character(s) you want to repeat
352
352
  followed by a number indicating how many times you want the character(s) to repeat.
353
353
 
354
+ ===== Standard Errors
355
+
356
+ image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-standard_errors.png[Standard Errors,width=706,height=632,role=focal_point]
357
+
358
+ This keyword allows you to list all subclasses of `StandardError`. Due to the dynamic nature of how
359
+ these subclasses are loaded, they are influenced by this gem's environment and dependencies which
360
+ can be either too narrow or too verbose. This list also includes system errors which have a
361
+ specialized workflow as described below. While this list can be long, it is alphabetically sorted
362
+ for quick filtering when fuzzy typing.
363
+
364
+ Type `stderr` to activate. Use `ENTER` to copy the subclass to clipboard, `CONTROL` to copy the
365
+ error name, or `OPTION` to copy the source path.
366
+
367
+ 💡 The subclass source path might not always be available because not all subclasses are written in
368
+ Ruby but C instead. That said, when the source path does exist, you'll get the full path plus line
369
+ number in the format of `<source path>:<line number>` for easy loading within your editor of choice.
370
+
354
371
  ===== System Errors
355
372
 
356
373
  image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-system_errors.png[System Errors,width=706,height=632,role=focal_point]
@@ -456,6 +473,27 @@ Provides quick access to link:https://bundler.io[Bundler] related resources.
456
473
  double click to install.
457
474
  2. Type `bundler` to activate.
458
475
 
476
+ ===== Crystal
477
+
478
+ image:https://www.alchemists.io/images/projects/pennyworth/screenshots/crystal.png[Crystal workflow screenshot.,width=706,height=362,role=focal_point]
479
+
480
+ A link:https://crystal-lang.org[Crystal] workflow for quick access to Crystal resources.
481
+
482
+ 1. link:https://www.alchemists.io/public/alfred/workflows/crystal.alfredworkflow[Download] and
483
+ double click to install.
484
+ 2. Type `crystal` to view general information, arrow keys to navigate, and `ENTER` to view
485
+ information.
486
+
487
+ ===== CSS
488
+
489
+ image:https://www.alchemists.io/images/projects/pennyworth/screenshots/css.png[CSS workflow screenshot.,width=706,height=470,role=focal_point]
490
+
491
+ A link:https://www.w3.org/Style/CSS/specs.en.html[CSS] workflow for quick access to CSS resources.
492
+
493
+ 1. link:https://www.alchemists.io/public/alfred/workflows/css.alfredworkflow[Download] and double
494
+ click to install.
495
+ 2. Type `cx` to view general information, arrow keys to navigate, and `ENTER` to view information.
496
+
459
497
  ===== Elm
460
498
 
461
499
  image:https://www.alchemists.io/images/projects/pennyworth/screenshots/elm.png[Elm workflow screenshot.,width=706,height=470,role=focal_point]
@@ -514,6 +552,17 @@ Provides macOS utilities.
514
552
  double click to install.
515
553
  2. Open the workflow to see all available keywords.
516
554
 
555
+ ===== RSpec
556
+
557
+ image:https://www.alchemists.io/images/projects/pennyworth/screenshots/rspec.png[RSpec workflow screenshot.,width=706,height=362,role=focal_point]
558
+
559
+ A link:https://rspec.info[RSpec] workflow for quick access to RSpec resources.
560
+
561
+ 1. link:https://www.alchemists.io/public/alfred/workflows/rspec.alfredworkflow[Download] and double
562
+ click to install.
563
+ 2. Type `rspec` to view general information, arrow keys to navigate, and `ENTER` to view
564
+ information.
565
+
517
566
  ===== Terraform
518
567
 
519
568
  image:https://www.alchemists.io/images/projects/pennyworth/screenshots/terraform.png[Terraform workflow screenshot.,width=706,height=632,role=focal_point]
@@ -18,6 +18,7 @@ module Pennyworth
18
18
  register(:git_hub) { GitHub.new }
19
19
  register(:http_statuses) { HTTPStatuses.new }
20
20
  register(:ruby_gems) { RubyGems.new }
21
+ register(:standard_errors) { StandardErrors.new }
21
22
  register(:system_errors) { System::Errors.new }
22
23
  register(:system_signals) { System::Signals.new }
23
24
  register(:text) { Text.new }
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pennyworth
4
+ module CLI
5
+ module Actions
6
+ # Handles the system errors action.
7
+ class StandardErrors
8
+ include Pennyworth::Import[:logger]
9
+
10
+ def initialize processor: Processor.for_standard_errors, **dependencies
11
+ super(**dependencies)
12
+ @processor = processor
13
+ end
14
+
15
+ def call = processor.call.to_json.then { |json| logger.info { json } }
16
+
17
+ private
18
+
19
+ attr_reader :processor
20
+ end
21
+ end
22
+ end
23
+ end
@@ -71,6 +71,12 @@ module Pennyworth
71
71
  end
72
72
  end
73
73
 
74
+ def add_standard_errors
75
+ client.on "--standard_errors", "Render Alfred standard errors script filter." do
76
+ configuration.action_standard_errors = true
77
+ end
78
+ end
79
+
74
80
  def add_system_errors
75
81
  client.on "--system_errors", "Render Alfred system errors script filter." do
76
82
  configuration.action_system_errors = true
@@ -10,6 +10,7 @@ module Pennyworth
10
10
  :git_hub,
11
11
  :http_statuses,
12
12
  :ruby_gems,
13
+ :standard_errors,
13
14
  :system_errors,
14
15
  :system_signals,
15
16
  :text,
@@ -42,8 +43,9 @@ module Pennyworth
42
43
  in action_http_statuses: true then http_statuses.call
43
44
  in action_ruby_gems: true
44
45
  ruby_gems.call "owners/#{configuration.ruby_gems_owner}/gems.json"
45
- in action_system_signals: true then system_signals.call
46
+ in action_standard_errors: true then standard_errors.call
46
47
  in action_system_errors: true then system_errors.call
48
+ in action_system_signals: true then system_signals.call
47
49
  in action_text: String => content then text.call content
48
50
  in action_version: true then logger.info { specification.labeled_version }
49
51
  else logger.any { parser.to_s }
@@ -8,6 +8,7 @@ module Pennyworth
8
8
  :action_git_hub,
9
9
  :action_http_statuses,
10
10
  :action_ruby_gems,
11
+ :action_standard_errors,
11
12
  :action_system_errors,
12
13
  :action_system_signals,
13
14
  :action_text,
@@ -6,6 +6,7 @@
6
6
  - "Dry Cli": "Dry CLI"
7
7
  - "Flacsmith": "FLACsmith"
8
8
  - "Git Plus": "Git+"
9
+ - "Http Fake": "HTTP Fake"
9
10
  - "Mac Os Config": "macOS Configuration"
10
11
  - "Mac Os": "MacOS"
11
12
  - "Prawn Plus": "Prawn+"
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pennyworth
4
+ module Loaders
5
+ # Loads an array of standard error records.
6
+ class StandardErrors
7
+ def initialize root: StandardError, model: Models::StandardError
8
+ @root = root
9
+ @model = model
10
+ end
11
+
12
+ def call _omit = nil
13
+ ObjectSpace.each_object(Class)
14
+ .select { |klass| klass < root }
15
+ .sort_by(&:name)
16
+ .map do |error|
17
+ file_path, line_number = Object.const_source_location error.name
18
+ model[name: error, file_path:, line_number:]
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ attr_reader :root, :model
25
+ end
26
+ end
27
+ end
@@ -1,14 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/arrays"
4
-
5
3
  module Pennyworth
6
4
  module Loaders
7
5
  module System
8
6
  # Loads an array of system error records.
9
7
  class Errors
10
- using Refinements::Arrays
11
-
12
8
  def initialize errno: Errno, model: Models::System::Error
13
9
  @errno = errno
14
10
  @model = model
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pennyworth
4
+ module Models
5
+ # Defines a standard error.
6
+ StandardError = Struct.new :name, :file_path, :line_number, keyword_init: true
7
+ end
8
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/arrays"
4
+
5
+ module Pennyworth
6
+ module Presenters
7
+ # Renders a standard error into a compatible format for use in Alfred script filters.
8
+ class StandardError
9
+ using Refinements::Arrays
10
+
11
+ def initialize record
12
+ @record = record
13
+ end
14
+
15
+ def id = label
16
+
17
+ def label = record.name.to_s
18
+
19
+ def path = file_path.empty? ? "" : [file_path, record.line_number].compress!.join(":")
20
+
21
+ private
22
+
23
+ attr_reader :record
24
+
25
+ def file_path = record.file_path.to_s
26
+ end
27
+ end
28
+ end
@@ -27,10 +27,10 @@ module Pennyworth
27
27
  serializer: Serializers::Project
28
28
  end
29
29
 
30
- def self.for_system_signals
31
- new loader: Loaders::System::Signals.new,
32
- presenter: Presenters::System::Signal,
33
- serializer: Serializers::System::Signal
30
+ def self.for_standard_errors
31
+ new loader: Loaders::StandardErrors.new,
32
+ presenter: Presenters::StandardError,
33
+ serializer: Serializers::StandardError
34
34
  end
35
35
 
36
36
  def self.for_system_errors
@@ -39,6 +39,12 @@ module Pennyworth
39
39
  serializer: Serializers::System::Error
40
40
  end
41
41
 
42
+ def self.for_system_signals
43
+ new loader: Loaders::System::Signals.new,
44
+ presenter: Presenters::System::Signal,
45
+ serializer: Serializers::System::Signal
46
+ end
47
+
42
48
  def self.for_text
43
49
  new loader: Loaders::Text.new, presenter: Presenters::Text, serializer: Serializers::Text
44
50
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pennyworth
4
+ module Serializers
5
+ # Serializes a standard error into a compatible format for parsing within Alfred script filters.
6
+ class StandardError
7
+ def initialize presenter
8
+ @presenter = presenter
9
+ end
10
+
11
+ def to_h
12
+ {
13
+ uid: id,
14
+ title: id,
15
+ arg: label,
16
+ mods: modifications,
17
+ text: {copy: label, largetype: label}
18
+ }
19
+ end
20
+
21
+ private
22
+
23
+ attr_reader :presenter
24
+
25
+ def id = presenter.id
26
+
27
+ def label = presenter.label
28
+
29
+ def description = presenter.description
30
+
31
+ def modifications
32
+ {
33
+ control: {subtitle: "Copy label.", arg: label},
34
+ alt: {subtitle: "Copy path.", arg: path}
35
+ }
36
+ end
37
+
38
+ def path = presenter.path
39
+ end
40
+ end
41
+ end
data/pennyworth.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "pennyworth"
5
- spec.version = "13.0.0"
5
+ spec.version = "13.2.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://www.alchemists.io/projects/pennyworth"
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
13
13
  "bug_tracker_uri" => "https://github.com/bkuhlmann/pennyworth/issues",
14
14
  "changelog_uri" => "https://www.alchemists.io/projects/pennyworth/versions",
15
15
  "documentation_uri" => "https://www.alchemists.io/projects/pennyworth",
16
+ "funding_uri" => "https://github.com/sponsors/bkuhlmann",
16
17
  "label" => "Pennyworth",
17
18
  "rubygems_mfa_required" => "true",
18
19
  "source_code_uri" => "https://github.com/bkuhlmann/pennyworth"
@@ -22,14 +23,14 @@ Gem::Specification.new do |spec|
22
23
  spec.cert_chain = [Gem.default_cert_path]
23
24
 
24
25
  spec.required_ruby_version = "~> 3.1"
25
- spec.add_dependency "auto_injector", "~> 0.4"
26
- spec.add_dependency "cogger", "~> 0.0"
27
- spec.add_dependency "dry-container", "~> 0.8"
26
+ spec.add_dependency "auto_injector", "~> 0.5"
27
+ spec.add_dependency "cogger", "~> 0.1"
28
+ spec.add_dependency "dry-container", "~> 0.9"
28
29
  spec.add_dependency "http", "~> 5.0"
29
30
  spec.add_dependency "rack", "~> 2.2"
30
- spec.add_dependency "refinements", "~> 9.2"
31
- spec.add_dependency "runcom", "~> 8.2"
32
- spec.add_dependency "spek", "~> 0.2"
31
+ spec.add_dependency "refinements", "~> 9.4"
32
+ spec.add_dependency "runcom", "~> 8.4"
33
+ spec.add_dependency "spek", "~> 0.3"
33
34
  spec.add_dependency "zeitwerk", "~> 2.5"
34
35
 
35
36
  spec.bindir = "exe"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pennyworth
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.0.0
4
+ version: 13.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
29
29
  RFE=
30
30
  -----END CERTIFICATE-----
31
- date: 2022-04-09 00:00:00.000000000 Z
31
+ date: 2022-05-15 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: auto_injector
@@ -36,42 +36,42 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.4'
39
+ version: '0.5'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.4'
46
+ version: '0.5'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: cogger
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.0'
53
+ version: '0.1'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.0'
60
+ version: '0.1'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: dry-container
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.8'
67
+ version: '0.9'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '0.8'
74
+ version: '0.9'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: http
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -106,42 +106,42 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '9.2'
109
+ version: '9.4'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '9.2'
116
+ version: '9.4'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: runcom
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '8.2'
123
+ version: '8.4'
124
124
  type: :runtime
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '8.2'
130
+ version: '8.4'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: spek
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '0.2'
137
+ version: '0.3'
138
138
  type: :runtime
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '0.2'
144
+ version: '0.3'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: zeitwerk
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -177,6 +177,7 @@ files:
177
177
  - lib/pennyworth/cli/actions/http_statuses.rb
178
178
  - lib/pennyworth/cli/actions/import.rb
179
179
  - lib/pennyworth/cli/actions/ruby_gems.rb
180
+ - lib/pennyworth/cli/actions/standard_errors.rb
180
181
  - lib/pennyworth/cli/actions/system/errors.rb
181
182
  - lib/pennyworth/cli/actions/system/signals.rb
182
183
  - lib/pennyworth/cli/actions/text.rb
@@ -197,11 +198,13 @@ files:
197
198
  - lib/pennyworth/loaders/encodings.rb
198
199
  - lib/pennyworth/loaders/http_statuses.rb
199
200
  - lib/pennyworth/loaders/projects.rb
201
+ - lib/pennyworth/loaders/standard_errors.rb
200
202
  - lib/pennyworth/loaders/system/errors.rb
201
203
  - lib/pennyworth/loaders/system/signals.rb
202
204
  - lib/pennyworth/loaders/text.rb
203
205
  - lib/pennyworth/models/encoding.rb
204
206
  - lib/pennyworth/models/http_status.rb
207
+ - lib/pennyworth/models/standard_error.rb
205
208
  - lib/pennyworth/models/system/error.rb
206
209
  - lib/pennyworth/models/system/signal.rb
207
210
  - lib/pennyworth/models/text.rb
@@ -209,6 +212,7 @@ files:
209
212
  - lib/pennyworth/presenters/gem.rb
210
213
  - lib/pennyworth/presenters/http_status.rb
211
214
  - lib/pennyworth/presenters/repository.rb
215
+ - lib/pennyworth/presenters/standard_error.rb
212
216
  - lib/pennyworth/presenters/system/error.rb
213
217
  - lib/pennyworth/presenters/system/signal.rb
214
218
  - lib/pennyworth/presenters/text.rb
@@ -216,6 +220,7 @@ files:
216
220
  - lib/pennyworth/serializers/encoding.rb
217
221
  - lib/pennyworth/serializers/http_status.rb
218
222
  - lib/pennyworth/serializers/project.rb
223
+ - lib/pennyworth/serializers/standard_error.rb
219
224
  - lib/pennyworth/serializers/system/error.rb
220
225
  - lib/pennyworth/serializers/system/signal.rb
221
226
  - lib/pennyworth/serializers/text.rb
@@ -227,6 +232,7 @@ metadata:
227
232
  bug_tracker_uri: https://github.com/bkuhlmann/pennyworth/issues
228
233
  changelog_uri: https://www.alchemists.io/projects/pennyworth/versions
229
234
  documentation_uri: https://www.alchemists.io/projects/pennyworth
235
+ funding_uri: https://github.com/sponsors/bkuhlmann
230
236
  label: Pennyworth
231
237
  rubygems_mfa_required: 'true'
232
238
  source_code_uri: https://github.com/bkuhlmann/pennyworth
@@ -245,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
251
  - !ruby/object:Gem::Version
246
252
  version: '0'
247
253
  requirements: []
248
- rubygems_version: 3.3.11
254
+ rubygems_version: 3.3.13
249
255
  signing_key:
250
256
  specification_version: 4
251
257
  summary: A command line interface that augments Alfred workflows.
metadata.gz.sig CHANGED
Binary file