Changeset 62a5ac525ce8
- Timestamp:
- 01/22/11 01:54:06 (16 months ago)
- Branch:
- ruby-modules
- Tags:
- chunker-1.0.0
- Files:
-
- 3 edited
-
.hgignore (modified) (1 diff)
-
chunker/LICENSE (modified) (1 diff)
-
chunker/Rakefile (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
.hgignore
r4 r6 1 ^chunker/ pkg1 ^chunker/(pkg|tags) -
chunker/LICENSE
r2 r6 1 Copyright (c) 2008 , Mahlon E. Smith1 Copyright (c) 2008-2011, Mahlon E. Smith <mahlon@martini.nu> 2 2 3 3 All rights reserved. -
chunker/Rakefile
r4 r6 66 66 # task :default => [ :test, :package ] 67 67 68 69 ### Tasks: testing via rspec 70 ### 68 71 namespace :test do 69 72 desc 'Generate verbose and pretty output' … … 79 82 end 80 83 end 84 81 85 82 86 ### Task: generate ctags … … 99 103 gem.homepage = 'http://projects.martini.nu/ruby-modules/wiki/Chunker' 100 104 gem.has_rdoc = true 105 gem.extra_rdoc_files = ['README'] 106 gem.rdoc_options << '--main' << 'README' 107 101 108 102 109 gem.files = RELEASE_FILES. … … 105 112 collect {|f| f.relative_path_from(BASEDIR).to_s } 106 113 107 gem.description = <<-EOF 108 Ruby provides an automatic constant called DATA, which is an IO object 109 that references all text in the current file under an __END__ token. 110 111 I find it convenient to use the __END__ area to store all sorts of 112 stuff, rather than have to worry about distributing separate files. 113 114 The DATA constant is determined from whatever ruby believes $0 to be. 115 It doesn't work inside of other required libraries, so you'll see stuff 116 like this all the time: 117 118 END = File.open( __FILE__ ).read.split( /^__END__/, 2 ).last 119 120 It works, but it's more work than I want to do. 121 122 Chunker solves this by parsing __END__ tokens for you, and making it 123 available in the form of a 'DATA_END' constant. It installs this 124 constant into the class that includes Chunker, so you can use it again 125 and again, assuming you use a different file for each class. 126 127 It also automatically parses out other things that look like tokens, so 128 you can easily have multiple, distinct documents all embedded into the 129 __END__ block. 130 EOF 114 gem.description = "Embed arbitrary data and multiple, distinct documents within ruby files." 131 115 end 132 116
Note: See TracChangeset
for help on using the changeset viewer.
