pennyworth 18.6.0 → 18.7.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: ec7ddf5d7728c9d85bca38b2aff1943bb370443cf8c0d02125fb951c560c3502
4
- data.tar.gz: 28cb57d701802f48feaa7b8babd84eaf16a873a89e1d1ef1cda2ca6495e1f68b
3
+ metadata.gz: 563b72c39493cf485d4e92dbc25bd742d61cd1b4b5728859f87feb76811f5bfa
4
+ data.tar.gz: 2f78cf2024b5be52b117302495bb58d1de10f77855c2e73aa7f6d2b1405b6da2
5
5
  SHA512:
6
- metadata.gz: 729ec25d03a660d2f748bf449b74993e969442a8906b7fa1f9182be7df7f733d2319c5ab838d98cdfe6745cbda6729275a1d16d7c8ff97639473ff470453bc82
7
- data.tar.gz: 6611333f405da112ae3cd853149499753c3b6bccb91eb1b0c8d17f8506dc2a4f4bae990e6da1663cc396307dc038d74178bde9ce31337d45a11371d85eff409f
6
+ metadata.gz: 5f5cdd66990ecb3b24ebcabebd0bd4786880f41bff9a0c7dd01262dfa9ae92208b09a9c5b4330cfcbba84366841ea054ccd7192356a0382b875b85513e60ae06
7
+ data.tar.gz: bd901e0ce0dfc6a069ae2fe81cde9d15d159d17718847d125e5a50b58bb872e01553dd31d00ec26c3c6b0561935b0d00d9391e4541607a18d53aab49fa42b344
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -186,6 +186,9 @@ htmx:
186
186
  extensions_uri: "%<htmx_site_uri>s/extensions"
187
187
  references_uri: "%<htmx_site_uri>s/reference"
188
188
  site_uri: "https://htmx.org"
189
+ rodauth:
190
+ site_uri: "https://rodauth.jeremyevans.net"
191
+ documentation_uri: "%<rodauth_site_uri>s/documentation.html"
189
192
  ruby_gems:
190
193
  api_uri: "https://rubygems.org/api/v1"
191
194
  standard_gems:
@@ -269,6 +272,16 @@ Provides quick access to the {htmx_link} JavaScript library.
269
272
  double click to install.
270
273
  2. Click on _Configure Workflow_ to view documentation.
271
274
 
275
+ ===== Rodauth
276
+
277
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/rodauth.webp[Rodauth workflow screenshot.,width=706,height=631,role=focal_point]
278
+
279
+ Provides quick access to the link:https://rodauth.jeremyevans.net[Rodauth] web framework.
280
+
281
+ 1. link:https://alchemists.io/public/alfred/workflows/rodauth.alfredworkflow[Download] and double
282
+ click to install.
283
+ 2. Click on _Configure Workflow_ to view documentation.
284
+
272
285
  ===== RuboCop
273
286
 
274
287
  image:https://alchemists.io/images/projects/pennyworth/screenshots/rubocop-projects.png[Rubocop Projects,width=706,height=632,role=focal_point]
@@ -414,16 +427,6 @@ Provides quick access to link:https://elm-lang.org[Elm] resources.
414
427
  click to install.
415
428
  2. Click on _Configure Workflow_ to view documentation.
416
429
 
417
- ===== Farnam Street
418
-
419
- image:https://alchemists.io/images/projects/pennyworth/screenshots/farnam_street.png[Farnam Street workflow screenshot.,width=706,height=631,role=focal_point]
420
-
421
- Provides quick access to link:https://fs.blog[Farnam Street] resources.
422
-
423
- 1. link:https://alchemists.io/public/alfred/workflows/farnam_street.alfredworkflow[Download] and
424
- double click to install.
425
- 2. Click on _Configure Workflow_ to view documentation.
426
-
427
430
  ===== Git
428
431
 
429
432
  image:https://alchemists.io/images/projects/pennyworth/screenshots/git.png[Git workflow screenshot.,width=706,height=523,role=focal_point]
@@ -496,7 +499,7 @@ Provides quick access to macOS resources.
496
499
 
497
500
  ===== PostgreSQL
498
501
 
499
- image:https://alchemists.io/images/projects/pennyworth/screenshots/postgresql.png[PostgreSQL workflow screenshot.,width=706,height=361,role=focal_point]
502
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/postgresql.webp[PostgreSQL workflow screenshot.,width=706,height=577,role=focal_point]
500
503
 
501
504
  Provides quick access to link:https://www.postgresql.org[PostgreSQL] resources.
502
505
 
@@ -516,7 +519,7 @@ Provides quick access to link:https://github.com/rack/rack[Rack] resources.
516
519
 
517
520
  ===== Roda
518
521
 
519
- image:https://alchemists.io/images/projects/pennyworth/screenshots/roda.png[Roda workflow screenshot.,width=706,height=469,role=focal_point]
522
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/roda.webp[Roda workflow screenshot.,width=706,height=415,role=focal_point]
520
523
 
521
524
  Provides quick access to the link:http://roda.jeremyevans.net[Roda] web framework.
522
525
 
@@ -544,15 +547,6 @@ Provides quick access to link:https://rspec.info[RSpec] resources.
544
547
  click to install.
545
548
  2. Click on _Configure Workflow_ to view documentation.
546
549
 
547
- ===== Ruby on Rails
548
-
549
- image:https://alchemists.io/images/projects/pennyworth/screenshots/ruby_on_rails.png[Ruby on Rails workflow screenshot.,width=706,height=524,role=focal_point]
550
-
551
- Provides access to the link:https://https://rubyonrails.org[Ruby on Rails] web framework.
552
-
553
- 1. link:https://alchemists.io/public/alfred/workflows/ruby_on_rails.alfredworkflow[Download] and double click to install.
554
- 2. Click on _Configure Workflow_ to view documentation.
555
-
556
550
  ===== Search
557
551
 
558
552
  image:https://alchemists.io/images/projects/pennyworth/screenshots/search.png[Search workflow screenshot.,width=706,height=631,role=focal_point]
@@ -582,16 +576,6 @@ Provides quick access to SSL resources for the security conscious.
582
576
  1. link:https://alchemists.io/public/alfred/workflows/ssl.alfredworkflow[Download] and double click to install.
583
577
  2. Click on _Configure Workflow_ to view documentation.
584
578
 
585
- ===== Tana
586
-
587
- image:https://alchemists.io/images/projects/pennyworth/screenshots/tana.png[Tana workflow screenshot.,width=706,height=631,role=focal_point]
588
-
589
- Provides quick access to link:https://tana.inc[Tana] resources.
590
-
591
- 1. link:https://alchemists.io/public/alfred/workflows/tana.alfredworkflow[Download] and
592
- double click to install.
593
- 2. Click on _Configure Workflow_ to view documentation.
594
-
595
579
  ===== Terraform
596
580
 
597
581
  image:https://alchemists.io/images/projects/pennyworth/screenshots/terraform.png[Terraform workflow screenshot.,width=706,height=632,role=focal_point]
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sod"
4
+
5
+ module Pennyworth
6
+ module CLI
7
+ module Actions
8
+ # Handles Rodauth feature action.
9
+ class Rodauth < Sod::Action
10
+ include Dependencies[:settings, :io, processor: "processors.rodauth"]
11
+
12
+ description "Render Alfred Rodauth script filter."
13
+
14
+ on "--rodauth"
15
+
16
+ def call(*) = io.puts processor.call(settings.rodauth_documentation_uri).to_json
17
+ end
18
+ end
19
+ end
20
+ end
@@ -40,6 +40,7 @@ module Pennyworth
40
40
  on Actions::Encoding
41
41
  on Actions::HTTPStatus
42
42
  on Actions::Gem
43
+ on Actions::Rodauth
43
44
  on Actions::StandardGem
44
45
  on Actions::StandardError
45
46
  on Actions::System::Error
@@ -17,6 +17,8 @@ module Pennyworth
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(:rodauth_site_uri).filled :string
21
+ required(:rodauth_documentation_uri).filled :string
20
22
  required(:ruby_gems_api_uri).filled :string
21
23
  optional(:ruby_gems_owner).filled :string
22
24
  required(:standard_gems_api_uri).filled :string
@@ -80,6 +80,9 @@ htmx:
80
80
  extensions_uri: "%<htmx_site_uri>s/extensions"
81
81
  references_uri: "%<htmx_site_uri>s/reference"
82
82
  site_uri: "https://htmx.org"
83
+ rodauth:
84
+ site_uri: "https://rodauth.jeremyevans.net"
85
+ documentation_uri: "%<rodauth_site_uri>s/documentation.html"
83
86
  ruby_gems:
84
87
  api_uri: "https://rubygems.org/api/v1"
85
88
  standard_gems:
@@ -13,6 +13,8 @@ module Pennyworth
13
13
  :htmx_extensions_uri,
14
14
  :htmx_references_uri,
15
15
  :htmx_site_uri,
16
+ :rodauth_site_uri,
17
+ :rodauth_documentation_uri,
16
18
  :ruby_gems_api_uri,
17
19
  :ruby_gems_owner,
18
20
  :standard_gems_api_uri
@@ -4,6 +4,7 @@ require "cogger"
4
4
  require "containable"
5
5
  require "etcher"
6
6
  require "http"
7
+ require "ox"
7
8
  require "runcom"
8
9
  require "spek"
9
10
 
@@ -19,6 +20,7 @@ module Pennyworth
19
20
  .add_transformer(:format, :htmx_examples_uri)
20
21
  .add_transformer(:format, :htmx_extensions_uri)
21
22
  .add_transformer(:format, :htmx_references_uri)
23
+ .add_transformer(:format, :rodauth_documentation_uri)
22
24
  end
23
25
 
24
26
  namespace :processors do
@@ -52,6 +54,12 @@ module Pennyworth
52
54
  serializer: Serializers::Project
53
55
  end
54
56
 
57
+ register :rodauth do
58
+ Processor.new loader: Loaders::Rodauth.new,
59
+ presenter: Presenters::Rodauth,
60
+ serializer: Serializers::Rodauth
61
+ end
62
+
55
63
  register :standard_gem do
56
64
  Processor.new loader: Loaders::StandardGem.new,
57
65
  presenter: Presenters::StandardGem,
@@ -83,6 +91,10 @@ module Pennyworth
83
91
  end
84
92
  end
85
93
 
94
+ register :ox do
95
+ Ox.tap { |ox| ox.default_options = {mode: :generic, effort: :tolerant, smart: true} }
96
+ end
97
+
86
98
  register(:settings) { Etcher.call(self[:registry]).dup }
87
99
  register(:specification) { Spek::Loader.call "#{__dir__}/../../pennyworth.gemspec" }
88
100
  register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
@@ -1,21 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "core"
4
- require "ox"
5
4
  require "refinements/string"
6
5
 
7
6
  module Pennyworth
8
7
  module Loaders
9
8
  # Loads htmx documentation by scraping web page.
10
9
  class HTMX
11
- include Dependencies[:http, :settings]
10
+ include Dependencies[:http, :settings, parser: :ox]
12
11
 
13
12
  using Refinements::String
14
13
 
15
- PARSER = Ox.tap do |ox|
16
- ox.default_options = {mode: :generic, effort: :tolerant, smart: true}
17
- end
18
-
19
14
  def self.text_for element
20
15
  parts = element.each.with_object [] do |item, content|
21
16
  text = if item.is_a? Ox::Element
@@ -30,8 +25,7 @@ module Pennyworth
30
25
  parts.join.up.delete_suffix "."
31
26
  end
32
27
 
33
- def initialize(parser: PARSER, model: Models::HTMX, **)
34
- @parser = parser
28
+ def initialize(model: Models::HTMX, **)
35
29
  @model = model
36
30
  super(**)
37
31
  end
@@ -46,7 +40,7 @@ module Pennyworth
46
40
 
47
41
  private
48
42
 
49
- attr_reader :parser, :model
43
+ attr_reader :model
50
44
 
51
45
  def read uri
52
46
  http.follow.get(uri).then do |response|
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "core"
4
+ require "refinements/pathname"
5
+ require "refinements/string"
6
+
7
+ module Pennyworth
8
+ module Loaders
9
+ # Loads Rodauth documentation by scraping the web page.
10
+ class Rodauth
11
+ include Dependencies[:http, :settings, parser: :ox]
12
+
13
+ using Refinements::String
14
+ using Refinements::Pathname
15
+
16
+ def initialize(model: Models::Rodauth, **)
17
+ @model = model
18
+ super(**)
19
+ end
20
+
21
+ def call uri
22
+ read(uri).each.with_object([]) { |item, entries| entries.append record_for(item) }
23
+ end
24
+
25
+ private
26
+
27
+ attr_reader :model
28
+
29
+ def read uri
30
+ http.get(uri).then do |response|
31
+ [200, 301].include?(response.status) ? parse_items(response.body.to_s) : Core::EMPTY_ARRAY
32
+ end
33
+ end
34
+
35
+ def parse_items document
36
+ parser.parse(document).root.body.div.ul.nodes
37
+ rescue NoMethodError
38
+ Core::EMPTY_ARRAY
39
+ end
40
+
41
+ def record_for item
42
+ link = item.a
43
+ uri = "#{settings.rodauth_site_uri}/#{link.href}"
44
+
45
+ model[
46
+ name: Pathname(uri).name.to_s.delete_suffix("_rdoc"),
47
+ label: link.text,
48
+ description: item.text.delete_prefix(": "),
49
+ uri:
50
+ ]
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pennyworth
4
+ module Models
5
+ # Represents a Rodauth list item.
6
+ Rodauth = Data.define :name, :label, :description, :uri
7
+ end
8
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "forwardable"
4
+
5
+ module Pennyworth
6
+ module Presenters
7
+ # Shapes a Rodauth record for serialization.
8
+ class Rodauth
9
+ extend Forwardable
10
+
11
+ delegate %i[name label description uri] => :record
12
+
13
+ def initialize record
14
+ @record = record
15
+ end
16
+
17
+ alias id name
18
+
19
+ private
20
+
21
+ attr_reader :record
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pennyworth
4
+ module Serializers
5
+ # Serializes a Rodauth presenter for parsing by Alfred script filters.
6
+ class Rodauth
7
+ def initialize presenter
8
+ @presenter = presenter
9
+ end
10
+
11
+ def to_h
12
+ {
13
+ uid: presenter.id,
14
+ title: presenter.label,
15
+ subtitle: presenter.description,
16
+ arg: site_uri,
17
+ quicklookurl: site_uri,
18
+ mods: modifications,
19
+ text:
20
+ }
21
+ end
22
+
23
+ private
24
+
25
+ attr_reader :presenter
26
+
27
+ def modifications
28
+ {
29
+ alt: modification(presenter.label, "Copy label."),
30
+ cmd: modification(presenter.description, "Copy description."),
31
+ control: modification(presenter.name, "Copy name.")
32
+ }
33
+ end
34
+
35
+ def modification argument, subtitle
36
+ {
37
+ subtitle:,
38
+ arg: argument
39
+ }
40
+ end
41
+
42
+ def text
43
+ {
44
+ copy: site_uri,
45
+ largetype: site_uri
46
+ }
47
+ end
48
+
49
+ def site_uri = presenter.uri
50
+ end
51
+ end
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 = "18.6.0"
5
+ spec.version = "18.7.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/pennyworth"
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: 18.6.0
4
+ version: 18.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -252,6 +252,7 @@ files:
252
252
  - lib/pennyworth/cli/actions/htmx/extension.rb
253
253
  - lib/pennyworth/cli/actions/htmx/reference.rb
254
254
  - lib/pennyworth/cli/actions/http_status.rb
255
+ - lib/pennyworth/cli/actions/rodauth.rb
255
256
  - lib/pennyworth/cli/actions/standard_error.rb
256
257
  - lib/pennyworth/cli/actions/standard_gem.rb
257
258
  - lib/pennyworth/cli/actions/system/error.rb
@@ -269,6 +270,7 @@ files:
269
270
  - lib/pennyworth/loaders/git_hub.rb
270
271
  - lib/pennyworth/loaders/htmx.rb
271
272
  - lib/pennyworth/loaders/http_status.rb
273
+ - lib/pennyworth/loaders/rodauth.rb
272
274
  - lib/pennyworth/loaders/standard_error.rb
273
275
  - lib/pennyworth/loaders/standard_gem.rb
274
276
  - lib/pennyworth/loaders/system/error.rb
@@ -277,6 +279,7 @@ files:
277
279
  - lib/pennyworth/models/encoding.rb
278
280
  - lib/pennyworth/models/htmx.rb
279
281
  - lib/pennyworth/models/http_status.rb
282
+ - lib/pennyworth/models/rodauth.rb
280
283
  - lib/pennyworth/models/standard_error.rb
281
284
  - lib/pennyworth/models/system/error.rb
282
285
  - lib/pennyworth/models/system/signal.rb
@@ -286,6 +289,7 @@ files:
286
289
  - lib/pennyworth/presenters/htmx.rb
287
290
  - lib/pennyworth/presenters/http_status.rb
288
291
  - lib/pennyworth/presenters/repository.rb
292
+ - lib/pennyworth/presenters/rodauth.rb
289
293
  - lib/pennyworth/presenters/standard_error.rb
290
294
  - lib/pennyworth/presenters/standard_gem.rb
291
295
  - lib/pennyworth/presenters/system/error.rb
@@ -296,6 +300,7 @@ files:
296
300
  - lib/pennyworth/serializers/htmx.rb
297
301
  - lib/pennyworth/serializers/http_status.rb
298
302
  - lib/pennyworth/serializers/project.rb
303
+ - lib/pennyworth/serializers/rodauth.rb
299
304
  - lib/pennyworth/serializers/standard_error.rb
300
305
  - lib/pennyworth/serializers/system/error.rb
301
306
  - lib/pennyworth/serializers/system/signal.rb
metadata.gz.sig CHANGED
@@ -1 +1,3 @@
1
- ����l�9�Ɋ�.�h�΍G�9������O�F��7U�7e�>�9})��<h�l�I�3E޽z��J�x�� ,zwcJg�+z}�/{���X��S M��핐p#`���o&�zK�S�gnE�#8U��2�i�#��� 1��Z�ʾ�m�iP�t�y����Z\H��01h�N�G�W]!��a��
1
+ ˓�0qê���[��޲)u_������x��wS9����d `T~�Eh���8a6
2
+ ��7��ʮ�-b|���׸����Y<9�2ƙ�ۘśD=3��h<�[?�{���mYŤ�<K:!@|�6���jBk�a��]2�����7� �����4���C����G���d?��
3
+ �Z���:�d�����ܑ����x<S1�� ˑ���w��ř