Module: MacosTags

Defined in:
lib/macos-tags.rb,
lib/macos-tags/version.rb

Defined Under Namespace

Classes: Color, FinderPlist, Mdfinder, Tag, TagParser

Constant Summary collapse

XATTR_TAGS =
"com.apple.metadata:_kMDItemUserTags"
XATTR_FINDER_INFO =
"com.apple.FinderInfo"
ALL_TAGS_PLIST_PATH =
"#{Dir.home}/Library/SyncedPreferences/com.apple.finder.plist"
VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.all_tagsObject



33
34
35
# File 'lib/macos-tags.rb', line 33

def all_tags
  FinderPlist.new.tags
end

.count(tag:) ⇒ Object



43
44
45
# File 'lib/macos-tags.rb', line 43

def count(tag:)
  Mdfinder.count(tag_name: tag)
end

.find_files(tag:) ⇒ Object



38
39
40
# File 'lib/macos-tags.rb', line 38

def find_files(tag:)
  Mdfinder.find_files(tag_name: tag)
end

.tags(file:) ⇒ Object



48
49
50
# File 'lib/macos-tags.rb', line 48

def tags(file:)
  TagParser.new(file).tags
end