pennyworth 15.1.0 → 15.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aafd1088d83cdaef28941a84e39ce5709aeb6650409f425dd58a2b7d2324bc2d
4
- data.tar.gz: c8f59363157d261b4a3e2d5745b8e1b76cf2db9a3d4b6bd96c0443925fcdedf0
3
+ metadata.gz: 2ff1de819087544b1d4a9bdff56e119b93844ee9cc60ac7f726a48b9a1f14eb2
4
+ data.tar.gz: e8c6f643fa3fbadda887dbc9c63908c9d6c57cef05abcab9aa52be5cfce65cd1
5
5
  SHA512:
6
- metadata.gz: 00a0626d8a8de7e33f9c135b199a6dbb67191ecfe85d05339c3b8868511a72c411b6d27f01ca02f56c0ead332d3ed6bf1ba1ccf6a836745db3fced9ed5ad715c
7
- data.tar.gz: 37104b4204595fc58faf6f3178b234298f764b7e374e5720aab613b790f50f2af6b8c72a20aba98b888b10c02528c2579572b39632d0688cfbd59b482c585e48
6
+ metadata.gz: ff89a69387d37dc83e016c17bb18ef198bcf99cc41656eddf99ce71ea1a60d2d9c54f023c173c265ec8c7d6849c434aa12af07a7e35ba42bd42a5b174eefeaae
7
+ data.tar.gz: 7ccd9996c4b2c274e921ed77d4c4cef5425bd5347712e5857ebe606566a605177f5c3129d1bbd9926300e038bb24299a485793ea1be1a8a3cbea36c09e838dd1
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -22,7 +22,7 @@ toc::[]
22
22
 
23
23
  == Screencast
24
24
 
25
- video::https://alchemists.io/videos/projects/pennyworth/demo.mp4[poster=https://alchemists.io/images/projects/pennyworth/demo.png,width=706,height=632,role=focal_point]
25
+ video::https://alchemists.io/videos/projects/pennyworth/demo.mp4[poster=https://alchemists.io/images/projects/pennyworth/demo.png,width=706,height=631,role=focal_point]
26
26
 
27
27
  == Requirements
28
28
 
@@ -78,31 +78,7 @@ with others.
78
78
 
79
79
  From the command line, type `pennyworth` to view usage:
80
80
 
81
- ....
82
- USAGE
83
- sublime_text_kit [OPTIONS]
84
- sublime_text_kit COMMAND [OPTIONS]
85
-
86
- OPTIONS
87
- --encodings Render Alfred encodings script filter.
88
- --http_statuses Render Alfred HTTP statuses script filter.
89
- --ruby_gems [HANDLE] Render Alfred RubyGems script filter.
90
- Default: bkuhlmann.
91
- --standard_gems [KIND] Render Alfred Standard Gems script filter.
92
- Use: all, default, or bundled.
93
- Default: all.
94
- --standard_errors Render Alfred standard errors script filter.
95
- --system_errors Render Alfred system errors script filter.
96
- --system_signals Render Alfred system signals script filter.
97
- --text CONTENT Render Alfred text script filter.
98
- -v, --version Show version.
99
- -h, --help [COMMAND] Show this message.
100
-
101
- COMMANDS
102
- config Manage configuration.
103
- Path is dynamic per current directory.
104
- git_hub Render Alfred GitHub repositories script filter.
105
- ....
81
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/usage.png[Usage,width=668,height=499,role=focal_point]
106
82
 
107
83
  While the command line options are nice, the real power comes from using Pennyworth in conjunction
108
84
  with link:https://www.alfredapp.com/help/workflows/inputs/script-filter/json[Alfred Script Filters].
@@ -246,7 +222,7 @@ to all workflows depending on what kind of item is currently selected within the
246
222
 
247
223
  ==== Alchemists
248
224
 
249
- image:https://alchemists.io/images/projects/pennyworth/screenshots/alchemists-projects.png[Alchemists Projects,width=706,height=632,role=focal_point]
225
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/alchemists-projects.png[Alchemists Projects,width=706,height=631,role=focal_point]
250
226
 
251
227
  Provides quick access to link:https://alchemists.io[Alchemists] resources.
252
228
 
@@ -256,7 +232,7 @@ Provides quick access to link:https://alchemists.io[Alchemists] resources.
256
232
 
257
233
  ==== Dry RB
258
234
 
259
- image:https://alchemists.io/images/projects/pennyworth/screenshots/dry-gems.png[Dry Gems,width=706,height=632,role=focal_point]
235
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/dry.png[Dry Gems,width=706,height=631,role=focal_point]
260
236
 
261
237
  Provides quick access to link:https://dry-rb.org[Dry RB] resources.
262
238
 
@@ -341,7 +317,7 @@ Provides biographical calculations and information.
341
317
 
342
318
  ===== Browsers
343
319
 
344
- image:https://alchemists.io/images/projects/pennyworth/screenshots/browsers.png[Browsers workflow screenshot.,width=706,height=308,role=focal_point]
320
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/browsers.png[Browsers workflow screenshot.,width=706,height=307,role=focal_point]
345
321
 
346
322
  Provides quick access to browser resources.
347
323
 
@@ -9,23 +9,27 @@ module Pennyworth
9
9
  class StandardGems < Sod::Action
10
10
  include Import[:kernel]
11
11
 
12
+ ENDPOINTS = {
13
+ "all" => "stdgems.json",
14
+ "default" => "default_gems.json",
15
+ "bundled" => "bundled_gems.json"
16
+ }.freeze
17
+
12
18
  description "Render Alfred Standard Gems script filter."
13
19
 
14
20
  on "--standard_gems", argument: "[KIND]", allow: %w[all default bundled], default: "all"
15
21
 
16
- def initialize(processor: Processor.for_standard_gems, **)
22
+ def initialize(processor: Processor.for_standard_gems, endpoints: ENDPOINTS, **)
17
23
  super(**)
18
24
  @processor = processor
25
+ @endpoints = endpoints
19
26
  end
20
27
 
21
- def call kind = nil
22
- endpoint = "#{kind || default}_gems.json"
23
- kernel.puts processor.call(endpoint).to_json
24
- end
28
+ def call(kind = nil) = kernel.puts processor.call(endpoints.fetch(kind || default)).to_json
25
29
 
26
30
  private
27
31
 
28
- attr_reader :processor
32
+ attr_reader :processor, :endpoints
29
33
  end
30
34
  end
31
35
  end
@@ -23,7 +23,7 @@ module Pennyworth
23
23
  def cli
24
24
  context = build_context
25
25
 
26
- dsl.new :sublime_text_kit, banner: specification.banner do
26
+ dsl.new :pennyworth, banner: specification.banner do
27
27
  on(Sod::Prefabs::Commands::Config, context:)
28
28
 
29
29
  on "git_hub", "Render Alfred GitHub repositories script filter." do
@@ -9,46 +9,15 @@ module Pennyworth
9
9
  class Client
10
10
  include Import[:configuration, :http]
11
11
 
12
- # Order matters.
13
- ENDPOINTS = %w[bundled_gems.json default_gems.json].freeze
14
-
15
- def initialize(endpoints: ENDPOINTS, **)
16
- @endpoints = endpoints
17
- super(**)
18
- end
19
-
20
12
  def get endpoint
21
- if endpoints.include? endpoint then load_category endpoint
22
- elsif endpoint == "all_gems.json" then all
23
- else Core::EMPTY_ARRAY
24
- end
25
- end
26
-
27
- private
28
-
29
- attr_reader :endpoints
30
-
31
- # :reek:FeatureEnvy
32
- # :reek:DuplicateMethodCall
33
- def all
34
- load_all.sort_by! { |element| element[:gem] }
35
- .uniq! { |element| element[:gem] }
36
- .then { |collection| collection || Core::EMPTY_ARRAY }
37
- end
38
-
39
- def load_all
40
- endpoints.reduce [] do |collection, endpoint|
41
- collection.append(*load_category(endpoint))
42
- end
43
- end
44
-
45
- def load_category endpoint
46
13
  http.get("#{configuration.standard_gems_api_url}/#{endpoint}")
47
14
  .then do |response|
48
15
  response.status.success? ? records(response.body.to_s) : Core::EMPTY_HASH
49
16
  end
50
17
  end
51
18
 
19
+ private
20
+
52
21
  def records(body) = JSON(body, symbolize_names: true).fetch :gems, Core::EMPTY_ARRAY
53
22
  end
54
23
  end
@@ -21,11 +21,15 @@ module Pennyworth
21
21
 
22
22
  def subtitle = record.fetch :description
23
23
 
24
- def version = record.fetch(:versions, Core::EMPTY_HASH).values.first
24
+ # :reek:FeatureEnvy
25
+ def version
26
+ versions = record.fetch :versions, Core::EMPTY_HASH
27
+ (versions[:bundled] || versions[:default] || versions).values.first
28
+ end
25
29
 
26
- def site_url = record.fetch(:sourceRepository)
30
+ def site_url = record.fetch(:sourceRepository, Core::EMPTY_STRING)
27
31
 
28
- def source_url = record.fetch(:sourceRepository)
32
+ def source_url = record.fetch(:sourceRepository, Core::EMPTY_STRING)
29
33
 
30
34
  def issues_url = "https://github.com/ruby/#{id}/issues"
31
35
 
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.1.0"
5
+ spec.version = "15.2.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: 15.1.0
4
+ version: 15.2.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-07-27 00:00:00.000000000 Z
38
+ date: 2023-08-16 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -310,7 +310,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
310
  - !ruby/object:Gem::Version
311
311
  version: '0'
312
312
  requirements: []
313
- rubygems_version: 3.4.17
313
+ rubygems_version: 3.4.18
314
314
  signing_key:
315
315
  specification_version: 4
316
316
  summary: A command line interface for augmenting Alfred workflows.
metadata.gz.sig CHANGED
@@ -1,3 +1,5 @@
1
- ���G�yW��*�_Ӝ��3����@�yb�a�?��;�1a%d}k0����2zN{/�7� ����\Y����7V,!4.ۃ��BStBj(��ΐ
2
- c��i��Sm~ɻzH��[\ z�~�z�\O>紧�C��r�ƶ�bq���P�%S�o����Pg���<���Q@�Y>0079�z
3
- �EIV\�)�� n�'0Iy2y �ʔ���ؒ��J��a&���vV�:��w4�2���,�CU��\[�ʗeNm"��K���d�hk!�j��Α�uJIO�T2iu�V����8�>��}��6�����4�$�12����Ә��+�Ceڜ��$�|[4&��d��h�#�����o����ل��B7�NYI- �K��u�y�
1
+ 3b�_�XX!>����F���S�+a.?�H�L�.����� y8Zy���+Io|A����Қ�֍i�����Ʌɻ���Y�� ܡ*W��8K.�H��[p�9������(�U���4T�n��
2
+ Uy$FE?
3
+
4
+ ��R���w��}x�E� ��!Q�9D�Are$%3����};�*�3x�;e��v
5
+ iE�{���4l�#C�� :�!0�w7�����2�e�'>��Y�]������ K�}� g�{ ����5�,Vy�z@���U�ă����~8��4}6���z����$�� �˩�P�,��2j� ܢ