pennyworth 17.4.0 → 17.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +44 -28
- data/lib/pennyworth/cli/actions/htmx/extension.rb +31 -0
- data/lib/pennyworth/cli/shell.rb +1 -0
- data/lib/pennyworth/configuration/contract.rb +2 -0
- data/lib/pennyworth/configuration/defaults.yml +4 -2
- data/lib/pennyworth/configuration/model.rb +2 -0
- data/lib/pennyworth/container.rb +3 -0
- data/lib/pennyworth/loaders/htmx.rb +5 -7
- data/pennyworth.gemspec +2 -2
- data.tar.gz.sig +0 -0
- metadata +6 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57f72591d386652cb83fa3f62752efeb51aa84572efc272c003522a0391f19f8
|
4
|
+
data.tar.gz: d2daeb58a7c16a181a5e57607d91610cb0ef9c0afe2acfbed6431c77ef5f9928
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d92cf6fe764fde7201e5017031b532e84510856200d266cc911213da9a241f7c4bb7264ca95352197a102b815e72984b6a2657cdd9326ddda167faaac1db0f1
|
7
|
+
data.tar.gz: 6a38899be0b025d3786781b00d1e7b44d8d23e5dd33b5e8f545c7e2cecdcdc22794d7380c6fc09afa2f6c38dcd39b18004765be773d3b1c6961684518662b77f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
:toclevels: 5
|
3
3
|
:figure-caption!:
|
4
4
|
|
5
|
+
:alfred_link: link:https://www.alfredapp.com[Alfred]
|
5
6
|
:bash_link: link:https://www.gnu.org/software/bash[Bash]
|
7
|
+
:htmx_link: link:https://htmx.org[htmx]
|
8
|
+
:ruby_link: link:https://www.ruby-lang.org[Ruby]
|
9
|
+
:ruby_string_format_link: link:https://docs.ruby-lang.org/en/master/format_specifications_rdoc.html[String Format]
|
6
10
|
:ruby_version_managers_link: link:https://alchemists.io/articles/ruby_version_managers[Ruby Version Manager]
|
7
11
|
|
8
12
|
= Pennyworth
|
@@ -28,9 +32,9 @@ video::https://alchemists.io/videos/projects/pennyworth/demo.mp4[poster=https://
|
|
28
32
|
|
29
33
|
. link:https://www.apple.com/macos[macOS]
|
30
34
|
. {bash_link}
|
31
|
-
.
|
35
|
+
. {alfred_link}
|
32
36
|
. link:https://www.alfredapp.com/purchase[Alfred Powerpack]
|
33
|
-
.
|
37
|
+
. {ruby_link}
|
34
38
|
|
35
39
|
While using a {ruby_version_managers_link} is not a hard requirement, it is strongly encouraged since a version manager will give you the freedom to toggle between different Ruby versions since this gem has strict Ruby version requirements (especially in regards to using a modern version of Ruby).
|
36
40
|
|
@@ -179,8 +183,10 @@ http:
|
|
179
183
|
statuses:
|
180
184
|
url: "https://developer.mozilla.org/docs/Web/HTTP/Status"
|
181
185
|
htmx:
|
182
|
-
examples_uri: "
|
183
|
-
|
186
|
+
examples_uri: "%<htmx_site_uri>s/examples"
|
187
|
+
extensions_uri: "%<htmx_site_uri>s/extensions"
|
188
|
+
references_uri: "%<htmx_site_uri>s/reference"
|
189
|
+
site_uri: "https://htmx.org"
|
184
190
|
ruby_gems:
|
185
191
|
api_url: "https://rubygems.org/api/v1"
|
186
192
|
standard_gems:
|
@@ -190,6 +196,8 @@ standard_gems:
|
|
190
196
|
Feel free to take this default configuration, modify, and save as your own custom
|
191
197
|
`configuration.yml`.
|
192
198
|
|
199
|
+
For {htmx_link}, the Ruby {ruby_string_format_link} specification is used which means you can define the `site_uri` once and have it automatically resolved in all URIs that reference it. Otherwise, you can use literal URIs if desired.
|
200
|
+
|
193
201
|
=== Themes
|
194
202
|
|
195
203
|
image:https://alchemists.io/images/projects/pennyworth/screenshots/alchemists-theme.png[Alchemists Theme,width=706,height=632,role=focal_point]
|
@@ -201,15 +209,19 @@ directly].
|
|
201
209
|
|
202
210
|
=== Workflows
|
203
211
|
|
204
|
-
|
205
|
-
|
212
|
+
All workflows are split into two categories:
|
213
|
+
|
214
|
+
* xref:_ruby_required[Ruby Required]
|
215
|
+
* xref:_ruby_optional[Ruby Optional]
|
216
|
+
|
217
|
+
For workflows that _do_ require {ruby_link} and this gem, the following assumptions are made:
|
206
218
|
|
207
|
-
|
208
|
-
|
209
|
-
|
219
|
+
. Your link:https://alchemists.io/projects/dotfiles[Dotfiles] are configured to use {bash_link} and load your environment appropriately. Bash is not a hard requirement, though. You can use _any shell_ you are comfortable with as long as you teach Alfred to load your development environment before running the Alfred Workflow.
|
220
|
+
. You have the latest version of {alfred_link}, {ruby_link}, and this gem installed.
|
221
|
+
. You are using a {ruby_version_managers_link} which ensures Ruby is on your load path. As mentioned in the xref:_requirements[Requirements], this is not a hard requirement so if you have the correct version of Ruby required by this gem on your path, that'll work too.
|
210
222
|
|
211
|
-
With the above
|
212
|
-
Pennyworth workflows that are compatible with
|
223
|
+
With the above in mind, the following sections document how to download and install all
|
224
|
+
Pennyworth workflows that are compatible with {alfred_link}. Should you want to tweak any of these
|
213
225
|
workflows, you'd only need to edit an existing workflow or build your own with these settings:
|
214
226
|
|
215
227
|
image:https://alchemists.io/images/projects/pennyworth/screenshots/script_filter.png[Script Filter,width=776,height=635,role=focal_point]
|
@@ -224,7 +236,11 @@ to all workflows depending on what kind of item is currently selected within the
|
|
224
236
|
current selection.
|
225
237
|
* `ENTER` Will either copy selection to clipboard or launch URL in default web browser.
|
226
238
|
|
227
|
-
====
|
239
|
+
==== Ruby Required
|
240
|
+
|
241
|
+
The following workflows require {ruby_link} -- and this gem -- to unleash all capabilities.
|
242
|
+
|
243
|
+
===== Alchemists
|
228
244
|
|
229
245
|
image:https://alchemists.io/images/projects/pennyworth/screenshots/alchemists-projects.png[Alchemists Projects,width=706,height=631,role=focal_point]
|
230
246
|
|
@@ -234,7 +250,7 @@ Provides quick access to link:https://alchemists.io[Alchemists] resources.
|
|
234
250
|
double click to install.
|
235
251
|
2. Click on _Configure Workflow_ to view documentation.
|
236
252
|
|
237
|
-
|
253
|
+
===== Dry RB
|
238
254
|
|
239
255
|
image:https://alchemists.io/images/projects/pennyworth/screenshots/dry.png[Dry Gems,width=706,height=631,role=focal_point]
|
240
256
|
|
@@ -244,7 +260,17 @@ Provides quick access to link:https://dry-rb.org[Dry RB] resources.
|
|
244
260
|
click to install.
|
245
261
|
2. Click on _Configure Workflow_ to view documentation.
|
246
262
|
|
247
|
-
|
263
|
+
===== htmx
|
264
|
+
|
265
|
+
image:https://alchemists.io/images/projects/pennyworth/screenshots/htmx.png[htmx workflow screenshot.,width=706,height=631,role=focal_point]
|
266
|
+
|
267
|
+
Provides quick access to the {htmx_link} JavaScript library.
|
268
|
+
|
269
|
+
1. link:https://alchemists.io/public/alfred/workflows/htmx.alfredworkflow[Download] and
|
270
|
+
double click to install.
|
271
|
+
2. Click on _Configure Workflow_ to view documentation.
|
272
|
+
|
273
|
+
===== RuboCop
|
248
274
|
|
249
275
|
image:https://alchemists.io/images/projects/pennyworth/screenshots/rubocop-projects.png[Rubocop Projects,width=706,height=632,role=focal_point]
|
250
276
|
|
@@ -254,7 +280,7 @@ Provides quick access to link:https://docs.rubocop.org/rubocop[RuboCop] resource
|
|
254
280
|
double click to install.
|
255
281
|
2. Click on _Configure Workflow_ to view documentation.
|
256
282
|
|
257
|
-
|
283
|
+
===== Ruby
|
258
284
|
|
259
285
|
image:https://alchemists.io/images/projects/pennyworth/screenshots/ruby.png[Ruby workflow screenshot,width=706,height=631,role=focal_point]
|
260
286
|
|
@@ -264,9 +290,9 @@ Provides quick access to link:https://www.ruby-lang.org[Ruby] resources.
|
|
264
290
|
double click to install.
|
265
291
|
2. Click on _Configure Workflow_ to view documentation.
|
266
292
|
|
267
|
-
====
|
293
|
+
==== Ruby Optional
|
268
294
|
|
269
|
-
The following workflows don't require this gem to use but are provided for convenience in case they
|
295
|
+
The following workflows don't require {ruby_link} -- or this gem -- to use but are provided for convenience in case they can augment your own workflow further.
|
270
296
|
|
271
297
|
===== Acronyms
|
272
298
|
|
@@ -439,16 +465,6 @@ Provides quick access to the link:https://html.spec.whatwg.org/multipage[HTML] l
|
|
439
465
|
double click to install.
|
440
466
|
2. Click on _Configure Workflow_ to view documentation.
|
441
467
|
|
442
|
-
===== htmx
|
443
|
-
|
444
|
-
image:https://alchemists.io/images/projects/pennyworth/screenshots/htmx.png[htmx workflow screenshot.,width=706,height=631,role=focal_point]
|
445
|
-
|
446
|
-
Provides quick access to the link:https://htmx.org[htmx] JavaScript library.
|
447
|
-
|
448
|
-
1. link:https://alchemists.io/public/alfred/workflows/htmx.alfredworkflow[Download] and
|
449
|
-
double click to install.
|
450
|
-
2. Click on _Configure Workflow_ to view documentation.
|
451
|
-
|
452
468
|
===== Icon
|
453
469
|
|
454
470
|
image:https://alchemists.io/images/projects/pennyworth/screenshots/icon.png[Icon workflow screenshot.,width=706,height=631,role=focal_point]
|
@@ -638,7 +654,7 @@ bin/console
|
|
638
654
|
|
639
655
|
The following documents the workflow used to process all actions from Alfred.
|
640
656
|
|
641
|
-
image::https://alchemists.io/images/projects/pennyworth/doc/architecture.
|
657
|
+
image::https://alchemists.io/images/projects/pennyworth/doc/architecture.png[Architecture Diagram,width=1265,height=2377,role=focal_point]
|
642
658
|
|
643
659
|
== Tests
|
644
660
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "sod"
|
4
|
+
|
5
|
+
module Pennyworth
|
6
|
+
module CLI
|
7
|
+
module Actions
|
8
|
+
module HTMX
|
9
|
+
# Handles extension documentation action.
|
10
|
+
class Extension < Sod::Action
|
11
|
+
include Import[:settings, :io]
|
12
|
+
|
13
|
+
description "Render Alfred extensions script filter."
|
14
|
+
|
15
|
+
on "--extensions"
|
16
|
+
|
17
|
+
def initialize(processor: Processor.for_htmx, **)
|
18
|
+
@processor = processor
|
19
|
+
super(**)
|
20
|
+
end
|
21
|
+
|
22
|
+
def call(*) = io.puts processor.call(settings.htmx_extensions_uri).to_json
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
attr_reader :processor
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/pennyworth/cli/shell.rb
CHANGED
@@ -14,7 +14,9 @@ module Pennyworth
|
|
14
14
|
optional(:git_hub_user).filled :string
|
15
15
|
required(:http_statuses_url).filled :string
|
16
16
|
required(:htmx_examples_uri).filled :string
|
17
|
+
required(:htmx_extensions_uri).filled :string
|
17
18
|
required(:htmx_references_uri).filled :string
|
19
|
+
required(:htmx_site_uri).filled :string
|
18
20
|
required(:ruby_gems_api_url).filled :string
|
19
21
|
optional(:ruby_gems_owner).filled :string
|
20
22
|
required(:standard_gems_api_url).filled :string
|
@@ -77,8 +77,10 @@ http:
|
|
77
77
|
statuses:
|
78
78
|
url: "https://developer.mozilla.org/docs/Web/HTTP/Status"
|
79
79
|
htmx:
|
80
|
-
examples_uri: "
|
81
|
-
|
80
|
+
examples_uri: "%<htmx_site_uri>s/examples"
|
81
|
+
extensions_uri: "%<htmx_site_uri>s/extensions"
|
82
|
+
references_uri: "%<htmx_site_uri>s/reference"
|
83
|
+
site_uri: "https://htmx.org"
|
82
84
|
ruby_gems:
|
83
85
|
api_url: "https://rubygems.org/api/v1"
|
84
86
|
standard_gems:
|
data/lib/pennyworth/container.rb
CHANGED
@@ -16,6 +16,9 @@ module Pennyworth
|
|
16
16
|
Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
|
17
17
|
.add_loader(:yaml, self[:defaults_path])
|
18
18
|
.add_loader(:yaml, self[:xdg_config].active)
|
19
|
+
.add_transformer(:format, :htmx_examples_uri)
|
20
|
+
.add_transformer(:format, :htmx_extensions_uri)
|
21
|
+
.add_transformer(:format, :htmx_references_uri)
|
19
22
|
end
|
20
23
|
|
21
24
|
register(:settings) { Etcher.call(self[:registry]).dup }
|
@@ -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]
|
11
|
+
include Import[:http, :settings]
|
12
12
|
|
13
13
|
using Refinements::String
|
14
14
|
|
@@ -34,9 +34,7 @@ module Pennyworth
|
|
34
34
|
read(uri).each.with_object [] do |row, entries|
|
35
35
|
next unless row.locate("td") in Ox::Element => item, Ox::Element => description
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
entries.append record_for(label, description, item)
|
37
|
+
entries.append record_for(item, description, uri)
|
40
38
|
end
|
41
39
|
end
|
42
40
|
|
@@ -52,11 +50,11 @@ module Pennyworth
|
|
52
50
|
|
53
51
|
def parse_rows(document) = parser.parse(document).locate "*/tr"
|
54
52
|
|
55
|
-
def record_for
|
53
|
+
def record_for item, description, uri
|
56
54
|
model[
|
57
|
-
label:
|
55
|
+
label: (item.locate("*/code").first || item.locate("a").first).text,
|
58
56
|
description: "#{self.class.text_for description}.",
|
59
|
-
uri: item.locate("*/@href").first
|
57
|
+
uri: (item.locate("*/@href").first || uri).sub(%r(\A(?=/)), settings.htmx_site_uri)
|
60
58
|
]
|
61
59
|
end
|
62
60
|
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.
|
5
|
+
spec.version = "17.5.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/pennyworth"
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_dependency "infusible", "~> 3.8"
|
33
33
|
spec.add_dependency "ox", "~> 2.14"
|
34
34
|
spec.add_dependency "rack", "~> 3.0"
|
35
|
-
spec.add_dependency "refinements", "~> 12.
|
35
|
+
spec.add_dependency "refinements", "~> 12.9"
|
36
36
|
spec.add_dependency "runcom", "~> 11.5"
|
37
37
|
spec.add_dependency "sod", "~> 0.14"
|
38
38
|
spec.add_dependency "spek", "~> 3.0"
|
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: 17.
|
4
|
+
version: 17.5.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: 2024-
|
38
|
+
date: 2024-10-07 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -169,14 +169,14 @@ dependencies:
|
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: '12.
|
172
|
+
version: '12.9'
|
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: '12.
|
179
|
+
version: '12.9'
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: runcom
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,6 +252,7 @@ files:
|
|
252
252
|
- lib/pennyworth/cli/actions/git_hub/organization.rb
|
253
253
|
- lib/pennyworth/cli/actions/git_hub/user.rb
|
254
254
|
- lib/pennyworth/cli/actions/htmx/example.rb
|
255
|
+
- lib/pennyworth/cli/actions/htmx/extension.rb
|
255
256
|
- lib/pennyworth/cli/actions/htmx/reference.rb
|
256
257
|
- lib/pennyworth/cli/actions/http_status.rb
|
257
258
|
- lib/pennyworth/cli/actions/standard_error.rb
|
@@ -332,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
332
333
|
- !ruby/object:Gem::Version
|
333
334
|
version: '0'
|
334
335
|
requirements: []
|
335
|
-
rubygems_version: 3.5.
|
336
|
+
rubygems_version: 3.5.21
|
336
337
|
signing_key:
|
337
338
|
specification_version: 4
|
338
339
|
summary: A command line interface for augmented Alfred workflows.
|
metadata.gz.sig
CHANGED
Binary file
|