finder_tags 0.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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +8 -0
- data/.travis.yml +22 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +80 -0
- data/Guardfile +70 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/finder_tags.gemspec +42 -0
- data/lib/finder_tags.rb +94 -0
- data/lib/finder_tags/titlecase.rb +9 -0
- data/lib/finder_tags/version.rb +3 -0
- metadata +160 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 44ce9becb747591e2f64619d2c40e5d0eb8bd30dea08b27c5d7e606e889b2a3f
|
|
4
|
+
data.tar.gz: 4883c829448b57244afc7c4581811ea617c16ff53f5c4495af9600c7a5abcf0d
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 2916bc18d40601f8f507945429a78191294bff24f71c7f51f997bd6a7de5d8455de95b90d501c0e8231db20d091171a22087fa8db060beaeaecd5bc38a070ab6
|
|
7
|
+
data.tar.gz: cd60db529a3a04a6f2be58f4a438ad0cebd002e0fb4fa8ee6d3ceab298e3d848f18428fe7133ed3da0357d99524d67fd25cdd2c59656f515f853acaec95c9f6a
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
sudo: false
|
|
2
|
+
language: ruby
|
|
3
|
+
cache: bundler
|
|
4
|
+
rvm:
|
|
5
|
+
- "2.6"
|
|
6
|
+
- "2.7"
|
|
7
|
+
|
|
8
|
+
before_install: gem install bundler -v 2.0.2
|
|
9
|
+
|
|
10
|
+
script:
|
|
11
|
+
- bundle exec rspec
|
|
12
|
+
|
|
13
|
+
deploy:
|
|
14
|
+
provider: rubygems
|
|
15
|
+
api_key:
|
|
16
|
+
secure: jv8chtPWSI+YvvKR+LWcrIKVbfx3C+Txj5Zx1yO0armgjneAiLZLlwHd6fdRb1s0KVTxqreN1CVYbgTbiKY7DKlEDJNEnFeCv3gbrcDyezuDyhK1Lxdi9OVuU5UUQCEJ8axF7A7tva8QPW1L+4vD6C68rPjSUhR/nycftHOMs/QCGWjBnVI69rmPuLzUIk/acFFodRL8b3TzbpKQZKD6W9tGYEiF4GGgFZHxaBaHx3rDPpe3EBU3qvE3Rz8qVPRxaL6d1RzXCMlqlNMZqscVvRAo/ZWfvuZ6OTiU4NzJ5+7mhLEKcTX1/USNuuC+Xp5IDDFckmGobrFhXNgSqGcg8bTjTOc/ZD1Nce4r+ctPNi7zXEkDehYEKw5b5SaiSzhJcXlzEQt5Y5+ZpKj3SxpihswtRK8IxBReLSUygXrjxzwbW3PQa52xcdoJ9VSIpmcnecdjObhwDMrh7mnAiWUmKUi+j0MbORfRuDfyBlG+y5fh42cocNvF3ylzZaLwkufR/umULsM/qVO8JFCT1kJ68uxXGai1jOM1qLoSFz5nsO5TwHyFEESfEAGDA0BQ71YUU5aywb2Jh0rIONjWtrA9ritFZJoLbifJ6uFfOx5WmOLzMnHKhXta+A8ndJbi3/wWYBNs9degrWF6vNVfygepqD/ycloveEL5yuAjEouSbic=
|
|
17
|
+
gem: finder_tags
|
|
18
|
+
on:
|
|
19
|
+
rvm: "2.7"
|
|
20
|
+
tags: true
|
|
21
|
+
repo: telyn/finder_tags
|
|
22
|
+
skip_cleanup: 'true'
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
finder_tags (0.1.0)
|
|
5
|
+
binary_plist-parser (~> 0.1.0)
|
|
6
|
+
ffi-xattr (~> 0.1.2)
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
binary_plist-parser (0.1.0)
|
|
12
|
+
coderay (1.1.3)
|
|
13
|
+
diff-lcs (1.3)
|
|
14
|
+
ffi (1.13.1)
|
|
15
|
+
ffi-xattr (0.1.2)
|
|
16
|
+
ffi
|
|
17
|
+
formatador (0.2.5)
|
|
18
|
+
fuubar (2.5.0)
|
|
19
|
+
rspec-core (~> 3.0)
|
|
20
|
+
ruby-progressbar (~> 1.4)
|
|
21
|
+
guard (2.16.2)
|
|
22
|
+
formatador (>= 0.2.4)
|
|
23
|
+
listen (>= 2.7, < 4.0)
|
|
24
|
+
lumberjack (>= 1.0.12, < 2.0)
|
|
25
|
+
nenv (~> 0.1)
|
|
26
|
+
notiffany (~> 0.0)
|
|
27
|
+
pry (>= 0.9.12)
|
|
28
|
+
shellany (~> 0.0)
|
|
29
|
+
thor (>= 0.18.1)
|
|
30
|
+
guard-compat (1.2.1)
|
|
31
|
+
guard-rspec (4.7.3)
|
|
32
|
+
guard (~> 2.1)
|
|
33
|
+
guard-compat (~> 1.1)
|
|
34
|
+
rspec (>= 2.99.0, < 4.0)
|
|
35
|
+
listen (3.2.1)
|
|
36
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
37
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
|
38
|
+
lumberjack (1.2.5)
|
|
39
|
+
method_source (1.0.0)
|
|
40
|
+
nenv (0.3.0)
|
|
41
|
+
notiffany (0.1.3)
|
|
42
|
+
nenv (~> 0.1)
|
|
43
|
+
shellany (~> 0.0)
|
|
44
|
+
pry (0.13.1)
|
|
45
|
+
coderay (~> 1.1)
|
|
46
|
+
method_source (~> 1.0)
|
|
47
|
+
rake (10.5.0)
|
|
48
|
+
rb-fsevent (0.10.4)
|
|
49
|
+
rb-inotify (0.10.1)
|
|
50
|
+
ffi (~> 1.0)
|
|
51
|
+
rspec (3.9.0)
|
|
52
|
+
rspec-core (~> 3.9.0)
|
|
53
|
+
rspec-expectations (~> 3.9.0)
|
|
54
|
+
rspec-mocks (~> 3.9.0)
|
|
55
|
+
rspec-core (3.9.2)
|
|
56
|
+
rspec-support (~> 3.9.3)
|
|
57
|
+
rspec-expectations (3.9.2)
|
|
58
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
59
|
+
rspec-support (~> 3.9.0)
|
|
60
|
+
rspec-mocks (3.9.1)
|
|
61
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
62
|
+
rspec-support (~> 3.9.0)
|
|
63
|
+
rspec-support (3.9.3)
|
|
64
|
+
ruby-progressbar (1.10.1)
|
|
65
|
+
shellany (0.0.1)
|
|
66
|
+
thor (1.0.1)
|
|
67
|
+
|
|
68
|
+
PLATFORMS
|
|
69
|
+
ruby
|
|
70
|
+
|
|
71
|
+
DEPENDENCIES
|
|
72
|
+
bundler (~> 2.0)
|
|
73
|
+
finder_tags!
|
|
74
|
+
fuubar (~> 2.5)
|
|
75
|
+
guard-rspec (~> 4.7)
|
|
76
|
+
rake (~> 10.0)
|
|
77
|
+
rspec (~> 3.0)
|
|
78
|
+
|
|
79
|
+
BUNDLED WITH
|
|
80
|
+
2.0.2
|
data/Guardfile
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# A sample Guardfile
|
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
|
3
|
+
|
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
|
5
|
+
# directories %w(app lib config test spec features) \
|
|
6
|
+
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
|
7
|
+
|
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
|
11
|
+
#
|
|
12
|
+
# $ mkdir config
|
|
13
|
+
# $ mv Guardfile config/
|
|
14
|
+
# $ ln -s config/Guardfile .
|
|
15
|
+
#
|
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
|
17
|
+
|
|
18
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
|
19
|
+
# rspec may be run, below are examples of the most common uses.
|
|
20
|
+
# * bundler: 'bundle exec rspec'
|
|
21
|
+
# * bundler binstubs: 'bin/rspec'
|
|
22
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
|
23
|
+
# installed the spring binstubs per the docs)
|
|
24
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
|
25
|
+
# * 'just' rspec: 'rspec'
|
|
26
|
+
|
|
27
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
|
28
|
+
require "guard/rspec/dsl"
|
|
29
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
|
30
|
+
|
|
31
|
+
# Feel free to open issues for suggestions and improvements
|
|
32
|
+
|
|
33
|
+
# RSpec files
|
|
34
|
+
rspec = dsl.rspec
|
|
35
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
|
36
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
|
37
|
+
watch(rspec.spec_files)
|
|
38
|
+
|
|
39
|
+
# Ruby files
|
|
40
|
+
ruby = dsl.ruby
|
|
41
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
|
42
|
+
|
|
43
|
+
# Rails files
|
|
44
|
+
rails = dsl.rails(view_extensions: %w(erb haml slim))
|
|
45
|
+
dsl.watch_spec_files_for(rails.app_files)
|
|
46
|
+
dsl.watch_spec_files_for(rails.views)
|
|
47
|
+
|
|
48
|
+
watch(rails.controllers) do |m|
|
|
49
|
+
[
|
|
50
|
+
rspec.spec.call("routing/#{m[1]}_routing"),
|
|
51
|
+
rspec.spec.call("controllers/#{m[1]}_controller"),
|
|
52
|
+
rspec.spec.call("acceptance/#{m[1]}")
|
|
53
|
+
]
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Rails config changes
|
|
57
|
+
watch(rails.spec_helper) { rspec.spec_dir }
|
|
58
|
+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
|
59
|
+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
|
60
|
+
|
|
61
|
+
# Capybara features specs
|
|
62
|
+
watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
|
|
63
|
+
watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
|
|
64
|
+
|
|
65
|
+
# Turnip features and steps
|
|
66
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
|
67
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
|
68
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
|
69
|
+
end
|
|
70
|
+
end
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Telyn Z.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# FinderTags
|
|
2
|
+
|
|
3
|
+
Library and utilities for dealing with tags from Finder.
|
|
4
|
+
They should run on any OS where
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Add this line to your application's Gemfile:
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
gem 'finder_tags'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
And then execute:
|
|
15
|
+
|
|
16
|
+
$ bundle
|
|
17
|
+
|
|
18
|
+
Or install it yourself as:
|
|
19
|
+
|
|
20
|
+
$ gem install finder_tags
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
require "finder_tags"
|
|
26
|
+
|
|
27
|
+
FinderTags.new("path/to/file").tags
|
|
28
|
+
# => [#<struct FinderTags::Tag name="Cool Tag", color=:blue>]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Development
|
|
32
|
+
|
|
33
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
34
|
+
|
|
35
|
+
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).
|
|
36
|
+
|
|
37
|
+
## Contributing
|
|
38
|
+
|
|
39
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/finder_tags.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "finder_tags"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/finder_tags.gemspec
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
require "finder_tags/version"
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |spec|
|
|
8
|
+
spec.name = "finder_tags"
|
|
9
|
+
spec.version = FinderTags::VERSION
|
|
10
|
+
spec.authors = ["Telyn Z."]
|
|
11
|
+
spec.email = ["175827+telyn@users.noreply.github.com"]
|
|
12
|
+
|
|
13
|
+
spec.summary = "Library & utility for reading tags from Finder.app"
|
|
14
|
+
spec.homepage = "https://github.com/telyn/finder_tags"
|
|
15
|
+
spec.license = "MIT"
|
|
16
|
+
|
|
17
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
|
18
|
+
|
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
20
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
|
21
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
|
22
|
+
|
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been
|
|
25
|
+
# added into git.
|
|
26
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
27
|
+
`git ls-files -z`.split("\x0")
|
|
28
|
+
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
29
|
+
end
|
|
30
|
+
spec.bindir = "exe"
|
|
31
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
32
|
+
spec.require_paths = ["lib"]
|
|
33
|
+
|
|
34
|
+
spec.add_dependency "binary_plist-parser", "~> 0.1.0"
|
|
35
|
+
spec.add_dependency "ffi-xattr", "~> 0.1.2"
|
|
36
|
+
|
|
37
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
|
38
|
+
spec.add_development_dependency "fuubar", "~> 2.5"
|
|
39
|
+
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
|
40
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
41
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
42
|
+
end
|
data/lib/finder_tags.rb
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ffi-xattr"
|
|
4
|
+
require "binary_plist/parser/bplist00"
|
|
5
|
+
require "finder_tags/titlecase"
|
|
6
|
+
|
|
7
|
+
using FinderTags::Titlecase
|
|
8
|
+
|
|
9
|
+
class FinderTags
|
|
10
|
+
Tag = Struct.new(:name, :color)
|
|
11
|
+
FINDERINFO_KEY = "com.apple.FinderInfo"
|
|
12
|
+
USERTAGS_KEY = "com.apple.metadata:_kMDItemUserTags"
|
|
13
|
+
TAG_BYTE_OFFSET = 9
|
|
14
|
+
|
|
15
|
+
# i could do something tricksy (color >> 1), but I don't feel like it
|
|
16
|
+
# two arrays of colors is fine by me
|
|
17
|
+
LEGACY_COLORS = %i[
|
|
18
|
+
none none
|
|
19
|
+
grey grey
|
|
20
|
+
green green
|
|
21
|
+
purple purple
|
|
22
|
+
blue blue
|
|
23
|
+
yellow yellow
|
|
24
|
+
red red
|
|
25
|
+
orange orange
|
|
26
|
+
].freeze
|
|
27
|
+
MODERN_COLORS = %i[
|
|
28
|
+
none
|
|
29
|
+
grey
|
|
30
|
+
green
|
|
31
|
+
purple
|
|
32
|
+
blue
|
|
33
|
+
yellow
|
|
34
|
+
red
|
|
35
|
+
orange
|
|
36
|
+
].freeze
|
|
37
|
+
|
|
38
|
+
def initialize(file)
|
|
39
|
+
@file = file
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def tags
|
|
43
|
+
tags = extended_tags
|
|
44
|
+
tags = [legacy_tag] if tags.none? && legacy_tag.color != :none
|
|
45
|
+
tags
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def legacy_tag
|
|
49
|
+
@legacy_tag ||=
|
|
50
|
+
begin
|
|
51
|
+
return Tag.new("None", :none) if tag_byte.nil?
|
|
52
|
+
|
|
53
|
+
color = LEGACY_COLORS[tag_byte.to_i]
|
|
54
|
+
Tag.new(color.to_s.titlecase, color)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def extended_tags
|
|
59
|
+
@extended_tags ||= raw_user_tags.map(&method(:raw_to_tag))
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
private
|
|
63
|
+
|
|
64
|
+
attr_reader :file
|
|
65
|
+
|
|
66
|
+
def tag_byte
|
|
67
|
+
finder_info&.unpack("x9C")&.first
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def finder_info
|
|
71
|
+
xattr[FINDERINFO_KEY]
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def raw_user_tags
|
|
75
|
+
return [] if usertags_xattr.nil?
|
|
76
|
+
|
|
77
|
+
BinaryPList::Parser::BPList00
|
|
78
|
+
.new(StringIO.new(usertags_xattr))
|
|
79
|
+
.parse
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def usertags_xattr
|
|
83
|
+
xattr[USERTAGS_KEY]
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def raw_to_tag(tag)
|
|
87
|
+
name, color = tag.split("\n")
|
|
88
|
+
Tag.new(name, MODERN_COLORS[color.to_i])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def xattr
|
|
92
|
+
@xattr ||= Xattr.new(file)
|
|
93
|
+
end
|
|
94
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: finder_tags
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Telyn Z.
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: binary_plist-parser
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.1.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.1.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: ffi-xattr
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 0.1.2
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 0.1.2
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: bundler
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '2.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '2.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: fuubar
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '2.5'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '2.5'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: guard-rspec
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '4.7'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '4.7'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rake
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '10.0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '10.0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rspec
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '3.0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '3.0'
|
|
111
|
+
description:
|
|
112
|
+
email:
|
|
113
|
+
- 175827+telyn@users.noreply.github.com
|
|
114
|
+
executables: []
|
|
115
|
+
extensions: []
|
|
116
|
+
extra_rdoc_files: []
|
|
117
|
+
files:
|
|
118
|
+
- ".gitignore"
|
|
119
|
+
- ".rspec"
|
|
120
|
+
- ".rubocop.yml"
|
|
121
|
+
- ".travis.yml"
|
|
122
|
+
- Gemfile
|
|
123
|
+
- Gemfile.lock
|
|
124
|
+
- Guardfile
|
|
125
|
+
- LICENSE.txt
|
|
126
|
+
- README.md
|
|
127
|
+
- Rakefile
|
|
128
|
+
- bin/console
|
|
129
|
+
- bin/setup
|
|
130
|
+
- finder_tags.gemspec
|
|
131
|
+
- lib/finder_tags.rb
|
|
132
|
+
- lib/finder_tags/titlecase.rb
|
|
133
|
+
- lib/finder_tags/version.rb
|
|
134
|
+
homepage: https://github.com/telyn/finder_tags
|
|
135
|
+
licenses:
|
|
136
|
+
- MIT
|
|
137
|
+
metadata:
|
|
138
|
+
homepage_uri: https://github.com/telyn/finder_tags
|
|
139
|
+
source_code_uri: https://github.com/telyn/finder_tags
|
|
140
|
+
changelog_uri: https://github.com/telyn/finder_tags/blob/master/CHANGELOG.md
|
|
141
|
+
post_install_message:
|
|
142
|
+
rdoc_options: []
|
|
143
|
+
require_paths:
|
|
144
|
+
- lib
|
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
|
+
requirements:
|
|
147
|
+
- - ">="
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: '0'
|
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
|
+
requirements:
|
|
152
|
+
- - ">="
|
|
153
|
+
- !ruby/object:Gem::Version
|
|
154
|
+
version: '0'
|
|
155
|
+
requirements: []
|
|
156
|
+
rubygems_version: 3.0.4
|
|
157
|
+
signing_key:
|
|
158
|
+
specification_version: 4
|
|
159
|
+
summary: Library & utility for reading tags from Finder.app
|
|
160
|
+
test_files: []
|