oktags 0.1.3 → 0.2.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 +4 -4
- data/lib/ok/tags.rb +9 -1
- data/lib/ok/version.rb +1 -1
- 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: 064d3e1decf8e198564e3ea03bfa9ffef9b6982a7aa4626984ecd7390a4ecc7f
|
4
|
+
data.tar.gz: bd34c659eb79cc5c9f27245f85390baf2cafdb6c8096d01778e83eaaaaa3a6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a0305539aff833792c1d76ba98acdba725115c0dad65438476d12a6ac83ae425cc2e3c4feac123f830ddc95e4156feadbca9a3ac7fc3db72d8d0f9e0660116e
|
7
|
+
data.tar.gz: 83d1259fc52913ea08a3fbcfd9c688da832bd0f5c42be2e2b346b0955f146391211405eeb0b1bdf6d572bc5244136bc5b5be9a68c91ca5fadca026638626f54d
|
data/lib/ok/tags.rb
CHANGED
@@ -67,7 +67,15 @@ module OK
|
|
67
67
|
end
|
68
68
|
|
69
69
|
tags = find_tags_for(file)
|
70
|
-
tags <<
|
70
|
+
tags <<
|
71
|
+
new_tags.split(',')&.map(&:strip)&.map(&:downcase)&.map do |t|
|
72
|
+
# Replace spaces in tags with underscores, because spaces in
|
73
|
+
# filenames can cause all kinds of issues depending on what
|
74
|
+
# tools are used on the filenames. The less requirements for
|
75
|
+
# escaping filenames, the better.
|
76
|
+
t.gsub(' ', '_')
|
77
|
+
end
|
78
|
+
|
71
79
|
tags = tags.flatten.uniq.sort
|
72
80
|
|
73
81
|
new_filename = filename_with_tags(file, tags)
|
data/lib/ok/version.rb
CHANGED