pennyworth 21.0.0 → 21.1.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: fd5a9bee54b2e0b04b957ab8bad00881d798fcad5accd6156806e32172d633fc
4
- data.tar.gz: 3814834f7b85212965de3536cbfc406f7fb4765bc27e793eda909067bb0979da
3
+ metadata.gz: 38e304f122c915ab1ce4b3f159e525bf0659a55ab4de5c2ba9c356ea6523c79c
4
+ data.tar.gz: 9c83f34e81c388258252ec9fd57c546df434753cd7d04c474a4d882fbffb4b12
5
5
  SHA512:
6
- metadata.gz: 7af812e43ccaa359727026b6d5bcb14f5534d029c71dc049d4883422cdc28fa2ebebe3d13ad2fce599f965fe87a7c6a13bec6020ae2e256f59be5d1abeffa89f
7
- data.tar.gz: 6304b028aadeaf56723d489d1c3bfe9271be534a90711dc593d2f2fe4dba521ccc7c0484d896c3373c74d4d6a0529d08feb321f4d27f8371959df562c7022c2c
6
+ metadata.gz: dc43b2cf10c2108ce8e350c2ad4cef3fce09088dcdcc88eaf7af140cf873e0da35531dfbf5ee1facb48c0cce1413c6dd05a82e5d963ed434e7405ca026df683b
7
+ data.tar.gz: cd646af7dcb7c411bf5474d3df7c89f96f78a813fd6ef0d1a58e9ee19aa0115e032fc9fafc7271d3bfddefff2023fba6780e650c9ee03a77424e53f0f7eea328
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -82,7 +82,7 @@ with others.
82
82
 
83
83
  From the command line, type `pennyworth` to view usage:
84
84
 
85
- image:https://alchemists.io/images/projects/pennyworth/screenshots/usage.wepb[Usage,width=719,height=516,role=focal_point]
85
+ image:https://alchemists.io/images/projects/pennyworth/screenshots/usage.webp[Usage,width=719,height=516,role=focal_point]
86
86
 
87
87
  While the command line options are nice, the real power comes from using Pennyworth in conjunction
88
88
  with link:https://www.alfredapp.com/help/workflows/inputs/script-filter/json[Alfred Script Filters].
@@ -18,10 +18,7 @@ module Pennyworth
18
18
  def call uri
19
19
  fetch(uri).then { parse_rows it }
20
20
  .each
21
- .with_object [] do |row, entries|
22
- row.children in Nokogiri::XML::Element => item, Nokogiri::XML::Element => description
23
- entries.append build_record(item, description) unless item.text.include? "Soon"
24
- end
21
+ .with_object([]) { |row, entries| entries.append parse_elements(row.children) }
25
22
  end
26
23
 
27
24
  private
@@ -34,13 +31,37 @@ module Pennyworth
34
31
  end
35
32
  end
36
33
 
37
- def parse_rows(page) = parser.parse(page).xpath "//tbody/tr"
34
+ def parse_rows page
35
+ document = parser.parse page
36
+ rows = document.xpath "//tbody/tr"
37
+
38
+ return rows if rows.any?
39
+
40
+ document.xpath "//section//ul/li"
41
+ end
42
+
43
+ def parse_elements elements
44
+ case elements
45
+ in Nokogiri::XML::Element => item, Nokogiri::XML::Element => description
46
+ build_record item, description
47
+ else build_reference_record elements
48
+ end
49
+ end
38
50
 
39
51
  def build_record item, description
40
52
  link = item.at_css "a"
41
53
  uri = %(#{settings.htmx_site_uri}#{link["href"]})
42
54
 
43
- model[label: link.text, description: "#{description.text}.", uri:]
55
+ model[label: item.text, description: "#{description.text}.", uri:]
56
+ end
57
+
58
+ def build_reference_record elements
59
+ item = elements.shift
60
+ path = item.attribute("href").text
61
+ uri = %(#{settings.htmx_site_uri}#{path})
62
+ description = elements.map(&:text).join.strip.delete_prefix("- ").capitalize
63
+
64
+ model[label: item.text, description: "#{description}.", uri:]
44
65
  end
45
66
  end
46
67
  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 = "21.0.0"
5
+ spec.version = "21.1.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/pennyworth"
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_dependency "cogger", "~> 2.3"
28
28
  spec.add_dependency "containable", "~> 2.3"
29
- spec.add_dependency "core", "~> 3.0"
29
+ spec.add_dependency "core", "~> 3.4"
30
30
  spec.add_dependency "etcher", "~> 4.3"
31
31
  spec.add_dependency "ghub", "~> 2.0"
32
32
  spec.add_dependency "http", "~> 6.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: 21.0.0
4
+ version: 21.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -69,14 +69,14 @@ dependencies:
69
69
  requirements:
70
70
  - - "~>"
71
71
  - !ruby/object:Gem::Version
72
- version: '3.0'
72
+ version: '3.4'
73
73
  type: :runtime
74
74
  prerelease: false
75
75
  version_requirements: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
- version: '3.0'
79
+ version: '3.4'
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: etcher
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -336,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
336
336
  - !ruby/object:Gem::Version
337
337
  version: '0'
338
338
  requirements: []
339
- rubygems_version: 4.0.18
339
+ rubygems_version: 4.0.20
340
340
  specification_version: 4
341
341
  summary: A command line interface for augmented Alfred workflows.
342
342
  test_files: []
metadata.gz.sig CHANGED
Binary file