pennyworth 9.5.0 → 11.1.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.tar.gz.sig +0 -0
- data/README.adoc +341 -31
- data/bin/pennyworth +1 -3
- data/lib/pennyworth.rb +11 -2
- data/lib/pennyworth/cli/actions/config.rb +35 -0
- data/lib/pennyworth/cli/actions/encodings.rb +23 -0
- data/lib/pennyworth/cli/actions/git_hub.rb +27 -0
- data/lib/pennyworth/cli/actions/http_statuses.rb +23 -0
- data/lib/pennyworth/cli/actions/ruby_gems.rb +27 -0
- data/lib/pennyworth/cli/actions/system/errors.rb +25 -0
- data/lib/pennyworth/cli/actions/system/signals.rb +25 -0
- data/lib/pennyworth/cli/actions/text.rb +23 -0
- data/lib/pennyworth/cli/configuration/content.rb +28 -0
- data/lib/pennyworth/cli/configuration/defaults.yml +25 -0
- data/lib/pennyworth/cli/configuration/loader.rb +37 -0
- data/lib/pennyworth/cli/parsers.rb +11 -0
- data/lib/pennyworth/cli/parsers/assembler.rb +32 -0
- data/lib/pennyworth/cli/parsers/core.rb +100 -0
- data/lib/pennyworth/cli/parsers/git_hub.rb +51 -0
- data/lib/pennyworth/cli/parsers/ruby_gems.rb +35 -0
- data/lib/pennyworth/cli/shell.rb +82 -0
- data/lib/pennyworth/container.rb +40 -0
- data/lib/pennyworth/identity.rb +2 -1
- data/lib/pennyworth/inflector.rb +18 -0
- data/lib/pennyworth/integrations/git_hub/client.rb +59 -0
- data/lib/pennyworth/integrations/git_hub/response.rb +33 -0
- data/lib/pennyworth/integrations/ruby_gems/client.rb +29 -0
- data/lib/pennyworth/loaders/encodings.rb +31 -0
- data/lib/pennyworth/loaders/http_statuses.rb +28 -0
- data/lib/pennyworth/loaders/projects.rb +22 -0
- data/lib/pennyworth/loaders/system/errors.rb +33 -0
- data/lib/pennyworth/loaders/system/signals.rb +21 -0
- data/lib/pennyworth/loaders/text.rb +27 -0
- data/lib/pennyworth/models/encoding.rb +8 -0
- data/lib/pennyworth/models/http_status.rb +8 -0
- data/lib/pennyworth/models/system/error.rb +10 -0
- data/lib/pennyworth/models/system/signal.rb +10 -0
- data/lib/pennyworth/models/text.rb +8 -0
- data/lib/pennyworth/presenters/encoding.rb +22 -0
- data/lib/pennyworth/presenters/gem.rb +48 -0
- data/lib/pennyworth/presenters/http_status.rb +41 -0
- data/lib/pennyworth/presenters/repository.rb +35 -0
- data/lib/pennyworth/presenters/system/error.rb +28 -0
- data/lib/pennyworth/presenters/system/signal.rb +22 -0
- data/lib/pennyworth/presenters/text.rb +25 -0
- data/lib/pennyworth/processor.rb +68 -0
- data/lib/pennyworth/serializers/encoding.rb +33 -0
- data/lib/pennyworth/serializers/http_status.rb +41 -0
- data/lib/pennyworth/serializers/project.rb +52 -0
- data/lib/pennyworth/serializers/system/error.rb +46 -0
- data/lib/pennyworth/serializers/system/signal.rb +40 -0
- data/lib/pennyworth/serializers/text.rb +31 -0
- metadata +125 -34
- metadata.gz.sig +0 -0
- data/lib/pennyworth/cli.rb +0 -140
- data/lib/pennyworth/templates/workflows/user.workflow.B59B22A2-1880-4765-9358-412791BE9202/icon.png +0 -0
- data/lib/pennyworth/templates/workflows/user.workflow.B59B22A2-1880-4765-9358-412791BE9202/info.plist +0 -159
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/icon.png +0 -0
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/info.plist +0 -272
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/string-camelcase.png +0 -0
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/string-capitalize.png +0 -0
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/string-lowercase.png +0 -0
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/string-size.png +0 -0
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/string-snakecase.png +0 -0
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/string-titleize.png +0 -0
- data/lib/pennyworth/templates/workflows/user.workflow.C431E56A-0EC2-47EE-94D5-D67D9FE323BE/string-uppercase.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7728d713e396e5b7057ada093978e762b4f3391cf8d6a677d62e099b34fd23cf
|
4
|
+
data.tar.gz: 4e75b766da7c629ea61dcc9a37985adca377f14d8d7f836704c947db8ad5094b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27f7eb459bfcc51ed7e36f90ebe8dbd8a4ce4bc7254366a494364b4ff0ea0c3cafa622e37762d0122974637c46d8ede3eee6a521306a79a21a0acaa846f88a0f
|
7
|
+
data.tar.gz: abe30a6358ed349bcee58e15f8ab2379dd93146c86cd785de142ada9ab75ce987d364c971962ddf9885c3fb3ef3de68c17d9b9085a510b3c656086df98bc925c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -11,25 +11,28 @@ image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchem
|
|
11
11
|
[link=https://circleci.com/gh/bkuhlmann/pennyworth]
|
12
12
|
image::https://circleci.com/gh/bkuhlmann/pennyworth.svg?style=svg[Circle CI Status]
|
13
13
|
|
14
|
-
A command line interface that
|
14
|
+
A command line interface that augments link:https://www.alfredapp.com[Alfred] workflows.
|
15
15
|
|
16
16
|
toc::[]
|
17
17
|
|
18
18
|
== Features
|
19
19
|
|
20
|
-
* Adds Ruby support to Alfred.
|
21
|
-
*
|
20
|
+
* Adds Ruby support to link:https://www.alfredapp.com[Alfred].
|
21
|
+
* Supports building advanced link:https://www.alfredapp.com/help/workflows[Workflows] for personal
|
22
|
+
augmentation.
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
== Screencast
|
25
|
+
|
26
|
+
video::https://www.alchemists.io/videos/projects/pennyworth/demo.mp4[poster=https://www.alchemists.io/images/projects/pennyworth/demo.png,width=1062,height=1194,role=focal_point]
|
25
27
|
|
26
28
|
== Requirements
|
27
29
|
|
28
|
-
. https://www.apple.com/macos[macOS]
|
29
|
-
. https://www.
|
30
|
-
. https://www.alfredapp.com
|
31
|
-
. https://
|
32
|
-
. https://
|
30
|
+
. link:https://www.apple.com/macos[macOS]
|
31
|
+
. link:https://www.gnu.org/software/bash[Bash]
|
32
|
+
. link:https://www.alfredapp.com[Alfred]
|
33
|
+
. link:https://www.alfredapp.com/purchase[Alfred Powerpack]
|
34
|
+
. link:https://github.com/postmodern/chruby[chruby]
|
35
|
+
. link:https://www.ruby-lang.org[Ruby]
|
33
36
|
|
34
37
|
== Setup
|
35
38
|
|
@@ -40,36 +43,76 @@ To install, run:
|
|
40
43
|
gem install pennyworth
|
41
44
|
----
|
42
45
|
|
46
|
+
When using the `--git_hub` CLI option, you'll want to supply your GitHub login and
|
47
|
+
link:https://github.com/settings/tokens[Personal Access Token] with at least _read_ access via the
|
48
|
+
following environment variables:
|
49
|
+
|
50
|
+
[source,bash]
|
51
|
+
----
|
52
|
+
GITHUB_API_LOGIN=
|
53
|
+
GITHUB_API_TOKEN=
|
54
|
+
----
|
55
|
+
|
56
|
+
You can configure these environment variables via link:https://direnv.net[direnv] if using the CLI
|
57
|
+
or through the link:https://www.alfredapp.com/help/workflows/advanced/variables/#environment[Alfred
|
58
|
+
Workflow Environment].
|
59
|
+
|
60
|
+
⚠️ When using Alfred Workflow environment variables, please ensure you check the _Don't Export_
|
61
|
+
option for these variables so you don't expose your credentials when exporting/sharing workflows
|
62
|
+
with others.
|
63
|
+
|
43
64
|
== Usage
|
44
65
|
|
45
66
|
=== Command Line Interface (CLI)
|
46
67
|
|
47
|
-
From the command line, type
|
68
|
+
From the command line, type `pennyworth` to view usage:
|
48
69
|
|
49
70
|
....
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
71
|
+
USAGE:
|
72
|
+
-c, --config ACTION Manage gem configuration. Actions: edit || view.
|
73
|
+
--encodings Render Alfred encodings script filter.
|
74
|
+
--git_hub Render Alfred GitHub repositories script filter.
|
75
|
+
-h, --help Show this message.
|
76
|
+
--http_statuses Render Alfred HTTP statuses script filter.
|
77
|
+
--ruby_gems Render Alfred RubyGems script filter.
|
78
|
+
--system_errors Render Alfred system errors script filter.
|
79
|
+
--system_signals Render Alfred system signals script filter.
|
80
|
+
--text CONTENT Render Alfred text script filter.
|
81
|
+
-v, --version Show gem version.
|
82
|
+
|
83
|
+
GITHUB OPTIONS:
|
84
|
+
--organization [HANDLE] Set organization. Default: "".
|
85
|
+
--user [HANDLE] Set user. Default: "".
|
86
|
+
|
87
|
+
RUBYGEMS OPTIONS:
|
88
|
+
--owner [HANDLE] Set owner. Default: "".
|
55
89
|
....
|
56
90
|
|
57
|
-
|
91
|
+
The following demonstrates how to use Pennyworth from the CLI or within an Alfred Script Filter:
|
58
92
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
-c, [--camelcase], [--no-camelcase] # Capitalize each word and delimit with nothing or double colon.
|
64
|
-
-s, [--snakecase], [--no-snakecase] # Downcase each word and delimit with underscore or forward slash.
|
65
|
-
-s, [--size], [--no-size] # Calculate string size.
|
66
|
-
....
|
93
|
+
[source,bash]
|
94
|
+
----
|
95
|
+
pennyworth --config edit
|
96
|
+
pennyworth --config view
|
67
97
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
98
|
+
pennyworth --encodings
|
99
|
+
|
100
|
+
pennyworth --git_hub --organization alchemists
|
101
|
+
pennyworth --git_hub --user bkuhlmann
|
102
|
+
|
103
|
+
pennyworth --http_statuses
|
104
|
+
pennyworth --ruby_gems --owner bkuhlmann
|
105
|
+
pennyworth --system_errors
|
106
|
+
pennyworth --system_signals
|
107
|
+
|
108
|
+
pennyworth --text demo
|
109
|
+
pennyworth --text "An Example"
|
110
|
+
----
|
111
|
+
|
112
|
+
While the command line options are nice, the real power comes from using Pennyworth in conjunction
|
113
|
+
with link:https://www.alfredapp.com/help/workflows/inputs/script-filter/json[Alfred Script Filters].
|
114
|
+
Without having Alfred wired up to consume the CLI output, you'll only get a JSON in your console. To
|
115
|
+
explain better, continue reading or skip ahead to the _Workflows_ section.
|
73
116
|
|
74
117
|
=== Customization
|
75
118
|
|
@@ -86,12 +129,279 @@ The default configuration is as follows:
|
|
86
129
|
|
87
130
|
[source,yaml]
|
88
131
|
----
|
89
|
-
:
|
132
|
+
:alfred:
|
133
|
+
:preferences:
|
134
|
+
:inflections:
|
135
|
+
- "Bkuhlmann": "bkuhlmann"
|
136
|
+
- "Dry Auto Inject": "Dry AutoInject"
|
137
|
+
- "Dry Cli": "Dry CLI"
|
138
|
+
- "Flacsmith": "FLACsmith"
|
139
|
+
- "Git Plus": "Git+"
|
140
|
+
- "Mac Os Config": "macOS Configuration"
|
141
|
+
- "Mac Os": "MacOS"
|
142
|
+
- "Prawn Plus": "Prawn+"
|
143
|
+
- "Rubocop Ast": "Rubocop AST"
|
144
|
+
- "Rubocop Md": "Rubocop Markdown"
|
145
|
+
- "Rubocop Rspec": "Rubocop RSpec"
|
146
|
+
- "Xdg": "XDG"
|
147
|
+
:git_hub:
|
148
|
+
:api_url: "https://api.github.com"
|
149
|
+
:organization:
|
150
|
+
:user:
|
151
|
+
:http:
|
152
|
+
:statuses:
|
153
|
+
:url: "https://httpstatuses.com"
|
154
|
+
:ruby_gems:
|
155
|
+
:api_url: "https://rubygems.org/api/v1"
|
156
|
+
:owner:
|
90
157
|
----
|
91
158
|
|
92
159
|
Feel free to take this default configuration, modify, and save as your own custom
|
93
160
|
`configuration.yml`.
|
94
161
|
|
162
|
+
=== Themes
|
163
|
+
|
164
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/alchemists-theme.png[Alchemists Theme,width=634,height=121,role=focal_point]
|
165
|
+
|
166
|
+
The above is shared as the link:https://www.alfredapp.com/extras/theme/FSz9kjN1wX[Alchemists Alfred
|
167
|
+
Theme] which can be
|
168
|
+
link:alfred://theme/?t=eyJhbGZyZWR0aGVtZSI6eyJyZXN1bHQiOnsidGV4dFNwYWNpbmciOjEwLCJzdWJ0ZXh0Ijp7InNpemUiOjEyLCJjb2xvclNlbGVjdGVkIjoiI0Q2RDZENkZGIiwiZm9udCI6IkhlbHZldGljYSIsImNvbG9yIjoiI0Q2RDZENkZGIn0sInNob3J0Y3V0Ijp7InNpemUiOjE2LCJjb2xvclNlbGVjdGVkIjoiI0ZGRkZGRkZGIiwiZm9udCI6IkhlbHZldGljYSIsImNvbG9yIjoiI0ZFRkNGRkZGIn0sImJhY2tncm91bmRTZWxlY3RlZCI6IiNBMDI2MThGRiIsInRleHQiOnsic2l6ZSI6MTYsImNvbG9yU2VsZWN0ZWQiOiIjRkZGRkZGRkYiLCJmb250IjoiSGVsdmV0aWNhIiwiY29sb3IiOiIjRTFERURFRkYifSwiaWNvblBhZGRpbmdIb3Jpem9udGFsIjo1LCJyb3VuZG5lc3MiOjAsInBhZGRpbmdWZXJ0aWNhbCI6NiwiaWNvblNpemUiOjQwfSwic2VhcmNoIjp7ImJhY2tncm91bmRTZWxlY3RlZCI6IiNCMkQ3RkZGRiIsInBhZGRpbmdIb3Jpem9udGFsIjo4LCJzcGFjaW5nIjoxMCwidGV4dCI6eyJzaXplIjozNiwiY29sb3JTZWxlY3RlZCI6IiMwMDAwMDBGRiIsImZvbnQiOiJIZWx2ZXRpY2EiLCJjb2xvciI6IiNGRkZGRkZGRiJ9LCJiYWNrZ3JvdW5kIjoiIzEyMTIxMkZGIiwicm91bmRuZXNzIjowLCJwYWRkaW5nVmVydGljYWwiOjJ9LCJ3aW5kb3ciOnsiY29sb3IiOiIjNzAwQTAwRkYiLCJwYWRkaW5nSG9yaXpvbnRhbCI6MTAsIndpZHRoIjo2MjAsImJvcmRlclBhZGRpbmciOjEwLCJib3JkZXJDb2xvciI6IiMwMDAwMDAzRiIsImJsdXIiOjAsInJvdW5kbmVzcyI6MTIsInBhZGRpbmdWZXJ0aWNhbCI6MTB9LCJjcmVkaXQiOiJCcm9va2UgS3VobG1hbm4iLCJzZXBhcmF0b3IiOnsiY29sb3IiOiIjMDAwMDAwNjYiLCJ0aGlja25lc3MiOjJ9LCJzY3JvbGxiYXIiOnsiY29sb3IiOiIjMDAwMDAwNjYiLCJ0aGlja25lc3MiOjJ9LCJuYW1lIjoiQWxjaGVtaXN0cyJ9fQ==[installed
|
169
|
+
directly].
|
170
|
+
|
171
|
+
=== Workflows
|
172
|
+
|
173
|
+
Not all workflows require Pennyworth to run properly. For the workflows that _do_ require Pennyworth
|
174
|
+
support, the following assumptions are made:
|
175
|
+
|
176
|
+
1. Your link:https://www.alchemists.io/projects/dotfiles[Dotfiles] are configured to use
|
177
|
+
link:https://www.gnu.org/software/bash[Bash] and load your environment appropriately. Bash is not
|
178
|
+
a hard requirement, though. You can use _any shell_ you are comfortable with as long as you teach
|
179
|
+
Alfred to load your development environment before running the Alfred Workflow.
|
180
|
+
2. You have the latest version of Alfred, Ruby, and Pennyworth installed.
|
181
|
+
3. You are using a Ruby version manager, like link:https://github.com/postmodern/chruby[chruby],
|
182
|
+
which ensures Ruby is on your load path.
|
183
|
+
|
184
|
+
With the above requirements in mind, the following sections document how to download and install all
|
185
|
+
Pennyworth workflows that are compatible with Alfred. Should you want to tweak any of these
|
186
|
+
workflows, you'd only need to edit an existing workflow or build your own with these settings:
|
187
|
+
|
188
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/script_filter.png[Script Filter,width=776,height=635,role=focal_point]
|
189
|
+
|
190
|
+
Before diving into each workflow, I want to highlight that the following capabilities are available
|
191
|
+
to all workflows depending on what kind of item is currently selected within the Alfred UI:
|
192
|
+
|
193
|
+
* `SHIFT` or `COMMAND + y` will launch
|
194
|
+
link:https://www.alfredapp.com/help/features/previews[Quicklook] for any URL based workflow.
|
195
|
+
* `ENTER` or `COMMAND + c` will copy selections to clipboard (depends on context, though).
|
196
|
+
* `COMMAND + l` will launch link:https://www.alfredapp.com/help/features/large-type[Large Type] of
|
197
|
+
current selection.
|
198
|
+
* `ENTER` Will either copy selection to clipboard or launch URL in default web browser.
|
199
|
+
|
200
|
+
==== Alchemists
|
201
|
+
|
202
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/alchemists-projects.png[Alchemists Projects,width=706,height=632,role=focal_point]
|
203
|
+
|
204
|
+
The official link:https://www.alchemists.io[Alchemists] workflow for site navigation.
|
205
|
+
|
206
|
+
1. link:https://www.alchemists.io/public/aflred/workflows/alchemists.alfredworkflow[Download] and
|
207
|
+
double click to install.
|
208
|
+
2. Type `ax` to activate.
|
209
|
+
|
210
|
+
💡 Use `ENTER` to view site, `CONTROL` to view changes, `OPTION` to view source, or `COMMAND` to
|
211
|
+
view issues.
|
212
|
+
|
213
|
+
==== Dry RB
|
214
|
+
|
215
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/dry-gems.png[Dry Gems,width=706,height=632,role=focal_point]
|
216
|
+
|
217
|
+
A link:https://dry-rb.org[Dry RB] workflow for navigating all of the Dry RB site.
|
218
|
+
|
219
|
+
1. link:https://www.alchemists.io/public/aflred/workflows/dry.alfredworkflow[Download] and double
|
220
|
+
click to install.
|
221
|
+
2. Type `dry` to activate.
|
222
|
+
|
223
|
+
💡 Use `ENTER` to visit site, `CONTROL` to view changes, `OPTION` to view source, or `COMMAND` to
|
224
|
+
view issues.
|
225
|
+
|
226
|
+
==== Rubocop
|
227
|
+
|
228
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/rubocop-projects.png[Rubocop Projects,width=706,height=632,role=focal_point]
|
229
|
+
|
230
|
+
A link:https://docs.rubocop.org/rubocop[Rubocop] workflow for quick access to documentation,
|
231
|
+
learning about project changes, viewing source code, etc.
|
232
|
+
|
233
|
+
1. link:https://www.alchemists.io/public/aflred/workflows/rubocop.alfredworkflow[Download] and
|
234
|
+
double click to install.
|
235
|
+
2. Type `cop` to activate.
|
236
|
+
|
237
|
+
💡 Use `ENTER` to view site, `CONTROL` to view changes, `OPTION` to view source, or `COMMAND` to
|
238
|
+
view issues.
|
239
|
+
|
240
|
+
==== Ruby
|
241
|
+
|
242
|
+
This workflow is feature packed and only requires a
|
243
|
+
link:https://www.alchemists.io/public/aflred/workflows/ruby.alfredworkflow[single download]. Once
|
244
|
+
downloaded, double click to install, and then continue reading to learn all of the
|
245
|
+
capabilities this single workflow provides.
|
246
|
+
|
247
|
+
===== Bytes
|
248
|
+
|
249
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-bytes.png[Bytes,width=706,height=200,role=focal_point]
|
250
|
+
|
251
|
+
This keyword allows you to generate random bytes.
|
252
|
+
|
253
|
+
Type `bytes` to activate and `ENTER` generate. You can supply an optional number for specific
|
254
|
+
length.
|
255
|
+
|
256
|
+
===== Encodings
|
257
|
+
|
258
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-encodings.png[Encodings,width=706,height=632,role=focal_point]
|
259
|
+
|
260
|
+
This keyword allows you to quickly search for various encodings and/or their associated aliases to
|
261
|
+
use in your own code.
|
262
|
+
|
263
|
+
Type `encodings` to activate. Use `ENTER` to copy label or `OPTION` to copy associated aliases to
|
264
|
+
clipboard.
|
265
|
+
|
266
|
+
===== Hex
|
267
|
+
|
268
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-hex.png[Hex,width=706,height=200,role=focal_point]
|
269
|
+
|
270
|
+
This keyword allows you to generate a random hex string.
|
271
|
+
|
272
|
+
Type `hex` to activate and `ENTER` generate. You can supply an optional number for specific length.
|
273
|
+
|
274
|
+
===== HTTP Statuses
|
275
|
+
|
276
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-http_statuses.png[HTTP Statuses,width=706,height=632,role=focal_point]
|
277
|
+
|
278
|
+
This keyword allows you to look up statuses by code with quick access to the associated symbol for
|
279
|
+
use in your own code. Includes associated documentation for sharing or learning more. All HTTP
|
280
|
+
statuses are sourced from `Rack::Utils::HTTP_STATUS_CODES` which is why
|
281
|
+
link:https://rubygems.org/gems/rack[Rack] is a dependency of this gem and also why some codes might
|
282
|
+
not be present like these
|
283
|
+
link:https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#Unofficial_codes[unofficial codes].
|
284
|
+
|
285
|
+
Type `https` to activate. Use `ENTER` to copy symbol, `CONTROL` to copy code, `OPTION` to copy
|
286
|
+
label, or `COMMAND` to view documentation.
|
287
|
+
|
288
|
+
===== Number
|
289
|
+
|
290
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-number.png[Number,width=706,height=200,role=focal_point]
|
291
|
+
|
292
|
+
This keyword allows you to generate a random number.
|
293
|
+
|
294
|
+
Type `number` to activate and `ENTER` generate. You can supply an optional number for specific
|
295
|
+
length.
|
296
|
+
|
297
|
+
===== Repeat
|
298
|
+
|
299
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-repeat.png[Repeat,width=706,height=200,role=focal_point]
|
300
|
+
|
301
|
+
This keyword allows you to generate a repeating sequence of the same character(s).
|
302
|
+
|
303
|
+
Type `repeat` to activate and `ENTER` generate. You must supply the character(s) you want to repeat
|
304
|
+
followed by a number indicating how many times you want the character(s) to repeat.
|
305
|
+
|
306
|
+
===== System Errors
|
307
|
+
|
308
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-system_errors.png[System Errors,width=706,height=632,role=focal_point]
|
309
|
+
|
310
|
+
This keyword allows you to search low-level system errors. Depending on which operating system you
|
311
|
+
are on, these errors will differ. Error IDs are provided for fuzzy searching since they are what
|
312
|
+
you'll most likely see in your stack dumps. The associated constant can be copied to clipboard for
|
313
|
+
use in your Ruby code.
|
314
|
+
|
315
|
+
Type `syserr` to activate. Use `ENTER` to copy constant, `CONTROL` to copy ID, `OPTION` to copy
|
316
|
+
description, or `COMMAND` to copy ID, name, and description.
|
317
|
+
|
318
|
+
===== System Signals
|
319
|
+
|
320
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-system_signals.png[System Signals,width=706,height=632,role=focal_point]
|
321
|
+
|
322
|
+
This keyword is for searching and acquiring the system signal you want to `trap` in your Ruby code.
|
323
|
+
|
324
|
+
Type `signals` to activate. Use `ENTER` to copy name, `OPTION` to copy ID, or `COMMAND` to copy ID
|
325
|
+
and name.
|
326
|
+
|
327
|
+
===== Text
|
328
|
+
|
329
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-text.png[Text,width=706,height=632,role=focal_point]
|
330
|
+
|
331
|
+
This keyword is for is for basic text manipulation. Supply a string, phrase, or sentence and let
|
332
|
+
Pennyworth calculate all transformations and information you might need.
|
333
|
+
|
334
|
+
Type `text` to activate plus andy string or phrase to transform. Use `ENTER` to copy text to
|
335
|
+
clipboard.
|
336
|
+
|
337
|
+
===== UUID
|
338
|
+
|
339
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-uuid.png[UUID,width=706,height=200,role=focal_point]
|
340
|
+
|
341
|
+
This keyword allows you to generate a random Universally Unique IDentifier (UUID).
|
342
|
+
|
343
|
+
Type `uuid` to activate and `ENTER` generate.
|
344
|
+
|
345
|
+
===== Version
|
346
|
+
|
347
|
+
image:https://www.alchemists.io/images/projects/pennyworth/screenshots/ruby-version.png[Version,width=706,height=254,role=focal_point]
|
348
|
+
|
349
|
+
This keyword allows you obtain Ruby version information.
|
350
|
+
|
351
|
+
Type `version` to activate and `ENTER` generate. Optionally, you can press `OPTION` when selected to
|
352
|
+
answer the Ruby version used by Alfred since Alfred defaults to using whatever version is supplied
|
353
|
+
by macOS.
|
354
|
+
|
355
|
+
==== Other
|
356
|
+
|
357
|
+
The following workflows don't require Pennyworth support but are provided for convenience in case
|
358
|
+
they are of interest/aid to your own productivity. Click each link to download and then double click
|
359
|
+
to install:
|
360
|
+
|
361
|
+
* link:https://www.alchemists.io/public/aflred/workflows/acronyms.alfredworkflow[Acronyms] - Expands
|
362
|
+
acronyms into full explanations so you can think and type in terms of an acronym but appear as if
|
363
|
+
you typed out the full definition each time.
|
364
|
+
* https://www.alchemists.io/public/aflred/workflows/alpine.alfredworkflow[Alpine] - Provides
|
365
|
+
link:https://www.alpinelinux.org[Alpine Linux] resources.
|
366
|
+
* link:https://www.alchemists.io/public/aflred/workflows/applications.alfredworkflow[Applications] -
|
367
|
+
Launches development environment but can be tweaked for your preferences. Using Alfred in this
|
368
|
+
manner ensures your machine boots or restarts quickly and gives you more control over what is
|
369
|
+
launched.
|
370
|
+
* link:https://www.alchemists.io/public/aflred/workflows/browsers.alfredworkflow[Browsers] -
|
371
|
+
Provides browser related utilities.
|
372
|
+
* link:https://www.alchemists.io/public/aflred/workflows/hanami.alfredworkflow[Hanami] - Provides
|
373
|
+
link:https://hanamirb.org[Hanami] resources.
|
374
|
+
* link:https://www.alchemists.io/public/aflred/workflows/chlli.alfredworkflow[chi.li] - Shortens
|
375
|
+
URLs.
|
376
|
+
* link:https://www.alchemists.io/public/aflred/workflows/docker.alfredworkflow[Docker] - Provides
|
377
|
+
link:https://www.docker.com[Docker] resources.
|
378
|
+
* link:https://www.alchemists.io/public/aflred/workflows/mac_os.alfredworkflow[macOS] - Provides
|
379
|
+
macOS utilities.
|
380
|
+
* link:https://www.alchemists.io/public/aflred/workflows/terraform.alfredworkflow[Terraform] -
|
381
|
+
Provides link:https://www.terraform.io[Terraform] resources.
|
382
|
+
* link:https://www.alchemists.io/public/aflred/workflows/text.alfredworkflow[Text] - Provides
|
383
|
+
general text manipulation utilities beyond the Pennyworth powered _text_ keyword (mentioned
|
384
|
+
earlier).
|
385
|
+
|
386
|
+
== Architecture
|
387
|
+
|
388
|
+
The following documents the workfow used to process all actions from Alfred.
|
389
|
+
|
390
|
+
image::/doc/architecture.svg[Architecture Diagram]
|
391
|
+
|
392
|
+
== Troubleshooting
|
393
|
+
|
394
|
+
* link:https://github.com/ruby/psych[Psych] 4.0.0 has a
|
395
|
+
link:https://github.com/ruby/psych/issues/490[bug] which prevents loading of YAML configurations
|
396
|
+
that use symbols as keys. If you get caught by this, uninstall Psych 4.0.0 and fall back to 3.x.x
|
397
|
+
instead.
|
398
|
+
* When your Alfred Workflow yields no output, you might want to open the
|
399
|
+
link:https://www.alfredapp.com/help/workflows/utilities/debug[Alfred Debugger], rerun your
|
400
|
+
workflow, and check for errors. You can also jump to the CLI and run Pennyworth directly.
|
401
|
+
* If you get GitHub authorization errors, make sure you have defined the appropriate credentials
|
402
|
+
(mentioned earlier) for both within your shell where you are running Pennyworth or within the
|
403
|
+
Alfred Workflow environment.
|
404
|
+
|
95
405
|
== Development
|
96
406
|
|
97
407
|
To contribute, run:
|
data/bin/pennyworth
CHANGED
data/lib/pennyworth.rb
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
4
|
-
|
3
|
+
require "zeitwerk"
|
4
|
+
|
5
|
+
loader = Zeitwerk::Loader.for_gem
|
6
|
+
loader.inflector.inflect "cli" => "CLI",
|
7
|
+
"http_status" => "HTTPStatus",
|
8
|
+
"http_statuses" => "HTTPStatuses"
|
9
|
+
loader.setup
|
10
|
+
|
11
|
+
# Main namespace.
|
12
|
+
module Pennyworth
|
13
|
+
end
|