Tagen, a core and extra extension to Ruby library.

Homepage: https://github.com/GutenLinux/tagen
Author: Guten
Contributors: See Contributors section below
License: MIT License
Documentation: http://rubydoc.info/gems/tagen/frames
Issue Tracker: https://github.com/GutenLinux/tagen/issues


Ruby has an 'Open Class' feature, so we can extend any class by ourself.

This library provides some usefull Ruby core extension. some comes from ActiveSupport. ActiveSupport is mainly target to Rails, but tagen is target to generic ruby development, and tagen is smaller. It is a colletion of most common core,extra extensions.

not support ruby1.8, win32

This library comes with a path lib named Pa and a string format lib named PyFormat.


use core extension

require "tagen/core"

then we have String#blank? method, for a list of core extensions, see docs/CoreExtensions.

use extra extension

require "pathname"
require "tagen/pathname"


require "tagen/pathname" # auto require "pathname"

this will add #path method to Pathname, see API doc.

An Introduction to Pa

require "tagen/core"
pa = Pa('/home/foo')
pa.exists? #=> false
pa.dir #=> '/home'
pa.base #=> 'foo'
pa.join('a.ogg') #=> '/home/a.ogg'
pa.join(a.ogg).exists? #=> true.

Pa.exists?('/home/foo') # alternate way

which rspec

Pa('/home/foo').should be_exists

more see API doc

An Introduction to PyFormat

require "tagen/core"
"I like %{fruit} and %{sport}".format('apple', 'football') 
"I like %{fruit} and %{sport}".format(apple: 'apple', footbal: 'football') 

"it costs %{howmatch:.2f} dollars".format(1.123) #=> "it costs 1.12 dollars"

more see API doc



gem install tagen


  • report bugs/featues to issue tracker.
  • fork it and pull a request.
  • improve documentation.
  • any ideas are welcome.



Copyright © 2011 by Guten. this library released under MIT-License, See LICENSE for futher details.