pennyworth 17.8.0 → 18.0.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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +5 -5
  4. data/lib/pennyworth/cli/actions/encoding.rb +1 -10
  5. data/lib/pennyworth/cli/actions/gem.rb +1 -10
  6. data/lib/pennyworth/cli/actions/git_hub/organization.rb +1 -10
  7. data/lib/pennyworth/cli/actions/git_hub/user.rb +1 -10
  8. data/lib/pennyworth/cli/actions/htmx/example.rb +1 -10
  9. data/lib/pennyworth/cli/actions/htmx/extension.rb +1 -10
  10. data/lib/pennyworth/cli/actions/htmx/reference.rb +1 -10
  11. data/lib/pennyworth/cli/actions/http_status.rb +1 -10
  12. data/lib/pennyworth/cli/actions/standard_error.rb +1 -10
  13. data/lib/pennyworth/cli/actions/standard_gem.rb +3 -4
  14. data/lib/pennyworth/cli/actions/system/error.rb +1 -10
  15. data/lib/pennyworth/cli/actions/system/signal.rb +1 -10
  16. data/lib/pennyworth/cli/actions/text.rb +1 -10
  17. data/lib/pennyworth/cli/shell.rb +1 -1
  18. data/lib/pennyworth/configuration/contract.rb +4 -4
  19. data/lib/pennyworth/configuration/defaults.yml +4 -4
  20. data/lib/pennyworth/configuration/model.rb +4 -4
  21. data/lib/pennyworth/container.rb +62 -0
  22. data/lib/pennyworth/{import.rb → dependencies.rb} +1 -1
  23. data/lib/pennyworth/loaders/gem.rb +2 -2
  24. data/lib/pennyworth/loaders/htmx.rb +8 -2
  25. data/lib/pennyworth/loaders/http_status.rb +2 -2
  26. data/lib/pennyworth/loaders/standard_gem.rb +2 -2
  27. data/lib/pennyworth/presenters/gem.rb +4 -4
  28. data/lib/pennyworth/presenters/repository.rb +4 -4
  29. data/lib/pennyworth/presenters/standard_gem.rb +4 -4
  30. data/lib/pennyworth/processor.rb +1 -54
  31. data/lib/pennyworth/serializers/htmx.rb +5 -5
  32. data/lib/pennyworth/serializers/project.rb +8 -8
  33. data/pennyworth.gemspec +14 -14
  34. data.tar.gz.sig +0 -0
  35. metadata +29 -36
  36. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 525b33abcfdbb7c8f14f729b6ea42f7ed6dd12c0c3b6f86786dd0e23590e21ff
4
- data.tar.gz: eb95e381493677be867ba166c3be99c8b31283984ce03566939735ed931977a6
3
+ metadata.gz: fe6eaffc724ad4ae6e70c62b3a64d3e4f6206c0219fa37474b6f5f54367044c8
4
+ data.tar.gz: 6ec2cf889ad535b3713b377fa57f459ea5ed39f9c9b1b870e3bd7f6abf2f88b8
5
5
  SHA512:
6
- metadata.gz: cc7d451e1817922233741e882a419f3e247a59c53741eeb4631eb9e558926d515665616aa9d7a88934bc6a0a4406778181abca06d67dba911d681dd85ab20ceb
7
- data.tar.gz: 84b93ca97870805a0415d790348c4fe8c5be3db0afbac11749ec3c68b88b4699ee056e3f7df949ee8cb36504ab8ee93e6c25e836f8a3a54541826e3e7bbb9d83
6
+ metadata.gz: d06b70ae67d7a145f350d4f2b109837554c772d0a78b3ec5785136701bba6e052490a203a5359934029d784ff480892d493c204448fc294423d8d1a80ee9393e
7
+ data.tar.gz: bb6b6bf03c155f95f8bc769c70420e5b53a0a8073e47ca5bfae5d957d19a8705aac728247e07cc92f5e3d3f4a0c45e499c6b3cc39dc9a1b4fdf9282c7b924514
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -178,19 +178,19 @@ inflections:
178
178
  - "Xmlrpc": "XMLRPC"
179
179
  - "Yaml": "YAML"
180
180
  git_hub:
181
- api_url: "https://api.github.com"
181
+ api_uri: "https://api.github.com"
182
182
  http:
183
183
  statuses:
184
- url: "https://developer.mozilla.org/docs/Web/HTTP/Status"
184
+ uri: "https://developer.mozilla.org/docs/Web/HTTP/Status"
185
185
  htmx:
186
186
  examples_uri: "%<htmx_site_uri>s/examples"
187
187
  extensions_uri: "%<htmx_site_uri>s/extensions"
188
188
  references_uri: "%<htmx_site_uri>s/reference"
189
189
  site_uri: "https://htmx.org"
190
190
  ruby_gems:
191
- api_url: "https://rubygems.org/api/v1"
191
+ api_uri: "https://rubygems.org/api/v1"
192
192
  standard_gems:
193
- api_url: "https://stdgems.org"
193
+ api_uri: "https://stdgems.org"
194
194
  ----
195
195
 
196
196
  Feel free to take this default configuration, modify, and save as your own custom
@@ -387,7 +387,7 @@ Provides quick access to link:https://crystal-lang.org[Crystal] resources.
387
387
 
388
388
  ===== CSS
389
389
 
390
- image:https://alchemists.io/images/projects/pennyworth/screenshots/css.png[CSS workflow screenshot.,width=706,height=470,role=focal_point]
390
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/css.png[CSS workflow screenshot.,width=706,height=631,role=focal_point]
391
391
 
392
392
  Provides quick access to link:https://www.w3.org/Style/CSS/specs.en.html[CSS] resources.
393
393
 
@@ -7,22 +7,13 @@ module Pennyworth
7
7
  module Actions
8
8
  # Handles the encoding action.
9
9
  class Encoding < Sod::Action
10
- include Import[:io]
10
+ include Dependencies[:io, processor: "processors.encoding"]
11
11
 
12
12
  description "Render Alfred encodings script filter."
13
13
 
14
14
  on "--encodings"
15
15
 
16
- def initialize(processor: Processor.for_encodings, **)
17
- super(**)
18
- @processor = processor
19
- end
20
-
21
16
  def call(*) = io.puts processor.call.to_json
22
-
23
- private
24
-
25
- attr_reader :processor
26
17
  end
27
18
  end
28
19
  end
@@ -7,7 +7,7 @@ module Pennyworth
7
7
  module Actions
8
8
  # Handles the RubyGem action.
9
9
  class Gem < Sod::Action
10
- include Import[:io]
10
+ include Dependencies[:io, processor: "processors.gem"]
11
11
 
12
12
  description "Render Alfred RubyGems script filter."
13
13
 
@@ -15,16 +15,7 @@ module Pennyworth
15
15
 
16
16
  default { Container[:settings].ruby_gems_owner }
17
17
 
18
- def initialize(processor: Processor.for_gems, **)
19
- super(**)
20
- @processor = processor
21
- end
22
-
23
18
  def call(handle = default) = io.puts processor.call("owners/#{handle}/gems.json").to_json
24
-
25
- private
26
-
27
- attr_reader :processor
28
19
  end
29
20
  end
30
21
  end
@@ -8,7 +8,7 @@ module Pennyworth
8
8
  module GitHub
9
9
  # Handles the GitHub user action.
10
10
  class Organization < Sod::Action
11
- include Import[:io]
11
+ include Dependencies[:io, processor: "processors.project"]
12
12
 
13
13
  description "Specify organization."
14
14
 
@@ -16,16 +16,7 @@ module Pennyworth
16
16
 
17
17
  default { Container[:settings].git_hub_organization }
18
18
 
19
- def initialize(processor: Processor.for_projects, **)
20
- super(**)
21
- @processor = processor
22
- end
23
-
24
19
  def call(handle = default) = io.puts processor.call("orgs/#{handle}").to_json
25
-
26
- private
27
-
28
- attr_reader :processor
29
20
  end
30
21
  end
31
22
  end
@@ -8,7 +8,7 @@ module Pennyworth
8
8
  module GitHub
9
9
  # Handles the GitHub user action.
10
10
  class User < Sod::Action
11
- include Import[:io]
11
+ include Dependencies[:io, processor: "processors.project"]
12
12
 
13
13
  description "Specify user."
14
14
 
@@ -16,16 +16,7 @@ module Pennyworth
16
16
 
17
17
  default { Container[:settings].git_hub_user }
18
18
 
19
- def initialize(processor: Processor.for_projects, **)
20
- super(**)
21
- @processor = processor
22
- end
23
-
24
19
  def call(handle = default) = io.puts processor.call("users/#{handle}").to_json
25
-
26
- private
27
-
28
- attr_reader :processor
29
20
  end
30
21
  end
31
22
  end
@@ -8,22 +8,13 @@ module Pennyworth
8
8
  module HTMX
9
9
  # Handles examples documentation action.
10
10
  class Example < Sod::Action
11
- include Import[:settings, :io]
11
+ include Dependencies[:settings, :io, processor: "processors.htmx"]
12
12
 
13
13
  description "Render Alfred examples script filter."
14
14
 
15
15
  on "--examples"
16
16
 
17
- def initialize(processor: Processor.for_htmx, **)
18
- @processor = processor
19
- super(**)
20
- end
21
-
22
17
  def call(*) = io.puts processor.call(settings.htmx_examples_uri).to_json
23
-
24
- private
25
-
26
- attr_reader :processor
27
18
  end
28
19
  end
29
20
  end
@@ -8,22 +8,13 @@ module Pennyworth
8
8
  module HTMX
9
9
  # Handles extension documentation action.
10
10
  class Extension < Sod::Action
11
- include Import[:settings, :io]
11
+ include Dependencies[:settings, :io, processor: "processors.htmx"]
12
12
 
13
13
  description "Render Alfred extensions script filter."
14
14
 
15
15
  on "--extensions"
16
16
 
17
- def initialize(processor: Processor.for_htmx, **)
18
- @processor = processor
19
- super(**)
20
- end
21
-
22
17
  def call(*) = io.puts processor.call(settings.htmx_extensions_uri).to_json
23
-
24
- private
25
-
26
- attr_reader :processor
27
18
  end
28
19
  end
29
20
  end
@@ -8,22 +8,13 @@ module Pennyworth
8
8
  module HTMX
9
9
  # Handles references documentation action.
10
10
  class Reference < Sod::Action
11
- include Import[:settings, :io]
11
+ include Dependencies[:settings, :io, processor: "processors.htmx"]
12
12
 
13
13
  description "Render Alfred references script filter."
14
14
 
15
15
  on "--references"
16
16
 
17
- def initialize(processor: Processor.for_htmx, **)
18
- @processor = processor
19
- super(**)
20
- end
21
-
22
17
  def call(*) = io.puts processor.call(settings.htmx_references_uri).to_json
23
-
24
- private
25
-
26
- attr_reader :processor
27
18
  end
28
19
  end
29
20
  end
@@ -7,22 +7,13 @@ module Pennyworth
7
7
  module Actions
8
8
  # Handles the HTTP status action.
9
9
  class HTTPStatus < Sod::Action
10
- include Import[:io]
10
+ include Dependencies[:io, processor: "processors.http_status"]
11
11
 
12
12
  description "Render Alfred HTTP statuses script filter."
13
13
 
14
14
  on "--http_statuses"
15
15
 
16
- def initialize(processor: Processor.for_http_statuses, **)
17
- super(**)
18
- @processor = processor
19
- end
20
-
21
16
  def call(*) = io.puts processor.call.to_json
22
-
23
- private
24
-
25
- attr_reader :processor
26
17
  end
27
18
  end
28
19
  end
@@ -7,22 +7,13 @@ module Pennyworth
7
7
  module Actions
8
8
  # Handles the system error action.
9
9
  class StandardError < Sod::Action
10
- include Import[:io]
10
+ include Dependencies[:io, processor: "processors.standard_error"]
11
11
 
12
12
  description "Render Alfred standard errors script filter."
13
13
 
14
14
  on "--standard_errors"
15
15
 
16
- def initialize(processor: Processor.for_standard_errors, **)
17
- super(**)
18
- @processor = processor
19
- end
20
-
21
16
  def call(*) = io.puts processor.call.to_json
22
-
23
- private
24
-
25
- attr_reader :processor
26
17
  end
27
18
  end
28
19
  end
@@ -7,7 +7,7 @@ module Pennyworth
7
7
  module Actions
8
8
  # Handles the Standard Gem action.
9
9
  class StandardGem < Sod::Action
10
- include Import[:io]
10
+ include Dependencies[:io, processor: "processors.standard_gem"]
11
11
 
12
12
  ENDPOINTS = {
13
13
  "all" => "stdgems.json",
@@ -19,9 +19,8 @@ module Pennyworth
19
19
 
20
20
  on "--standard_gems", argument: "[KIND]", allow: %w[all default bundled], default: "all"
21
21
 
22
- def initialize(processor: Processor.for_standard_gems, endpoints: ENDPOINTS, **)
22
+ def initialize(endpoints: ENDPOINTS, **)
23
23
  super(**)
24
- @processor = processor
25
24
  @endpoints = endpoints
26
25
  end
27
26
 
@@ -29,7 +28,7 @@ module Pennyworth
29
28
 
30
29
  private
31
30
 
32
- attr_reader :processor, :endpoints
31
+ attr_reader :endpoints
33
32
  end
34
33
  end
35
34
  end
@@ -8,22 +8,13 @@ module Pennyworth
8
8
  module System
9
9
  # Handles the system error action.
10
10
  class Error < Sod::Action
11
- include Import[:io]
11
+ include Dependencies[:io, processor: "processors.system_error"]
12
12
 
13
13
  description "Render Alfred system errors script filter."
14
14
 
15
15
  on "--system_errors"
16
16
 
17
- def initialize(processor: Processor.for_system_errors, **)
18
- super(**)
19
- @processor = processor
20
- end
21
-
22
17
  def call(*) = io.puts processor.call.to_json
23
-
24
- private
25
-
26
- attr_reader :processor
27
18
  end
28
19
  end
29
20
  end
@@ -8,22 +8,13 @@ module Pennyworth
8
8
  module System
9
9
  # Handles the system signal action.
10
10
  class Signal < Sod::Action
11
- include Import[:io]
11
+ include Dependencies[:io, processor: "processors.system_signal"]
12
12
 
13
13
  description "Render Alfred system signals script filter."
14
14
 
15
15
  on "--system_signals"
16
16
 
17
- def initialize(processor: Processor.for_system_signals, **)
18
- super(**)
19
- @processor = processor
20
- end
21
-
22
17
  def call(*) = io.puts processor.call.to_json
23
-
24
- private
25
-
26
- attr_reader :processor
27
18
  end
28
19
  end
29
20
  end
@@ -7,22 +7,13 @@ module Pennyworth
7
7
  module Actions
8
8
  # Handles the text action.
9
9
  class Text < Sod::Action
10
- include Import[:io]
10
+ include Dependencies[:io, processor: "processors.text"]
11
11
 
12
12
  description "Render Alfred text script filter."
13
13
 
14
14
  on "--text", argument: "CONTENT"
15
15
 
16
- def initialize(processor: Processor.for_text, **)
17
- super(**)
18
- @processor = processor
19
- end
20
-
21
16
  def call(content) = io.puts processor.call(content).to_json
22
-
23
- private
24
-
25
- attr_reader :processor
26
17
  end
27
18
  end
28
19
  end
@@ -6,7 +6,7 @@ module Pennyworth
6
6
  module CLI
7
7
  # The main Command Line Interface (CLI) object.
8
8
  class Shell
9
- include Import[:defaults_path, :xdg_config, :specification]
9
+ include Dependencies[:defaults_path, :xdg_config, :specification]
10
10
 
11
11
  def initialize(context: Sod::Context, dsl: Sod, **)
12
12
  super(**)
@@ -9,17 +9,17 @@ module Pennyworth
9
9
  Contract = Dry::Schema.Params do
10
10
  optional(:alfred_preferences).filled :string
11
11
  required(:inflections).array :hash
12
- required(:git_hub_api_url).filled :string
12
+ required(:git_hub_api_uri).filled :string
13
13
  optional(:git_hub_organization).filled :string
14
14
  optional(:git_hub_user).filled :string
15
- required(:http_statuses_url).filled :string
15
+ required(:http_statuses_uri).filled :string
16
16
  required(:htmx_examples_uri).filled :string
17
17
  required(:htmx_extensions_uri).filled :string
18
18
  required(:htmx_references_uri).filled :string
19
19
  required(:htmx_site_uri).filled :string
20
- required(:ruby_gems_api_url).filled :string
20
+ required(:ruby_gems_api_uri).filled :string
21
21
  optional(:ruby_gems_owner).filled :string
22
- required(:standard_gems_api_url).filled :string
22
+ required(:standard_gems_api_uri).filled :string
23
23
  end
24
24
  end
25
25
  end
@@ -72,16 +72,16 @@ inflections:
72
72
  - "Xmlrpc": "XMLRPC"
73
73
  - "Yaml": "YAML"
74
74
  git_hub:
75
- api_url: "https://api.github.com"
75
+ api_uri: "https://api.github.com"
76
76
  http:
77
77
  statuses:
78
- url: "https://developer.mozilla.org/docs/Web/HTTP/Status"
78
+ uri: "https://developer.mozilla.org/docs/Web/HTTP/Status"
79
79
  htmx:
80
80
  examples_uri: "%<htmx_site_uri>s/examples"
81
81
  extensions_uri: "%<htmx_site_uri>s/extensions"
82
82
  references_uri: "%<htmx_site_uri>s/reference"
83
83
  site_uri: "https://htmx.org"
84
84
  ruby_gems:
85
- api_url: "https://rubygems.org/api/v1"
85
+ api_uri: "https://rubygems.org/api/v1"
86
86
  standard_gems:
87
- api_url: "https://stdgems.org"
87
+ api_uri: "https://stdgems.org"
@@ -5,16 +5,16 @@ module Pennyworth
5
5
  # Defines configuration content as the primary source of truth for use throughout the gem.
6
6
  Model = Struct.new :alfred_preferences,
7
7
  :inflections,
8
- :git_hub_api_url,
8
+ :git_hub_api_uri,
9
9
  :git_hub_organization,
10
10
  :git_hub_user,
11
- :http_statuses_url,
11
+ :http_statuses_uri,
12
12
  :htmx_examples_uri,
13
13
  :htmx_extensions_uri,
14
14
  :htmx_references_uri,
15
15
  :htmx_site_uri,
16
- :ruby_gems_api_url,
16
+ :ruby_gems_api_uri,
17
17
  :ruby_gems_owner,
18
- :standard_gems_api_url
18
+ :standard_gems_api_uri
19
19
  end
20
20
  end
@@ -21,6 +21,68 @@ module Pennyworth
21
21
  .add_transformer(:format, :htmx_references_uri)
22
22
  end
23
23
 
24
+ namespace :processors do
25
+ register :encoding do
26
+ Processor.new loader: Loaders::Encoding.new,
27
+ presenter: Presenters::Encoding,
28
+ serializer: Serializers::Encoding
29
+ end
30
+
31
+ register :gem do
32
+ Processor.new loader: Loaders::Gem.new,
33
+ presenter: Presenters::Gem,
34
+ serializer: Serializers::Project
35
+ end
36
+
37
+ register :htmx do
38
+ Processor.new loader: Loaders::HTMX.new,
39
+ presenter: Presenters::HTMX,
40
+ serializer: Serializers::HTMX
41
+ end
42
+
43
+ register :http_status do
44
+ Processor.new loader: Loaders::HTTPStatus.new,
45
+ presenter: Presenters::HTTPStatus,
46
+ serializer: Serializers::HTTPStatus
47
+ end
48
+
49
+ register :project do
50
+ Processor.new loader: Loaders::GitHub.new,
51
+ presenter: Presenters::Repository,
52
+ serializer: Serializers::Project
53
+ end
54
+
55
+ register :standard_gem do
56
+ Processor.new loader: Loaders::StandardGem.new,
57
+ presenter: Presenters::StandardGem,
58
+ serializer: Serializers::Project
59
+ end
60
+
61
+ register :standard_error do
62
+ Processor.new loader: Loaders::StandardError.new,
63
+ presenter: Presenters::StandardError,
64
+ serializer: Serializers::StandardError
65
+ end
66
+
67
+ register :system_error do
68
+ Processor.new loader: Loaders::System::Error.new,
69
+ presenter: Presenters::System::Error,
70
+ serializer: Serializers::System::Error
71
+ end
72
+
73
+ register :system_signal do
74
+ Processor.new loader: Loaders::System::Signal.new,
75
+ presenter: Presenters::System::Signal,
76
+ serializer: Serializers::System::Signal
77
+ end
78
+
79
+ register :text do
80
+ Processor.new loader: Loaders::Text.new,
81
+ presenter: Presenters::Text,
82
+ serializer: Serializers::Text
83
+ end
84
+ end
85
+
24
86
  register(:settings) { Etcher.call(self[:registry]).dup }
25
87
  register(:specification) { Spek::Loader.call "#{__dir__}/../../pennyworth.gemspec" }
26
88
  register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
@@ -3,5 +3,5 @@
3
3
  require "infusible"
4
4
 
5
5
  module Pennyworth
6
- Import = Infusible[Container]
6
+ Dependencies = Infusible[Container]
7
7
  end
@@ -6,10 +6,10 @@ module Pennyworth
6
6
  module Loaders
7
7
  # Loads an array gems from the RubyGems API.
8
8
  class Gem
9
- include Import[:settings, :http]
9
+ include Dependencies[:settings, :http]
10
10
 
11
11
  def call endpoint
12
- http.get("#{settings.ruby_gems_api_url}/#{endpoint}")
12
+ http.get("#{settings.ruby_gems_api_uri}/#{endpoint}")
13
13
  .then do |response|
14
14
  return JSON response.body.to_s, symbolize_names: true if response.status.success?
15
15
 
@@ -8,7 +8,7 @@ module Pennyworth
8
8
  module Loaders
9
9
  # Loads htmx documentation by scraping web page.
10
10
  class HTMX
11
- include Import[:http, :settings]
11
+ include Dependencies[:http, :settings]
12
12
 
13
13
  using Refinements::String
14
14
 
@@ -18,7 +18,13 @@ module Pennyworth
18
18
 
19
19
  def self.text_for element
20
20
  parts = element.each.with_object [] do |item, content|
21
- content.append item.is_a?(Ox::Element) ? "`#{item.text}`" : item
21
+ text = if item.is_a? Ox::Element
22
+ "`#{item.text}`"
23
+ else
24
+ item.encode ::Encoding::UTF_8, replace: Core::EMPTY_STRING
25
+ end
26
+
27
+ content.append text
22
28
  end
23
29
 
24
30
  parts.join.up.delete_suffix "."
@@ -6,7 +6,7 @@ module Pennyworth
6
6
  module Loaders
7
7
  # Loads an array of HTTP status records.
8
8
  class HTTPStatus
9
- include Import[:settings]
9
+ include Dependencies[:settings]
10
10
 
11
11
  def initialize(codes: Rack::Utils::HTTP_STATUS_CODES, model: Models::HTTPStatus, **)
12
12
  super(**)
@@ -22,7 +22,7 @@ module Pennyworth
22
22
 
23
23
  attr_reader :codes, :model
24
24
 
25
- def url = settings.http_statuses_url
25
+ def url = settings.http_statuses_uri
26
26
  end
27
27
  end
28
28
  end
@@ -6,10 +6,10 @@ module Pennyworth
6
6
  module Loaders
7
7
  # Loads an array gems from the Standard Gems API.
8
8
  class StandardGem
9
- include Import[:settings, :http]
9
+ include Dependencies[:settings, :http]
10
10
 
11
11
  def call endpoint
12
- http.get("#{settings.standard_gems_api_url}/#{endpoint}")
12
+ http.get("#{settings.standard_gems_api_uri}/#{endpoint}")
13
13
  .then do |response|
14
14
  response.status.success? ? records(response.body.to_s) : Core::EMPTY_HASH
15
15
  end
@@ -26,13 +26,13 @@ module Pennyworth
26
26
 
27
27
  def downloads = record.fetch(__method__)
28
28
 
29
- def site_url = record.fetch(:homepage_uri)
29
+ def site_uri = record.fetch(:homepage_uri)
30
30
 
31
- def source_url = record.fetch(:source_code_uri)
31
+ def source_uri = record.fetch(:source_code_uri)
32
32
 
33
- def issues_url = record.fetch(:bug_tracker_uri)
33
+ def issues_uri = record.fetch(:bug_tracker_uri)
34
34
 
35
- def versions_url = record.fetch(:changelog_uri)
35
+ def versions_uri = record.fetch(:changelog_uri)
36
36
 
37
37
  def updated_at = record.fetch(:version_created_at)
38
38
 
@@ -19,13 +19,13 @@ module Pennyworth
19
19
 
20
20
  def subtitle = record.fetch(:description)
21
21
 
22
- def site_url = record.fetch(:homepage)
22
+ def site_uri = record.fetch(:homepage)
23
23
 
24
- def source_url = record.fetch(:html_url)
24
+ def source_uri = record.fetch(:html_url)
25
25
 
26
- def issues_url = "#{source_url}/issues"
26
+ def issues_uri = "#{source_uri}/issues"
27
27
 
28
- def versions_url = "#{site_url}/versions"
28
+ def versions_uri = "#{site_uri}/versions"
29
29
 
30
30
  private
31
31
 
@@ -28,13 +28,13 @@ module Pennyworth
28
28
  (bundled || defaults || versions).values.first
29
29
  end
30
30
 
31
- def site_url = record.fetch(:sourceRepository, Core::EMPTY_STRING)
31
+ def site_uri = record.fetch(:sourceRepository, Core::EMPTY_STRING)
32
32
 
33
- def source_url = record.fetch(:sourceRepository, Core::EMPTY_STRING)
33
+ def source_uri = record.fetch(:sourceRepository, Core::EMPTY_STRING)
34
34
 
35
- def issues_url = "https://github.com/ruby/#{id}/issues"
35
+ def issues_uri = "https://github.com/ruby/#{id}/issues"
36
36
 
37
- def versions_url = "https://github.com/ruby/#{id}/tags"
37
+ def versions_uri = "https://github.com/ruby/#{id}/tags"
38
38
 
39
39
  private
40
40
 
@@ -3,62 +3,9 @@
3
3
  module Pennyworth
4
4
  # Processes all steps required to render an Alfred Script Filter response.
5
5
  class Processor
6
- def self.for_encodings
7
- new loader: Loaders::Encoding.new,
8
- presenter: Presenters::Encoding,
9
- serializer: Serializers::Encoding
10
- end
11
-
12
- def self.for_gems
13
- new loader: Loaders::Gem.new, presenter: Presenters::Gem, serializer: Serializers::Project
14
- end
15
-
16
- def self.for_http_statuses
17
- new loader: Loaders::HTTPStatus.new,
18
- presenter: Presenters::HTTPStatus,
19
- serializer: Serializers::HTTPStatus
20
- end
21
-
22
- def self.for_htmx
23
- new loader: Loaders::HTMX.new, presenter: Presenters::HTMX, serializer: Serializers::HTMX
24
- end
25
-
26
- def self.for_projects
27
- new loader: Loaders::GitHub.new,
28
- presenter: Presenters::Repository,
29
- serializer: Serializers::Project
30
- end
31
-
32
- def self.for_standard_gems
33
- new loader: Loaders::StandardGem.new,
34
- presenter: Presenters::StandardGem,
35
- serializer: Serializers::Project
36
- end
37
-
38
- def self.for_standard_errors
39
- new loader: Loaders::StandardError.new,
40
- presenter: Presenters::StandardError,
41
- serializer: Serializers::StandardError
42
- end
43
-
44
- def self.for_system_errors
45
- new loader: Loaders::System::Error.new,
46
- presenter: Presenters::System::Error,
47
- serializer: Serializers::System::Error
48
- end
49
-
50
- def self.for_system_signals
51
- new loader: Loaders::System::Signal.new,
52
- presenter: Presenters::System::Signal,
53
- serializer: Serializers::System::Signal
54
- end
55
-
56
- def self.for_text
57
- new loader: Loaders::Text.new, presenter: Presenters::Text, serializer: Serializers::Text
58
- end
59
-
60
6
  def initialize steps
61
7
  @steps = steps
8
+ freeze
62
9
  end
63
10
 
64
11
  def call content = nil
@@ -13,8 +13,8 @@ module Pennyworth
13
13
  uid: presenter.id,
14
14
  title: presenter.label,
15
15
  subtitle: presenter.description,
16
- arg: site_url,
17
- quicklookurl: site_url,
16
+ arg: site_uri,
17
+ quicklookurl: site_uri,
18
18
  mods: modifications,
19
19
  text:
20
20
  }
@@ -40,12 +40,12 @@ module Pennyworth
40
40
 
41
41
  def text
42
42
  {
43
- copy: site_url,
44
- largetype: site_url
43
+ copy: site_uri,
44
+ largetype: site_uri
45
45
  }
46
46
  end
47
47
 
48
- def site_url = presenter.uri
48
+ def site_uri = presenter.uri
49
49
  end
50
50
  end
51
51
  end
@@ -13,8 +13,8 @@ module Pennyworth
13
13
  uid: presenter.id,
14
14
  title: presenter.label,
15
15
  subtitle: presenter.subtitle,
16
- arg: site_url,
17
- quicklookurl: site_url,
16
+ arg: site_uri,
17
+ quicklookurl: site_uri,
18
18
  mods: modifications,
19
19
  text:
20
20
  }
@@ -26,9 +26,9 @@ module Pennyworth
26
26
 
27
27
  def modifications
28
28
  {
29
- alt: modification(presenter.source_url, "View source."),
30
- cmd: modification(presenter.issues_url, "View issues."),
31
- control: modification(presenter.versions_url, "View versions.")
29
+ alt: modification(presenter.source_uri, "View source."),
30
+ cmd: modification(presenter.issues_uri, "View issues."),
31
+ control: modification(presenter.versions_uri, "View versions.")
32
32
  }
33
33
  end
34
34
 
@@ -41,12 +41,12 @@ module Pennyworth
41
41
 
42
42
  def text
43
43
  {
44
- copy: site_url,
45
- largetype: site_url
44
+ copy: site_uri,
45
+ largetype: site_uri
46
46
  }
47
47
  end
48
48
 
49
- def site_url = presenter.site_url
49
+ def site_uri = presenter.site_uri
50
50
  end
51
51
  end
52
52
  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 = "17.8.0"
5
+ spec.version = "18.0.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/pennyworth"
@@ -22,20 +22,20 @@ Gem::Specification.new do |spec|
22
22
  spec.signing_key = Gem.default_key_path
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
- spec.required_ruby_version = ">= 3.3", "<= 3.4"
26
- spec.add_dependency "cogger", "~> 0.31"
27
- spec.add_dependency "containable", "~> 0.2"
28
- spec.add_dependency "core", "~> 1.10"
29
- spec.add_dependency "etcher", "~> 2.7"
30
- spec.add_dependency "ghub", "~> 0.21"
31
- spec.add_dependency "http", "~> 5.1"
32
- spec.add_dependency "infusible", "~> 3.12"
25
+ spec.required_ruby_version = "~> 3.4"
26
+ spec.add_dependency "cogger", "~> 1.0"
27
+ spec.add_dependency "containable", "~> 1.0"
28
+ spec.add_dependency "core", "~> 2.0"
29
+ spec.add_dependency "etcher", "~> 3.0"
30
+ spec.add_dependency "ghub", "~> 0.22"
31
+ spec.add_dependency "http", "~> 5.2"
32
+ spec.add_dependency "infusible", "~> 4.0"
33
33
  spec.add_dependency "ox", "~> 2.14"
34
- spec.add_dependency "rack", "~> 3.0"
35
- spec.add_dependency "refinements", "~> 12.10"
36
- spec.add_dependency "runcom", "~> 11.10"
37
- spec.add_dependency "sod", "~> 0.20"
38
- spec.add_dependency "spek", "~> 3.0"
34
+ spec.add_dependency "rack", "~> 3.1"
35
+ spec.add_dependency "refinements", "~> 13.0"
36
+ spec.add_dependency "runcom", "~> 12.0"
37
+ spec.add_dependency "sod", "~> 1.0"
38
+ spec.add_dependency "spek", "~> 4.0"
39
39
  spec.add_dependency "zeitwerk", "~> 2.7"
40
40
 
41
41
  spec.bindir = "exe"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,11 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pennyworth
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.8.0
4
+ version: 18.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain:
11
10
  - |
@@ -35,7 +34,7 @@ cert_chain:
35
34
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
35
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
36
  -----END CERTIFICATE-----
38
- date: 2024-11-09 00:00:00.000000000 Z
37
+ date: 2024-12-28 00:00:00.000000000 Z
39
38
  dependencies:
40
39
  - !ruby/object:Gem::Dependency
41
40
  name: cogger
@@ -43,98 +42,98 @@ dependencies:
43
42
  requirements:
44
43
  - - "~>"
45
44
  - !ruby/object:Gem::Version
46
- version: '0.31'
45
+ version: '1.0'
47
46
  type: :runtime
48
47
  prerelease: false
49
48
  version_requirements: !ruby/object:Gem::Requirement
50
49
  requirements:
51
50
  - - "~>"
52
51
  - !ruby/object:Gem::Version
53
- version: '0.31'
52
+ version: '1.0'
54
53
  - !ruby/object:Gem::Dependency
55
54
  name: containable
56
55
  requirement: !ruby/object:Gem::Requirement
57
56
  requirements:
58
57
  - - "~>"
59
58
  - !ruby/object:Gem::Version
60
- version: '0.2'
59
+ version: '1.0'
61
60
  type: :runtime
62
61
  prerelease: false
63
62
  version_requirements: !ruby/object:Gem::Requirement
64
63
  requirements:
65
64
  - - "~>"
66
65
  - !ruby/object:Gem::Version
67
- version: '0.2'
66
+ version: '1.0'
68
67
  - !ruby/object:Gem::Dependency
69
68
  name: core
70
69
  requirement: !ruby/object:Gem::Requirement
71
70
  requirements:
72
71
  - - "~>"
73
72
  - !ruby/object:Gem::Version
74
- version: '1.10'
73
+ version: '2.0'
75
74
  type: :runtime
76
75
  prerelease: false
77
76
  version_requirements: !ruby/object:Gem::Requirement
78
77
  requirements:
79
78
  - - "~>"
80
79
  - !ruby/object:Gem::Version
81
- version: '1.10'
80
+ version: '2.0'
82
81
  - !ruby/object:Gem::Dependency
83
82
  name: etcher
84
83
  requirement: !ruby/object:Gem::Requirement
85
84
  requirements:
86
85
  - - "~>"
87
86
  - !ruby/object:Gem::Version
88
- version: '2.7'
87
+ version: '3.0'
89
88
  type: :runtime
90
89
  prerelease: false
91
90
  version_requirements: !ruby/object:Gem::Requirement
92
91
  requirements:
93
92
  - - "~>"
94
93
  - !ruby/object:Gem::Version
95
- version: '2.7'
94
+ version: '3.0'
96
95
  - !ruby/object:Gem::Dependency
97
96
  name: ghub
98
97
  requirement: !ruby/object:Gem::Requirement
99
98
  requirements:
100
99
  - - "~>"
101
100
  - !ruby/object:Gem::Version
102
- version: '0.21'
101
+ version: '0.22'
103
102
  type: :runtime
104
103
  prerelease: false
105
104
  version_requirements: !ruby/object:Gem::Requirement
106
105
  requirements:
107
106
  - - "~>"
108
107
  - !ruby/object:Gem::Version
109
- version: '0.21'
108
+ version: '0.22'
110
109
  - !ruby/object:Gem::Dependency
111
110
  name: http
112
111
  requirement: !ruby/object:Gem::Requirement
113
112
  requirements:
114
113
  - - "~>"
115
114
  - !ruby/object:Gem::Version
116
- version: '5.1'
115
+ version: '5.2'
117
116
  type: :runtime
118
117
  prerelease: false
119
118
  version_requirements: !ruby/object:Gem::Requirement
120
119
  requirements:
121
120
  - - "~>"
122
121
  - !ruby/object:Gem::Version
123
- version: '5.1'
122
+ version: '5.2'
124
123
  - !ruby/object:Gem::Dependency
125
124
  name: infusible
126
125
  requirement: !ruby/object:Gem::Requirement
127
126
  requirements:
128
127
  - - "~>"
129
128
  - !ruby/object:Gem::Version
130
- version: '3.12'
129
+ version: '4.0'
131
130
  type: :runtime
132
131
  prerelease: false
133
132
  version_requirements: !ruby/object:Gem::Requirement
134
133
  requirements:
135
134
  - - "~>"
136
135
  - !ruby/object:Gem::Version
137
- version: '3.12'
136
+ version: '4.0'
138
137
  - !ruby/object:Gem::Dependency
139
138
  name: ox
140
139
  requirement: !ruby/object:Gem::Requirement
@@ -155,70 +154,70 @@ dependencies:
155
154
  requirements:
156
155
  - - "~>"
157
156
  - !ruby/object:Gem::Version
158
- version: '3.0'
157
+ version: '3.1'
159
158
  type: :runtime
160
159
  prerelease: false
161
160
  version_requirements: !ruby/object:Gem::Requirement
162
161
  requirements:
163
162
  - - "~>"
164
163
  - !ruby/object:Gem::Version
165
- version: '3.0'
164
+ version: '3.1'
166
165
  - !ruby/object:Gem::Dependency
167
166
  name: refinements
168
167
  requirement: !ruby/object:Gem::Requirement
169
168
  requirements:
170
169
  - - "~>"
171
170
  - !ruby/object:Gem::Version
172
- version: '12.10'
171
+ version: '13.0'
173
172
  type: :runtime
174
173
  prerelease: false
175
174
  version_requirements: !ruby/object:Gem::Requirement
176
175
  requirements:
177
176
  - - "~>"
178
177
  - !ruby/object:Gem::Version
179
- version: '12.10'
178
+ version: '13.0'
180
179
  - !ruby/object:Gem::Dependency
181
180
  name: runcom
182
181
  requirement: !ruby/object:Gem::Requirement
183
182
  requirements:
184
183
  - - "~>"
185
184
  - !ruby/object:Gem::Version
186
- version: '11.10'
185
+ version: '12.0'
187
186
  type: :runtime
188
187
  prerelease: false
189
188
  version_requirements: !ruby/object:Gem::Requirement
190
189
  requirements:
191
190
  - - "~>"
192
191
  - !ruby/object:Gem::Version
193
- version: '11.10'
192
+ version: '12.0'
194
193
  - !ruby/object:Gem::Dependency
195
194
  name: sod
196
195
  requirement: !ruby/object:Gem::Requirement
197
196
  requirements:
198
197
  - - "~>"
199
198
  - !ruby/object:Gem::Version
200
- version: '0.20'
199
+ version: '1.0'
201
200
  type: :runtime
202
201
  prerelease: false
203
202
  version_requirements: !ruby/object:Gem::Requirement
204
203
  requirements:
205
204
  - - "~>"
206
205
  - !ruby/object:Gem::Version
207
- version: '0.20'
206
+ version: '1.0'
208
207
  - !ruby/object:Gem::Dependency
209
208
  name: spek
210
209
  requirement: !ruby/object:Gem::Requirement
211
210
  requirements:
212
211
  - - "~>"
213
212
  - !ruby/object:Gem::Version
214
- version: '3.0'
213
+ version: '4.0'
215
214
  type: :runtime
216
215
  prerelease: false
217
216
  version_requirements: !ruby/object:Gem::Requirement
218
217
  requirements:
219
218
  - - "~>"
220
219
  - !ruby/object:Gem::Version
221
- version: '3.0'
220
+ version: '4.0'
222
221
  - !ruby/object:Gem::Dependency
223
222
  name: zeitwerk
224
223
  requirement: !ruby/object:Gem::Requirement
@@ -233,7 +232,6 @@ dependencies:
233
232
  - - "~>"
234
233
  - !ruby/object:Gem::Version
235
234
  version: '2.7'
236
- description:
237
235
  email:
238
236
  - brooke@alchemists.io
239
237
  executables:
@@ -265,7 +263,7 @@ files:
265
263
  - lib/pennyworth/configuration/defaults.yml
266
264
  - lib/pennyworth/configuration/model.rb
267
265
  - lib/pennyworth/container.rb
268
- - lib/pennyworth/import.rb
266
+ - lib/pennyworth/dependencies.rb
269
267
  - lib/pennyworth/inflector.rb
270
268
  - lib/pennyworth/loaders/encoding.rb
271
269
  - lib/pennyworth/loaders/gem.rb
@@ -315,16 +313,12 @@ metadata:
315
313
  label: Pennyworth
316
314
  rubygems_mfa_required: 'true'
317
315
  source_code_uri: https://github.com/bkuhlmann/pennyworth
318
- post_install_message:
319
316
  rdoc_options: []
320
317
  require_paths:
321
318
  - lib
322
319
  required_ruby_version: !ruby/object:Gem::Requirement
323
320
  requirements:
324
- - - ">="
325
- - !ruby/object:Gem::Version
326
- version: '3.3'
327
- - - "<="
321
+ - - "~>"
328
322
  - !ruby/object:Gem::Version
329
323
  version: '3.4'
330
324
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -333,8 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
333
327
  - !ruby/object:Gem::Version
334
328
  version: '0'
335
329
  requirements: []
336
- rubygems_version: 3.5.23
337
- signing_key:
330
+ rubygems_version: 3.6.2
338
331
  specification_version: 4
339
332
  summary: A command line interface for augmented Alfred workflows.
340
333
  test_files: []
metadata.gz.sig CHANGED
Binary file