Project

macos-tags

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby interface to get macos Finder tags
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0

Runtime

 Project Readme

macos-tags

Port of dmkskn/macos-tags to Ruby

Installation

Add this line to your application's Gemfile:

gem 'macos-tags'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install macos-tags

Usage

require 'macos-tags'

Get all tags

MacosTags.all_tags
=> [
  #<struct MacosTags::Tag label="Urgent", color=#<MacosTags::Color @name="yellow" @value=5>>,
]

Find files by tag

> MacosTags.find_files(tag: "Urgent")
=> [
  "files"...
]

Count files by tag

> MacosTags.count(tag: "Urgent")
=> 22

List tags on the file

MacosTags.tags(file: "/Users/me/Documents/note.txt")
=>
[
  #<struct MacosTags::Tag label="Urgent", color=#<MacosTags::Color @name="red" @value=6>>,
  #<struct MacosTags::Tag label="Important", color=#<MacosTags::Color @name="yellow" @value=5>>
]

TODOs

  • Enable it to add tags
  • Enable it to remove tags

Development

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.

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.

Release Steps

  1. Bump MacosTags::VERSION && git commit -m "Bump version"
  2. git tag <new version>
  3. git push origin --tags && git push origin main
  4. bundle exec rake build
  5. bundle exec rake release

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/tomoya55/macos-tags.