hiiro 0.1.14 → 0.1.15
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 +4 -4
- data/bin/h-link +28 -8
- data/lib/hiiro/version.rb +1 -1
- data/links.backup.yml +13 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1976453cdeb8c87f0abb85e7fc0061f7809ea40dfd23f5737838c9ef2352128d
|
|
4
|
+
data.tar.gz: 98521457732fceb0b2b33d816c5f53ecceac9f250a235e5c16d8d43f780466f7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97f152f96b8a4af4f0b956f21dd5a6d9232f5bf3f3aa3093cdaef897914b9379b9e5e754a87cb1a274ab27ecc7bd6cd2a03843b547ffc6a96ea6acaffbfbff35
|
|
7
|
+
data.tar.gz: 6668446ba8ec596bd7ad163d7519ab90181c1af5632b335090b79bc438787153b43ebbf419324890c6e9caa6bdedc0e63cbddc59b687ef829f61605d9e79054f
|
data/bin/h-link
CHANGED
|
@@ -51,6 +51,16 @@ def link_matches?(link, *args)
|
|
|
51
51
|
terms.all? { |term| searchable.include?(term) }
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
+
def load_link_hash(links=nil)
|
|
55
|
+
links ||= load_links
|
|
56
|
+
|
|
57
|
+
links.each_with_index.each_with_object({}) do |(link, idx), h|
|
|
58
|
+
num = (idx + 1).to_s.rjust(3)
|
|
59
|
+
desc = link['description'].to_s.empty? ? "" : " - #{link['description']}"
|
|
60
|
+
h["#{num}. #{link['url']}#{desc}"] = link
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
54
64
|
def load_links
|
|
55
65
|
ensure_links_file
|
|
56
66
|
YAML.load_file(LINKS_FILE) || []
|
|
@@ -162,16 +172,13 @@ end
|
|
|
162
172
|
|
|
163
173
|
o.add_subcmd(:select) do |*args|
|
|
164
174
|
links = load_links
|
|
175
|
+
|
|
165
176
|
if links.empty?
|
|
166
177
|
STDERR.puts "No links saved."
|
|
167
178
|
exit 1
|
|
168
179
|
end
|
|
169
180
|
|
|
170
|
-
lines = links
|
|
171
|
-
num = (idx + 1).to_s.rjust(3)
|
|
172
|
-
desc = link['description'].to_s.empty? ? "" : " - #{link['description']}"
|
|
173
|
-
h["#{num}. #{link['url']}#{desc}"] = link
|
|
174
|
-
end
|
|
181
|
+
lines = load_link_hash(links)
|
|
175
182
|
|
|
176
183
|
if args.any?
|
|
177
184
|
lines = hash_matches?(lines, *args)
|
|
@@ -222,12 +229,25 @@ o.add_subcmd(:edit) do |*args|
|
|
|
222
229
|
end
|
|
223
230
|
|
|
224
231
|
o.add_subcmd(:open) do |*args|
|
|
232
|
+
links = load_links
|
|
233
|
+
|
|
225
234
|
if args.empty?
|
|
226
|
-
|
|
227
|
-
|
|
235
|
+
lines = load_link_hash(links)
|
|
236
|
+
|
|
237
|
+
if args.any?
|
|
238
|
+
lines = hash_matches?(lines, *args)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
require 'open3'
|
|
242
|
+
selected, status = Open3.capture2('sk', stdin_data: lines.keys.join("\n"))
|
|
243
|
+
|
|
244
|
+
if status.success? && !selected.strip.empty?
|
|
245
|
+
if selected =~ /^\s*(\d+)\.\s+(\S+)/
|
|
246
|
+
system('open', $2)
|
|
247
|
+
end
|
|
248
|
+
end
|
|
228
249
|
end
|
|
229
250
|
|
|
230
|
-
links = load_links
|
|
231
251
|
idx, link = find_link_by_ref(args.first, links)
|
|
232
252
|
|
|
233
253
|
if link.nil?
|
data/lib/hiiro/version.rb
CHANGED
data/links.backup.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
- url: http://auth.unixsuperhero.com:9969
|
|
3
|
+
description: stash
|
|
4
|
+
shorthand: fap
|
|
5
|
+
created_at: '2026-01-27T00:58:36-05:00'
|
|
6
|
+
- url: http://auth.unixsuperhero.com:8012
|
|
7
|
+
description: utorrent
|
|
8
|
+
shorthand: utor
|
|
9
|
+
created_at: '2026-01-27T22:10:55-05:00'
|
|
10
|
+
- url: http://auth.unixsuperhero.com:3005
|
|
11
|
+
description: sandbox nas
|
|
12
|
+
shorthand: sandbox
|
|
13
|
+
created_at: '2026-01-27T22:12:16-05:00'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hiiro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
@@ -62,6 +62,7 @@ files:
|
|
|
62
62
|
- hiiro.gemspec
|
|
63
63
|
- lib/hiiro.rb
|
|
64
64
|
- lib/hiiro/version.rb
|
|
65
|
+
- links.backup.yml
|
|
65
66
|
- plugins/notify.rb
|
|
66
67
|
- plugins/pins.rb
|
|
67
68
|
- plugins/project.rb
|