Sha256: e07392a3af692320662e879b247cdfd18cff2f3febf7fa310ff3f8ca4b9a64cc

Contents?: true

Size: 1011 Bytes

Versions: 1

Compression:

Stored size: 1011 Bytes

Contents

# Taglob is great. Check this out.
# Imagine a bunch of files that look like
#  #tags: zomg,buttz,foo,important
#  class Lol
#    def lulz
#      puts "here are your lulz, sir"
#    end
#  end
#
# And then you are like dang I wish I could glob these files based on the
# tags I setup! What am I doing with my life???
# Taglob! (like Tada! but more like its unsophisticated country cousin(in name only(parentheses)))
#  Dir.taglob("**/*.rb","foo","lol")
# That will totally give you back all the files tagged with 'foo' and 'lol' in an array of strings representing the paths of those files.
# It is really just glob with some extra stuff thrown in.
# Totally small, totally useless, totally taglob.

require 'taglob/extensions'

module Taglob
  VERSION = '1.1.0'
  
  def self.invalid_tags(pattern,valid_tags)
    invalids = {}
    Dir.tags(pattern).each do |file, tags|
      invalid_tags = tags - valid_tags
      invalids.merge!({file => invalid_tags}) if !invalid_tags.empty?
    end
    invalids
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scudco-taglob-1.1.0 lib/taglob.rb