macos-tags 0.1.0 → 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/CHANGELOG.md +7 -0
- data/README.md +8 -1
- data/lib/macos-tags.rb +4 -2
- data/lib/macos-tags/version.rb +1 -1
- data/tests/test_macos_tags.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e47fb26f220e9d54bac48836c66eaba9407be443adaa28ba89cc5be2e24056d
|
4
|
+
data.tar.gz: 2b812d5151cc5da520d8283b52615efb909b52466d0b10329f403022d6ac8e11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb200e699d05ea397e7269082f8a42bf4545c0917e5947f485fbcdb936270f7a1f73f653836bb92ed368dc7c7db48dc3c919636a72a99ca1b9bf3c6db81b118d
|
7
|
+
data.tar.gz: d5147776d7f28a81f80c40b29b3b64561d540fab5b9a873c5760ddc4a645427ebfbac257b5d235c5fc865eb7d99c94cf05301ec8eb5db1f715c75487c21c4b41
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -76,7 +76,14 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
76
76
|
|
77
77
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
78
78
|
|
79
|
+
## Release Steps
|
80
|
+
|
81
|
+
1. Bump `MacosTags::VERSION` && `git commit -m "Bump version"`
|
82
|
+
2. `git tag <new version>`
|
83
|
+
3. `git push origin --tags`
|
84
|
+
4. bundle exec rake build
|
85
|
+
5. bundle exec rake release
|
86
|
+
|
79
87
|
## Contributing
|
80
88
|
|
81
89
|
Bug reports and pull requests are welcome on GitHub at https://github.com/tomoya55/macos-tags.
|
82
|
-
|
data/lib/macos-tags.rb
CHANGED
@@ -120,7 +120,7 @@ module MacosTags
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def tags
|
123
|
-
parse_raw_tags
|
123
|
+
(parse_raw_tags&.value || []).map do |raw_tag|
|
124
124
|
label, color_val = raw_tag.value.split("\n")
|
125
125
|
Tag.new(label: label, color: Color.new(color_val.to_i))
|
126
126
|
end
|
@@ -129,7 +129,9 @@ module MacosTags
|
|
129
129
|
private
|
130
130
|
|
131
131
|
def parse_raw_tags
|
132
|
-
|
132
|
+
if xattr[XATTR_TAGS]
|
133
|
+
plist.load_binary_str(xattr[XATTR_TAGS])
|
134
|
+
end
|
133
135
|
end
|
134
136
|
end
|
135
137
|
end
|
data/lib/macos-tags/version.rb
CHANGED
data/tests/test_macos_tags.rb
CHANGED
@@ -6,4 +6,12 @@ describe MacosTags do
|
|
6
6
|
_(MacosTags.all_tags).must_be_kind_of(Array)
|
7
7
|
end
|
8
8
|
end
|
9
|
+
|
10
|
+
describe MacosTags::TagParser do
|
11
|
+
it "must returns empty list if no tags are found" do
|
12
|
+
Tempfile.create('tag_parser_test', '/tmp') do |f|
|
13
|
+
_(MacosTags::TagParser.new(f).tags).must_equal([])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
9
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macos-tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomoya Hirano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi-xattr
|