pennyworth 15.4.1 → 16.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/pennyworth/cli/actions/{encodings.rb → encoding.rb} +2 -2
  4. data/lib/pennyworth/cli/actions/{ruby_gems.rb → gem.rb} +3 -3
  5. data/lib/pennyworth/cli/actions/{http_statuses.rb → http_status.rb} +2 -2
  6. data/lib/pennyworth/cli/actions/{standard_errors.rb → standard_error.rb} +2 -2
  7. data/lib/pennyworth/cli/actions/{standard_gems.rb → standard_gem.rb} +2 -2
  8. data/lib/pennyworth/cli/actions/system/{errors.rb → error.rb} +2 -2
  9. data/lib/pennyworth/cli/actions/system/{signals.rb → signal.rb} +2 -2
  10. data/lib/pennyworth/cli/shell.rb +7 -7
  11. data/lib/pennyworth/loaders/{encodings.rb → encoding.rb} +5 -5
  12. data/lib/pennyworth/loaders/gem.rb +21 -0
  13. data/lib/pennyworth/loaders/git_hub.rb +21 -0
  14. data/lib/pennyworth/loaders/{http_statuses.rb → http_status.rb} +2 -2
  15. data/lib/pennyworth/loaders/{standard_errors.rb → standard_error.rb} +3 -3
  16. data/lib/pennyworth/loaders/standard_gem.rb +23 -0
  17. data/lib/pennyworth/loaders/system/{errors.rb → error.rb} +2 -2
  18. data/lib/pennyworth/loaders/system/{signals.rb → signal.rb} +3 -3
  19. data/lib/pennyworth/loaders/text.rb +2 -2
  20. data/lib/pennyworth/presenters/gem.rb +3 -3
  21. data/lib/pennyworth/presenters/http_status.rb +2 -2
  22. data/lib/pennyworth/presenters/repository.rb +2 -2
  23. data/lib/pennyworth/presenters/standard_error.rb +2 -2
  24. data/lib/pennyworth/presenters/standard_gem.rb +3 -3
  25. data/lib/pennyworth/processor.rb +8 -10
  26. data/lib/pennyworth/serializers/encoding.rb +1 -1
  27. data/pennyworth.gemspec +11 -11
  28. data.tar.gz.sig +0 -0
  29. metadata +37 -41
  30. metadata.gz.sig +0 -0
  31. data/lib/pennyworth/integrations/git_hub/client.rb +0 -23
  32. data/lib/pennyworth/integrations/ruby_gems/client.rb +0 -23
  33. data/lib/pennyworth/integrations/standard_gems/client.rb +0 -25
  34. data/lib/pennyworth/loaders/projects.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4414e7865009a9475019aecfc7a0da3b6a718b3d534fb5a03680a8d2ce2502e
4
- data.tar.gz: 02dee1560c343a0f37337010550cdfd699d21531773b53a13a268104d8834b6c
3
+ metadata.gz: 5b07665d574b9b2422e8eb05b3e4cae0828b4b2532431d3ccdedefb1e1868a8c
4
+ data.tar.gz: 1d76043e109f048343179e686bace92c8c91b1809a6131e2b6faa13af089bd20
5
5
  SHA512:
6
- metadata.gz: e2232ddf9786346bb58bb8e5cbcf787a739551cd3f096464c0a6f1f7f396b5e92689e272780e7fbf44ce0226a8f891aa32e7a090675204adb176cf8e15084e66
7
- data.tar.gz: f9f9cd06a3f2ed9aebd314ead60c80a886bd81d042f5e5b6cb2c3c753418d35c00913a2d6e599ebdbe7e317d1171b6cefe3983683f88ddbe1da33690d8beb5ba
6
+ metadata.gz: 59c0aacdf527c16e5f97e36c24dcddb8dbd73325e8a31bdacf7ffc1eab3de49ce672693408a9e31b301c4057ab32a7e3f816b91f4e69273a9bc229da9317b0ba
7
+ data.tar.gz: 16f766fdbfaa2c19017575905db4c11cc5bfe55ec2d23536ce76ddab13576343615d92ce999a858e258ee0200b0ddf4709d2b28f4233dd3fb6f63c7cd8bb96c6
checksums.yaml.gz.sig CHANGED
Binary file
@@ -5,8 +5,8 @@ require "sod"
5
5
  module Pennyworth
6
6
  module CLI
7
7
  module Actions
8
- # Handles the encodings action.
9
- class Encodings < Sod::Action
8
+ # Handles the encoding action.
9
+ class Encoding < Sod::Action
10
10
  include Import[:kernel]
11
11
 
12
12
  description "Render Alfred encodings script filter."
@@ -5,13 +5,13 @@ require "sod"
5
5
  module Pennyworth
6
6
  module CLI
7
7
  module Actions
8
- # Handles the RubyGems action.
9
- class RubyGems < Sod::Action
8
+ # Handles the RubyGem action.
9
+ class Gem < Sod::Action
10
10
  include Import[:kernel]
11
11
 
12
12
  description "Render Alfred RubyGems script filter."
13
13
 
14
- on "--ruby_gems", argument: "[HANDLE]"
14
+ on "--gems", argument: "[HANDLE]"
15
15
 
16
16
  default { Container[:configuration].ruby_gems_owner }
17
17
 
@@ -5,8 +5,8 @@ require "sod"
5
5
  module Pennyworth
6
6
  module CLI
7
7
  module Actions
8
- # Handles the HTTP statuses action.
9
- class HTTPStatuses < Sod::Action
8
+ # Handles the HTTP status action.
9
+ class HTTPStatus < Sod::Action
10
10
  include Import[:kernel]
11
11
 
12
12
  description "Render Alfred HTTP statuses script filter."
@@ -5,8 +5,8 @@ require "sod"
5
5
  module Pennyworth
6
6
  module CLI
7
7
  module Actions
8
- # Handles the system errors action.
9
- class StandardErrors < Sod::Action
8
+ # Handles the system error action.
9
+ class StandardError < Sod::Action
10
10
  include Import[:kernel]
11
11
 
12
12
  description "Render Alfred standard errors script filter."
@@ -5,8 +5,8 @@ require "sod"
5
5
  module Pennyworth
6
6
  module CLI
7
7
  module Actions
8
- # Handles the Standard Gems action.
9
- class StandardGems < Sod::Action
8
+ # Handles the Standard Gem action.
9
+ class StandardGem < Sod::Action
10
10
  include Import[:kernel]
11
11
 
12
12
  ENDPOINTS = {
@@ -6,8 +6,8 @@ module Pennyworth
6
6
  module CLI
7
7
  module Actions
8
8
  module System
9
- # Handles the system errors action.
10
- class Errors < Sod::Action
9
+ # Handles the system error action.
10
+ class Error < Sod::Action
11
11
  include Import[:kernel]
12
12
 
13
13
  description "Render Alfred system errors script filter."
@@ -6,8 +6,8 @@ module Pennyworth
6
6
  module CLI
7
7
  module Actions
8
8
  module System
9
- # Handles the signal action.
10
- class Signals < Sod::Action
9
+ # Handles the system signal action.
10
+ class Signal < Sod::Action
11
11
  include Import[:kernel]
12
12
 
13
13
  description "Render Alfred system signals script filter."
@@ -31,13 +31,13 @@ module Pennyworth
31
31
  on Actions::GitHub::User
32
32
  end
33
33
 
34
- on Actions::Encodings
35
- on Actions::HTTPStatuses
36
- on Actions::RubyGems
37
- on Actions::StandardGems
38
- on Actions::StandardErrors
39
- on Actions::System::Errors
40
- on Actions::System::Signals
34
+ on Actions::Encoding
35
+ on Actions::HTTPStatus
36
+ on Actions::Gem
37
+ on Actions::StandardGem
38
+ on Actions::StandardError
39
+ on Actions::System::Error
40
+ on Actions::System::Signal
41
41
  on Actions::Text
42
42
  on(Sod::Prefabs::Actions::Version, context:)
43
43
  on Sod::Prefabs::Actions::Help, self
@@ -1,19 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/arrays"
3
+ require "refinements/array"
4
4
 
5
5
  module Pennyworth
6
6
  module Loaders
7
7
  # Loads an array of encoding records.
8
- class Encodings
9
- using Refinements::Arrays
8
+ class Encoding
9
+ using Refinements::Array
10
10
 
11
- def initialize encoding: Encoding, model: Models::Encoding
11
+ def initialize encoding: ::Encoding, model: Models::Encoding
12
12
  @encoding = encoding
13
13
  @model = model
14
14
  end
15
15
 
16
- def call _omit = nil
16
+ def call(*)
17
17
  encoding.aliases
18
18
  .map { |_second, first| first }
19
19
  .uniq
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "core"
4
+
5
+ module Pennyworth
6
+ module Loaders
7
+ # Loads an array gems from the RubyGems API.
8
+ class Gem
9
+ include Import[:configuration, :http]
10
+
11
+ def call endpoint
12
+ http.get("#{configuration.ruby_gems_api_url}/#{endpoint}")
13
+ .then do |response|
14
+ return JSON response.body.to_s, symbolize_names: true if response.status.success?
15
+
16
+ Core::EMPTY_HASH
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "core"
4
+ require "ghub"
5
+
6
+ module Pennyworth
7
+ module Loaders
8
+ # Loads an array projects from the GitHub API.
9
+ class GitHub
10
+ def initialize endpoint: Ghub::Endpoints::Repositories::Root.new
11
+ @endpoint = endpoint
12
+ end
13
+
14
+ def call(path) = endpoint.index(*path.split("/")).value_or(Core::EMPTY_ARRAY).map(&:to_h)
15
+
16
+ private
17
+
18
+ attr_reader :endpoint
19
+ end
20
+ end
21
+ end
@@ -5,7 +5,7 @@ require "rack"
5
5
  module Pennyworth
6
6
  module Loaders
7
7
  # Loads an array of HTTP status records.
8
- class HTTPStatuses
8
+ class HTTPStatus
9
9
  include Import[:configuration]
10
10
 
11
11
  def initialize(codes: Rack::Utils::HTTP_STATUS_CODES, model: Models::HTTPStatus, **)
@@ -14,7 +14,7 @@ module Pennyworth
14
14
  @model = model
15
15
  end
16
16
 
17
- def call _omit = nil
17
+ def call(*)
18
18
  codes.map { |(code, label)| model[code:, label:, url: "#{url}/#{code}"] }
19
19
  end
20
20
 
@@ -3,13 +3,13 @@
3
3
  module Pennyworth
4
4
  module Loaders
5
5
  # Loads an array of standard error records.
6
- class StandardErrors
7
- def initialize root: StandardError, model: Models::StandardError
6
+ class StandardError
7
+ def initialize root: ::StandardError, model: Models::StandardError
8
8
  @root = root
9
9
  @model = model
10
10
  end
11
11
 
12
- def call _omit = nil
12
+ def call(*)
13
13
  ObjectSpace.each_object(Class)
14
14
  .select { |klass| klass < root }
15
15
  .sort_by(&:name)
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "core"
4
+
5
+ module Pennyworth
6
+ module Loaders
7
+ # Loads an array gems from the Standard Gems API.
8
+ class StandardGem
9
+ include Import[:configuration, :http]
10
+
11
+ def call endpoint
12
+ http.get("#{configuration.standard_gems_api_url}/#{endpoint}")
13
+ .then do |response|
14
+ response.status.success? ? records(response.body.to_s) : Core::EMPTY_HASH
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def records(body) = JSON(body, symbolize_names: true).fetch :gems, Core::EMPTY_ARRAY
21
+ end
22
+ end
23
+ end
@@ -4,13 +4,13 @@ module Pennyworth
4
4
  module Loaders
5
5
  module System
6
6
  # Loads an array of system error records.
7
- class Errors
7
+ class Error
8
8
  def initialize errno: Errno, model: Models::System::Error
9
9
  @errno = errno
10
10
  @model = model
11
11
  end
12
12
 
13
- def call _omit = nil
13
+ def call(*)
14
14
  errno.constants
15
15
  .map { |name| errno.const_get name }
16
16
  .uniq
@@ -4,13 +4,13 @@ module Pennyworth
4
4
  module Loaders
5
5
  module System
6
6
  # Loads an array of signal records.
7
- class Signals
8
- def initialize list: Signal.list, model: Models::System::Signal
7
+ class Signal
8
+ def initialize list: ::Signal.list, model: Models::System::Signal
9
9
  @list = list
10
10
  @model = model
11
11
  end
12
12
 
13
- def call(_omit = nil) = list.map { |name, number| model[number:, name:] }
13
+ def call(*) = list.map { |name, number| model[number:, name:] }
14
14
 
15
15
  private
16
16
 
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/strings"
3
+ require "refinements/string"
4
4
 
5
5
  module Pennyworth
6
6
  module Loaders
7
7
  # Loads an array of text records.
8
8
  class Text
9
- using Refinements::Strings
9
+ using Refinements::String
10
10
 
11
11
  TRANSFORMS = %w[camelcase capitalize downcase size snakecase titleize upcase].freeze
12
12
 
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/strings"
3
+ require "refinements/string"
4
4
 
5
5
  module Pennyworth
6
6
  module Presenters
7
7
  # Renders RubyGems records into a compatible format for use in Alfred script filters.
8
8
  class Gem
9
- using Refinements::Arrays
10
- using Refinements::Strings
9
+ using Refinements::Array
10
+ using Refinements::String
11
11
 
12
12
  def initialize record, inflector: Inflector.new
13
13
  @record = record
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "forwardable"
4
- require "refinements/strings"
4
+ require "refinements/string"
5
5
 
6
6
  module Pennyworth
7
7
  module Presenters
@@ -9,7 +9,7 @@ module Pennyworth
9
9
  class HTTPStatus
10
10
  extend Forwardable
11
11
 
12
- using Refinements::Strings
12
+ using Refinements::String
13
13
 
14
14
  delegate %i[code label url] => :record
15
15
 
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/strings"
3
+ require "refinements/string"
4
4
 
5
5
  module Pennyworth
6
6
  module Presenters
7
7
  # Renders a GitHub repository record into a compatible format for use in Alfred script filters.
8
8
  class Repository
9
- using Refinements::Strings
9
+ using Refinements::String
10
10
 
11
11
  def initialize record, inflector: Inflector.new
12
12
  @record = record
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/arrays"
3
+ require "refinements/array"
4
4
 
5
5
  module Pennyworth
6
6
  module Presenters
7
7
  # Renders a standard error into a compatible format for use in Alfred script filters.
8
8
  class StandardError
9
- using Refinements::Arrays
9
+ using Refinements::Array
10
10
 
11
11
  def initialize record
12
12
  @record = record
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "core"
4
- require "refinements/strings"
4
+ require "refinements/string"
5
5
 
6
6
  module Pennyworth
7
7
  module Presenters
8
8
  # Renders Standard Gem records into a compatible format for use in Alfred script filters.
9
9
  class StandardGem
10
- using Refinements::Arrays
11
- using Refinements::Strings
10
+ using Refinements::Array
11
+ using Refinements::String
12
12
 
13
13
  def initialize record, inflector: Inflector.new
14
14
  @record = record
@@ -4,49 +4,47 @@ module Pennyworth
4
4
  # Processes all steps required to render an Alfred Script Filter response.
5
5
  class Processor
6
6
  def self.for_encodings
7
- new loader: Loaders::Encodings.new,
7
+ new loader: Loaders::Encoding.new,
8
8
  presenter: Presenters::Encoding,
9
9
  serializer: Serializers::Encoding
10
10
  end
11
11
 
12
12
  def self.for_gems
13
- new loader: Loaders::Projects.for_ruby_gems,
14
- presenter: Presenters::Gem,
15
- serializer: Serializers::Project
13
+ new loader: Loaders::Gem.new, presenter: Presenters::Gem, serializer: Serializers::Project
16
14
  end
17
15
 
18
16
  def self.for_http_statuses
19
- new loader: Loaders::HTTPStatuses.new,
17
+ new loader: Loaders::HTTPStatus.new,
20
18
  presenter: Presenters::HTTPStatus,
21
19
  serializer: Serializers::HTTPStatus
22
20
  end
23
21
 
24
22
  def self.for_projects
25
- new loader: Loaders::Projects.for_git_hub,
23
+ new loader: Loaders::GitHub.new,
26
24
  presenter: Presenters::Repository,
27
25
  serializer: Serializers::Project
28
26
  end
29
27
 
30
28
  def self.for_standard_gems
31
- new loader: Loaders::Projects.for_standard_gems,
29
+ new loader: Loaders::StandardGem.new,
32
30
  presenter: Presenters::StandardGem,
33
31
  serializer: Serializers::Project
34
32
  end
35
33
 
36
34
  def self.for_standard_errors
37
- new loader: Loaders::StandardErrors.new,
35
+ new loader: Loaders::StandardError.new,
38
36
  presenter: Presenters::StandardError,
39
37
  serializer: Serializers::StandardError
40
38
  end
41
39
 
42
40
  def self.for_system_errors
43
- new loader: Loaders::System::Errors.new,
41
+ new loader: Loaders::System::Error.new,
44
42
  presenter: Presenters::System::Error,
45
43
  serializer: Serializers::System::Error
46
44
  end
47
45
 
48
46
  def self.for_system_signals
49
- new loader: Loaders::System::Signals.new,
47
+ new loader: Loaders::System::Signal.new,
50
48
  presenter: Presenters::System::Signal,
51
49
  serializer: Serializers::System::Signal
52
50
  end
@@ -4,7 +4,7 @@ module Pennyworth
4
4
  module Serializers
5
5
  # Serializes a encoding into a compatible format for parsing within Alfred script filters.
6
6
  class Encoding
7
- using Refinements::Arrays
7
+ using Refinements::Array
8
8
 
9
9
  def initialize presenter
10
10
  @presenter = presenter
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 = "15.4.1"
5
+ spec.version = "16.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,19 +22,19 @@ 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.2", "<= 3.3"]
26
- spec.add_dependency "cogger", "~> 0.12"
27
- spec.add_dependency "core", "~> 0.1.4"
25
+ spec.required_ruby_version = "~> 3.3"
26
+ spec.add_dependency "cogger", "~> 0.15"
27
+ spec.add_dependency "core", "~> 1.0"
28
28
  spec.add_dependency "dry-container", "~> 0.11"
29
- spec.add_dependency "etcher", "~> 0.2"
30
- spec.add_dependency "ghub", "~> 0.5"
29
+ spec.add_dependency "etcher", "~> 1.0"
30
+ spec.add_dependency "ghub", "~> 0.9"
31
31
  spec.add_dependency "http", "~> 5.1"
32
- spec.add_dependency "infusible", "~> 2.2"
32
+ spec.add_dependency "infusible", "~> 3.0"
33
33
  spec.add_dependency "rack", "~> 3.0"
34
- spec.add_dependency "refinements", "~> 11.0"
35
- spec.add_dependency "runcom", "~> 10.0"
36
- spec.add_dependency "sod", "~> 0.0"
37
- spec.add_dependency "spek", "~> 2.0"
34
+ spec.add_dependency "refinements", "~> 12.0"
35
+ spec.add_dependency "runcom", "~> 11.0"
36
+ spec.add_dependency "sod", "~> 0.4"
37
+ spec.add_dependency "spek", "~> 3.0"
38
38
  spec.add_dependency "zeitwerk", "~> 2.6"
39
39
 
40
40
  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: 15.4.1
4
+ version: 16.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2023-11-16 00:00:00.000000000 Z
38
+ date: 2024-01-01 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -43,28 +43,28 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.12'
46
+ version: '0.15'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.12'
53
+ version: '0.15'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: core
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 0.1.4
60
+ version: '1.0'
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 0.1.4
67
+ version: '1.0'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: dry-container
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -85,28 +85,28 @@ dependencies:
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.2'
88
+ version: '1.0'
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0.2'
95
+ version: '1.0'
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: ghub
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '0.5'
102
+ version: '0.9'
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '0.5'
109
+ version: '0.9'
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: http
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -127,14 +127,14 @@ dependencies:
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '2.2'
130
+ version: '3.0'
131
131
  type: :runtime
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '2.2'
137
+ version: '3.0'
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: rack
140
140
  requirement: !ruby/object:Gem::Requirement
@@ -155,56 +155,56 @@ dependencies:
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '11.0'
158
+ version: '12.0'
159
159
  type: :runtime
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: '11.0'
165
+ version: '12.0'
166
166
  - !ruby/object:Gem::Dependency
167
167
  name: runcom
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '10.0'
172
+ version: '11.0'
173
173
  type: :runtime
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '10.0'
179
+ version: '11.0'
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: sod
182
182
  requirement: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: '0.0'
186
+ version: '0.4'
187
187
  type: :runtime
188
188
  prerelease: false
189
189
  version_requirements: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: '0.0'
193
+ version: '0.4'
194
194
  - !ruby/object:Gem::Dependency
195
195
  name: spek
196
196
  requirement: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: '2.0'
200
+ version: '3.0'
201
201
  type: :runtime
202
202
  prerelease: false
203
203
  version_requirements: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: '2.0'
207
+ version: '3.0'
208
208
  - !ruby/object:Gem::Dependency
209
209
  name: zeitwerk
210
210
  requirement: !ruby/object:Gem::Requirement
@@ -233,15 +233,15 @@ files:
233
233
  - README.adoc
234
234
  - exe/pennyworth
235
235
  - lib/pennyworth.rb
236
- - lib/pennyworth/cli/actions/encodings.rb
236
+ - lib/pennyworth/cli/actions/encoding.rb
237
+ - lib/pennyworth/cli/actions/gem.rb
237
238
  - lib/pennyworth/cli/actions/git_hub/organization.rb
238
239
  - lib/pennyworth/cli/actions/git_hub/user.rb
239
- - lib/pennyworth/cli/actions/http_statuses.rb
240
- - lib/pennyworth/cli/actions/ruby_gems.rb
241
- - lib/pennyworth/cli/actions/standard_errors.rb
242
- - lib/pennyworth/cli/actions/standard_gems.rb
243
- - lib/pennyworth/cli/actions/system/errors.rb
244
- - lib/pennyworth/cli/actions/system/signals.rb
240
+ - lib/pennyworth/cli/actions/http_status.rb
241
+ - lib/pennyworth/cli/actions/standard_error.rb
242
+ - lib/pennyworth/cli/actions/standard_gem.rb
243
+ - lib/pennyworth/cli/actions/system/error.rb
244
+ - lib/pennyworth/cli/actions/system/signal.rb
245
245
  - lib/pennyworth/cli/actions/text.rb
246
246
  - lib/pennyworth/cli/shell.rb
247
247
  - lib/pennyworth/configuration/contract.rb
@@ -250,15 +250,14 @@ files:
250
250
  - lib/pennyworth/container.rb
251
251
  - lib/pennyworth/import.rb
252
252
  - lib/pennyworth/inflector.rb
253
- - lib/pennyworth/integrations/git_hub/client.rb
254
- - lib/pennyworth/integrations/ruby_gems/client.rb
255
- - lib/pennyworth/integrations/standard_gems/client.rb
256
- - lib/pennyworth/loaders/encodings.rb
257
- - lib/pennyworth/loaders/http_statuses.rb
258
- - lib/pennyworth/loaders/projects.rb
259
- - lib/pennyworth/loaders/standard_errors.rb
260
- - lib/pennyworth/loaders/system/errors.rb
261
- - lib/pennyworth/loaders/system/signals.rb
253
+ - lib/pennyworth/loaders/encoding.rb
254
+ - lib/pennyworth/loaders/gem.rb
255
+ - lib/pennyworth/loaders/git_hub.rb
256
+ - lib/pennyworth/loaders/http_status.rb
257
+ - lib/pennyworth/loaders/standard_error.rb
258
+ - lib/pennyworth/loaders/standard_gem.rb
259
+ - lib/pennyworth/loaders/system/error.rb
260
+ - lib/pennyworth/loaders/system/signal.rb
262
261
  - lib/pennyworth/loaders/text.rb
263
262
  - lib/pennyworth/models/encoding.rb
264
263
  - lib/pennyworth/models/http_status.rb
@@ -301,10 +300,7 @@ require_paths:
301
300
  - lib
302
301
  required_ruby_version: !ruby/object:Gem::Requirement
303
302
  requirements:
304
- - - ">="
305
- - !ruby/object:Gem::Version
306
- version: '3.2'
307
- - - "<="
303
+ - - "~>"
308
304
  - !ruby/object:Gem::Version
309
305
  version: '3.3'
310
306
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -313,7 +309,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
313
309
  - !ruby/object:Gem::Version
314
310
  version: '0'
315
311
  requirements: []
316
- rubygems_version: 3.4.22
312
+ rubygems_version: 3.5.3
317
313
  signing_key:
318
314
  specification_version: 4
319
315
  summary: A command line interface for augmenting Alfred workflows.
metadata.gz.sig CHANGED
Binary file
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "core"
4
- require "ghub"
5
-
6
- module Pennyworth
7
- module Integrations
8
- module GitHub
9
- # Provides low-level access to the GitHub API.
10
- class Client
11
- def initialize endpoint: Ghub::Endpoints::Repositories::Root.new
12
- @endpoint = endpoint
13
- end
14
-
15
- def get(path) = endpoint.index(*path.split("/")).value_or(Core::EMPTY_ARRAY).map(&:to_h)
16
-
17
- private
18
-
19
- attr_reader :endpoint
20
- end
21
- end
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "core"
4
-
5
- module Pennyworth
6
- module Integrations
7
- module RubyGems
8
- # Provides low-level API access to the RubyGems API.
9
- class Client
10
- include Import[:configuration, :http]
11
-
12
- def get endpoint
13
- http.get("#{configuration.ruby_gems_api_url}/#{endpoint}")
14
- .then do |response|
15
- return JSON response.body.to_s, symbolize_names: true if response.status.success?
16
-
17
- Core::EMPTY_HASH
18
- end
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "core"
4
-
5
- module Pennyworth
6
- module Integrations
7
- module StandardGems
8
- # Provides low-level API access to the Standard Gems API.
9
- class Client
10
- include Import[:configuration, :http]
11
-
12
- def get endpoint
13
- http.get("#{configuration.standard_gems_api_url}/#{endpoint}")
14
- .then do |response|
15
- response.status.success? ? records(response.body.to_s) : Core::EMPTY_HASH
16
- end
17
- end
18
-
19
- private
20
-
21
- def records(body) = JSON(body, symbolize_names: true).fetch :gems, Core::EMPTY_ARRAY
22
- end
23
- end
24
- end
25
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pennyworth
4
- module Loaders
5
- # Loads projects from API requests for further processing.
6
- class Projects
7
- def self.for_git_hub = new(client: Integrations::GitHub::Client.new)
8
-
9
- def self.for_ruby_gems = new(client: Integrations::RubyGems::Client.new)
10
-
11
- def self.for_standard_gems = new(client: Integrations::StandardGems::Client.new)
12
-
13
- def initialize client:
14
- @client = client
15
- end
16
-
17
- def call(endpoint) = client.get(endpoint)
18
-
19
- private
20
-
21
- attr_reader :client
22
- end
23
- end
24
- end