hiiro 0.1.325 → 0.1.326
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/CHANGELOG.md +10 -0
- data/bin/h-link +12 -9
- data/lib/hiiro/link.rb +1 -1
- data/lib/hiiro/tags.rb +10 -6
- data/lib/hiiro/version.rb +1 -1
- data/script/diffhome +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: acf7feb7716ca414320b397f174da8900420b44a005c1706428d98a0d839d8f9
|
|
4
|
+
data.tar.gz: a8ae169306f3f4f4f9a9fc43515295630c2a67b473c647f629dc8c8e9ff87e9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee6beda16bbe31211d4a18ab9e02a60122af892dd79d56575015dffbebe7a536a089bf698dc000822c6f27b8cc2dcfbb1b5a6cd9d18f75366a5c04d822c3dab4
|
|
7
|
+
data.tar.gz: 641a52fea2ff6721f4364bc8e9f03788041149c3f714861e558acb659ca0fa380eefc09046199ad9a0b69fc8423b99137bf4bcc9ee258df3982b2ed9ae5b4b86
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.326] - 2026-04-02
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Improve tag display formatting in link output by mapping individual tags to colored badges
|
|
7
|
+
- Refactor `h link tags` filtering logic to use `Hiiro::Tag` helpers for cleaner code
|
|
8
|
+
- Relocate `taggable` accessor method in `Hiiro::Tag` model
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `Hiiro::Tag.tagged_by_type` helper method to query tagged objects by tag name and type
|
|
12
|
+
|
|
3
13
|
## [0.1.325] - 2026-04-02
|
|
4
14
|
|
|
5
15
|
### Fixed
|
data/bin/h-link
CHANGED
|
@@ -529,17 +529,20 @@ Hiiro.run(*ARGV, plugins: [Pins], links_file: lm.links_file) do
|
|
|
529
529
|
|
|
530
530
|
add_subcmd(:tags) do |*tag_args|
|
|
531
531
|
all_known = Hiiro::Tag.tags_by_type('Link')
|
|
532
|
-
filtered = all_known.select{|t|
|
|
533
|
-
tag_args.any?{|ta| t.start_with?(ta) }
|
|
534
|
-
}
|
|
535
532
|
|
|
536
|
-
if
|
|
537
|
-
|
|
533
|
+
if tag_args.empty?
|
|
534
|
+
all_known.map do |tag|
|
|
535
|
+
links = Hiiro::Tag.tagged_by_type(tag, 'Link')
|
|
536
|
+
puts "#{tag_name}:"
|
|
537
|
+
links.each { |link| puts " #{link.display_string(exclude_tags: [tag_name])}" }
|
|
538
|
+
end
|
|
538
539
|
else
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
540
|
+
all_known.select{ |tag|
|
|
541
|
+
tag_args.any?{ |arg|
|
|
542
|
+
tag.start_with?(arg)
|
|
543
|
+
}
|
|
544
|
+
}.map do |tag|
|
|
545
|
+
links = Hiiro::Tag.tagged_by_type(tag_name, 'Link')
|
|
543
546
|
puts "#{tag_name}:"
|
|
544
547
|
links.each { |link| puts " #{link.display_string(exclude_tags: [tag_name])}" }
|
|
545
548
|
end
|
data/lib/hiiro/link.rb
CHANGED
|
@@ -45,7 +45,7 @@ class Hiiro
|
|
|
45
45
|
shorthand_str = shorthand ? " [#{shorthand}]" : ""
|
|
46
46
|
desc_str = description.to_s.empty? ? "" : " - #{description}"
|
|
47
47
|
link_tags = tags - Array(exclude_tags)
|
|
48
|
-
tags_str = link_tags.any? ? " \e[30;104m#{
|
|
48
|
+
tags_str = link_tags.any? ? " " + link_tags.map { |t| "\e[30;104m#{t}\e[0m" }.join(' ') : ""
|
|
49
49
|
"#{num}#{shorthand_str} #{url}#{desc_str}#{tags_str}".strip
|
|
50
50
|
end
|
|
51
51
|
|
data/lib/hiiro/tags.rb
CHANGED
|
@@ -15,12 +15,6 @@ class Hiiro
|
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
# Polymorphic accessor — returns the tagged object
|
|
19
|
-
def taggable
|
|
20
|
-
klass = Hiiro.const_get(taggable_type) rescue nil
|
|
21
|
-
klass&.[](taggable_id)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
18
|
# Returns all Tag rows for a given object
|
|
25
19
|
def self.tags_by_type(type)
|
|
26
20
|
where(taggable_type: type.to_s).select(:name).distinct.map(&:name).sort
|
|
@@ -37,6 +31,10 @@ class Hiiro
|
|
|
37
31
|
where(name: tag_name.to_s)
|
|
38
32
|
end
|
|
39
33
|
|
|
34
|
+
def tagged_by_type(tag, type)
|
|
35
|
+
where(name: tag, taggable_type: type).map(&:taggable)
|
|
36
|
+
end
|
|
37
|
+
|
|
40
38
|
# Returns all tagged objects across all types for a tag name
|
|
41
39
|
def self.everything_tagged(tag_name)
|
|
42
40
|
named(tag_name).map(&:taggable).compact
|
|
@@ -65,6 +63,12 @@ class Hiiro
|
|
|
65
63
|
end
|
|
66
64
|
end
|
|
67
65
|
|
|
66
|
+
# Polymorphic accessor — returns the tagged object
|
|
67
|
+
def taggable
|
|
68
|
+
klass = Hiiro.const_get(taggable_type) rescue nil
|
|
69
|
+
klass&.[](taggable_id)
|
|
70
|
+
end
|
|
71
|
+
|
|
68
72
|
# Shared tag store, keyed by namespace (e.g. :branch, :task).
|
|
69
73
|
# Delegates to Hiiro::Tag internally; maintains tags.yml as a backup.
|
|
70
74
|
class Tags
|
data/lib/hiiro/version.rb
CHANGED
data/script/diffhome
CHANGED