Fork me on GitHub

taglob by scudco

tags + Dir.glob = Dir.taglob!

Features

Synopsis

Taglob is great. Check this out. Imagine a bunch of files that look like
1 #tags: zomg,buttz,foo,important
2 class Lol
3   def lulz
4     puts "here are your lulz, sir"
5   end
6 end
1 #tags: zomg,buttz,foo,important
2 class Lol
3   def lulz
4     puts "here are your lulz, sir"
5   end
6 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.

1 require 'rubygems'
2 require 'taglob'
3 
4 Dir.taglob('**/*.rb','foo','bar','buttz').each do |file|
5   puts "#{file} was tagged with foo or bar or buttz!"
6 end
On a more serious note:

Installation

sudo gem install taglob

License

The copyrights-are-an-imaginary-construct license.

Authors

Adam Anderson (adamandersonis@gmail.com)

Contact

Adam Anderson (adamandersonis@gmail.com)

Download

You can download this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://github.com/scudco/taglob