RubyGems Navigation menu

chunker 0.1.53

Ruby provides an automatic constant called DATA, which is an IO object that references all text in the current file under an __END__ token. I find it convenient to use the __END__ area to store all sorts of stuff, rather than have to worry about distributing separate files. The DATA constant is determined from whatever ruby believes $0 to be. It doesn't work inside of other required libraries, so you'll see stuff like this all the time: END = File.open( __FILE__ ).read.split( /^__END__/, 2 ).last It works, but it's more work than I want to do. Chunker solves this by parsing __END__ tokens for you, and making it available in the form of a 'DATA_END' constant. It installs this constant into the class that includes Chunker, so you can use it again and again, assuming you use a different file for each class. It also automatically parses out other things that look like tokens, so you can easily have multiple, distinct documents all embedded into the __END__ block.

Gemfile:
= クリップボードにコピー コピー完了!

インストール:
=

バージョン履歴:

  1. 1.0.0 - January 22, 2011 (8KB)
  2. 0.1.53 - November 10, 2008* (8KB)

所有者:

作者:

  • Mahlon E. Smith

SHA 256チェックサム:

68f86d9e8125349ccabedeec44f91ef03d261541e53d43c11f5e7d4c792cb02b

累計ダウンロード数 9,699

このバージョンのみ 4,319

ライセンス:

N/A

必要なRubyのバージョン: なし

リンク: