ÿØÿà JFIF ÿÛ „ ( %!1!%*+...983,7(-.-
location%3d-i.ri 0000644 00000001472 15234553167 0007451 0 ustar 00 U:RDoc::AnyMethod[iI"location=:ETI"ERB#location=;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"JSets optional filename and line number that will be used in ERB code ;TI"Eevaluation and error reporting. See also #filename= and #lineno=;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"$erb = ERB.new('<%= some_x %>')
;TI"erb.render
;TI"3# undefined local variable or method `some_x'
;TI"# from (erb):1
;TI"
;TI"$erb.location = ['file.erb', 3]
;TI"=# All subsequent error reporting would use new location
;TI"erb.render
;TI"3# undefined local variable or method `some_x'
;TI"# from file.erb:4;T:@format0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"((filename, lineno));T@FI"ERB;TcRDoc::NormalClass00 cdesc-ERB.ri 0000644 00000001660 15234553167 0006605 0 ustar 00 U:RDoc::NormalClass[iI"ERB:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[ :
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I"lib/erb/version.rb;T;
0; 0;
0[ [
I"
encoding;TI"R;T:privateFI"lib/erb.rb;T[
I"
filename;TI"RW;T;F@[
I"lineno;T@;F@[
I"src;T@;F@[U:RDoc::Constant[i I"NOT_GIVEN;TI"ERB::NOT_GIVEN;T;0o;;[ ; @
;
0@
@cRDoc::NormalClass0U;[i I"VERSION;TI"ERB::VERSION;T;0o;;[ ; @;
0@@@$0[ [[I"
class;T[[:public[ [:protected[ [;[[I"new;T@[I"version;T@[I"
instance;T[[;
[ [;[ [;[[I"def_class;T@[I"def_method;T@[I"def_module;T@[I"location=;T@[I"make_compiler;T@[I"new_toplevel;T@[I"result;T@[I"result_with_hash;T@[I"run;T@[I"set_eoutvar;T@[ [U:RDoc::Context::Section[i 0o;;[ ; 0;
0[I"lib/erb.rb;TI"lib/erb/version.rb;T@cRDoc::TopLevel def_class-i.ri 0000644 00000001507 15234553167 0007267 0 ustar 00 U:RDoc::AnyMethod[iI"def_class:ETI"ERB#def_class;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"SDefine unnamed class which has _methodname_ as instance method, and return it.;To:RDoc::Markup::BlankLine o;
; [I"
example:;To:RDoc::Markup::Verbatim; [I"class MyClass_
;TI"" def initialize(arg1, arg2)
;TI"% @arg1 = arg1; @arg2 = arg2
;TI" end
;TI" end
;TI"Mfilename = 'example.rhtml' # @arg1 and @arg2 are used in example.rhtml
;TI"(erb = ERB.new(File.read(filename))
;TI"erb.filename = filename
;TI"3MyClass = erb.def_class(MyClass_, 'render()')
;TI"+print MyClass.new('foo', 123).render();T:@format0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"-(superklass=Object, methodname='result');T@FI"ERB;TcRDoc::NormalClass00 DefMethod/cdesc-DefMethod.ri 0000644 00000002166 15234553167 0011675 0 ustar 00 U:RDoc::NormalModule[iI"DefMethod:ETI"ERB::DefMethod;T0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I">Utility module to define eRuby script as instance method.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading:
leveli: textI"Example;T@o; ;[I"example.rhtml:;To:RDoc::Markup::Verbatim;[I"<% for item in @items %>
;TI"<%= item %>
;TI"<% end %>
;T:@format0o; ;[I"example.rb:;To;;[I"require 'erb'
;TI"class MyClass
;TI" extend ERB::DefMethod
;TI"3 def_erb_method('render()', 'example.rhtml')
;TI" def initialize(items)
;TI" @items = items
;TI" end
;TI" end
;TI",print MyClass.new([10,20,30]).render()
;T;0o; ;[I"result:;T@o;;[
I"10
;TI"
;TI"20
;TI"
;TI"30;T;0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ [ [[I"
class;T[[:public[ [:protected[ [:private[[I"def_erb_method;TI"lib/erb.rb;T[I"
instance;T[[;[ [;[ [;[[@B@C[ [U:RDoc::Context::Section[i 0o;;[ ;0;0[I"lib/erb.rb;TI"ERB;TcRDoc::NormalClass DefMethod/def_erb_method-i.ri 0000644 00000000631 15234553167 0012126 0 ustar 00 U:RDoc::AnyMethod[iI"def_erb_method:ETI""ERB::DefMethod#def_erb_method;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Idefine _methodname_ as instance method of current module, using ERB ;TI"object or eRuby file;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(methodname, erb_or_fname);T@FI"DefMethod;TcRDoc::NormalModule00 DefMethod/def_erb_method-c.ri 0000644 00000000632 15234553167 0012121 0 ustar 00 U:RDoc::AnyMethod[iI"def_erb_method:ETI"#ERB::DefMethod::def_erb_method;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Idefine _methodname_ as instance method of current module, using ERB ;TI"object or eRuby file;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(methodname, erb_or_fname);T@FI"DefMethod;TcRDoc::NormalModule00 encoding-i.ri 0000644 00000000414 15234553167 0007126 0 ustar 00 U:RDoc::Attr[iI"
encoding:ETI"ERB#encoding;TI"R;T:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"The encoding to eval;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below0F@I"ERB;TcRDoc::NormalClass0 new-c.ri 0000644 00000005227 15234553167 0006132 0 ustar 00 U:RDoc::AnyMethod[iI"new:ETI"
ERB::new;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FConstructs a new ERB object with the template specified in _str_.;To:RDoc::Markup::BlankLine o;
; [I"KAn ERB object works by building a chunk of Ruby code that will output ;TI"%the completed template when run.;T@o;
; [I"OIf _trim_mode_ is passed a String containing one or more of the following ;TI">modifiers, ERB will adjust its code generation as listed:;T@o:RDoc::Markup::Verbatim; [ I"@% enables Ruby code processing for lines beginning with %
;TI"A<> omit newline for lines starting with <% and ending in %>
;TI",> omit newline for lines ending in %>
;TI"'- omit blank lines ending in -%>
;T:@format0o;
; [ I"M_eoutvar_ can be used to set the name of the variable ERB will build up ;TI"Fits output in. This is useful when you need to run multiple ERB ;TI"Ntemplates through the same binding and/or when you want to control where ;TI"Ooutput ends up. Pass the name of the variable to be used inside a String.;T@S:RDoc::Markup::Heading:
leveli: textI"Example;T@o;; ['I"require "erb"
;TI"
;TI"# build data class
;TI"class Listings
;TI"3 PRODUCT = { :name => "Chicken Fried Steak",
;TI"J :desc => "A well messages pattie, breaded and fried.",
;TI"# :cost => 9.95 }
;TI"
;TI"$ attr_reader :product, :price
;TI"
;TI"2 def initialize( product = "", price = "" )
;TI" @product = product
;TI" @price = price
;TI" end
;TI"
;TI" def build
;TI" b = binding
;TI"C # create and run templates, filling member data variables
;TI"a ERB.new(<<-'END_PRODUCT'.gsub(/^\s+/, ""), trim_mode: "", eoutvar: "@product").result b
;TI"! <%= PRODUCT[:name] %>
;TI"! <%= PRODUCT[:desc] %>
;TI" END_PRODUCT
;TI"] ERB.new(<<-'END_PRICE'.gsub(/^\s+/, ""), trim_mode: "", eoutvar: "@price").result b
;TI": <%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
;TI"! <%= PRODUCT[:desc] %>
;TI" END_PRICE
;TI" end
;TI" end
;TI"
;TI"# setup template data
;TI"listings = Listings.new
;TI"listings.build
;TI"
;TI"3puts listings.product + "\n" + listings.price
;T;
0o;
; [I"_Generates_;T@o;; [
I"Chicken Fried Steak
;TI"0A well messages pattie, breaded and fried.
;TI"
;TI"!Chicken Fried Steak -- 9.95
;TI"/A well messages pattie, breaded and fried.;T;
0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"z(str, safe_level=NOT_GIVEN, legacy_trim_mode=NOT_GIVEN, legacy_eoutvar=NOT_GIVEN, trim_mode: nil, eoutvar: '_erbout');T@SFI"ERB;TcRDoc::NormalClass00 make_compiler-i.ri 0000644 00000000531 15234553167 0010147 0 ustar 00 U:RDoc::AnyMethod[iI"make_compiler:ETI"ERB#make_compiler;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"GCreates a new compiler for ERB. See ERB::Compiler.new for details;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(trim_mode);T@FI"ERB;TcRDoc::NormalClass00 Util/u-i.ri 0000644 00000000374 15234553167 0006526 0 ustar 00 U:RDoc::AnyMethod[iI"u:ETI"ERB::Util#u;TF:privateo:RDoc::Markup::Document:@parts[ :
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(s);T@FI" Util;TcRDoc::NormalModule0[I"ERB::Util;TFI"url_encode;T Util/url_encode-i.ri 0000644 00000001230 15234553167 0010371 0 ustar 00 U:RDoc::AnyMethod[iI"url_encode:ETI"ERB::Util#url_encode;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I";A utility method for encoding the String _s_ as a URL.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"require "erb"
;TI"include ERB::Util
;TI"
;TI"Lputs url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
;T:@format0o;
; [I"_Generates_;T@o;; [I"HProgramming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide;T;
0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[[I"u;To;; [ ;@;0I"(s);T@FI" Util;TcRDoc::NormalModule00 Util/url_encode-c.ri 0000644 00000001231 15234553167 0010364 0 ustar 00 U:RDoc::AnyMethod[iI"url_encode:ETI"ERB::Util::url_encode;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I";A utility method for encoding the String _s_ as a URL.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"require "erb"
;TI"include ERB::Util
;TI"
;TI"Lputs url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
;T:@format0o;
; [I"_Generates_;T@o;; [I"HProgramming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide;T;
0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[[I"u;To;; [ ;@;0I"(s);T@FI" Util;TcRDoc::NormalModule00 Util/h-i.ri 0000644 00000000375 15234553167 0006512 0 ustar 00 U:RDoc::AnyMethod[iI"h:ETI"ERB::Util#h;TF:privateo:RDoc::Markup::Document:@parts[ :
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(s);T@FI" Util;TcRDoc::NormalModule0[I"ERB::Util;TFI"html_escape;T Util/html_escape-i.ri 0000644 00000001126 15234553167 0010542 0 ustar 00 U:RDoc::AnyMethod[iI"html_escape:ETI"ERB::Util#html_escape;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I">A utility method for escaping HTML tag characters in _s_.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"require "erb"
;TI"include ERB::Util
;TI"
;TI",puts html_escape("is a > 0 & a < 10?")
;T:@format0o;
; [I"_Generates_;T@o;; [I"!is a > 0 & a < 10?;T;
0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[[I"h;To;; [ ;@;0I"(s);T@FI" Util;TcRDoc::NormalModule00 Util/h-c.ri 0000644 00000000376 15234553167 0006505 0 ustar 00 U:RDoc::AnyMethod[iI"h:ETI"ERB::Util::h;TT:privateo:RDoc::Markup::Document:@parts[ :
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(s);T@FI" Util;TcRDoc::NormalModule0[I"ERB::Util;TFI"html_escape;T Util/html_escape-c.ri 0000644 00000001127 15234553167 0010535 0 ustar 00 U:RDoc::AnyMethod[iI"html_escape:ETI"ERB::Util::html_escape;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I">A utility method for escaping HTML tag characters in _s_.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"require "erb"
;TI"include ERB::Util
;TI"
;TI",puts html_escape("is a > 0 & a < 10?")
;T:@format0o;
; [I"_Generates_;T@o;; [I"!is a > 0 & a < 10?;T;
0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[[I"h;To;; [ ;@;0I"(s);T@FI" Util;TcRDoc::NormalModule00 Util/cdesc-Util.ri 0000644 00000001116 15234553167 0010023 0 ustar 00 U:RDoc::NormalModule[iI" Util:ETI"ERB::Util;T0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"NA utility module for conversion routines, often handy in HTML generation.;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [ [[I"
class;T[[:public[ [:protected[ [:private[ [I"h;TI"lib/erb.rb;T[I"html_escape;T@ [I"u;T@ [I"url_encode;T@ [I"
instance;T[[;[ [;
[ [;[ [@@ [@"@ [@$@ [@&@ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[I"lib/erb.rb;TI"ERB;TcRDoc::NormalClass Util/u-c.ri 0000644 00000000375 15234553167 0006521 0 ustar 00 U:RDoc::AnyMethod[iI"u:ETI"ERB::Util::u;TT:privateo:RDoc::Markup::Document:@parts[ :
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(s);T@FI" Util;TcRDoc::NormalModule0[I"ERB::Util;TFI"url_encode;T run-i.ri 0000644 00000000471 15234553167 0006147 0 ustar 00 U:RDoc::AnyMethod[iI"run:ETI"ERB#run;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Generate results and print them. (see ERB#result);T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(b=new_toplevel);T@FI"ERB;TcRDoc::NormalClass00 new_toplevel-i.ri 0000644 00000000574 15234553167 0010052 0 ustar 00 U:RDoc::AnyMethod[iI"new_toplevel:ETI"ERB#new_toplevel;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"NReturns a new binding each time *near* TOPLEVEL_BINDING for runs that do ;TI"not specify a binding.;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(vars = nil);T@FI"ERB;TcRDoc::NormalClass00 filename-i.ri 0000644 00000000517 15234553167 0007124 0 ustar 00 U:RDoc::Attr[iI"
filename:ETI"ERB#filename;TI"RW;T:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"NThe optional _filename_ argument passed to Kernel#eval when the ERB code ;TI"is run;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below0F@I"ERB;TcRDoc::NormalClass0 src-i.ri 0000644 00000000414 15234553167 0006127 0 ustar 00 U:RDoc::Attr[iI"src:ETI"ERB#src;TI"R;T:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"#The Ruby code generated by ERB;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below0F@I"ERB;TcRDoc::NormalClass0 def_module-i.ri 0000644 00000001320 15234553167 0007440 0 ustar 00 U:RDoc::AnyMethod[iI"def_module:ETI"ERB#def_module;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"XCreate unnamed module, define _methodname_ as instance method of it, and return it.;To:RDoc::Markup::BlankLine o;
; [I"
example:;To:RDoc::Markup::Verbatim; [I"Pfilename = 'example.rhtml' # 'arg1' and 'arg2' are used in example.rhtml
;TI"(erb = ERB.new(File.read(filename))
;TI"erb.filename = filename
;TI"5MyModule = erb.def_module('render(arg1, arg2)')
;TI"class MyClass
;TI" include MyModule
;TI"end;T:@format0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(methodname='erb');T@FI"ERB;TcRDoc::NormalClass00 result-i.ri 0000644 00000001123 15234553167 0006654 0 ustar 00 U:RDoc::AnyMethod[iI"result:ETI"ERB#result;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"PExecutes the generated ERB code to produce a completed template, returning ;TI"Nthe results of that code. (See ERB::new for details on how this process ;TI"&can be affected by _safe_level_.);To:RDoc::Markup::BlankLine o;
; [I"F_b_ accepts a Binding object which is used to set the context of ;TI"code evaluation.;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(b=new_toplevel);T@FI"ERB;TcRDoc::NormalClass00 set_eoutvar-i.ri 0000644 00000000757 15234553167 0007712 0 ustar 00 U:RDoc::AnyMethod[iI"set_eoutvar:ETI"ERB#set_eoutvar;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"KCan be used to set _eoutvar_ as described in ERB::new. It's probably ;TI"Jeasier to just use the constructor though, since calling this method ;TI"4requires the setup of an ERB _compiler_ object.;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"$(compiler, eoutvar = '_erbout');T@FI"ERB;TcRDoc::NormalClass00 lineno-i.ri 0000644 00000000511 15234553167 0006622 0 ustar 00 U:RDoc::Attr[iI"lineno:ETI"ERB#lineno;TI"RW;T:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"LThe optional _lineno_ argument passed to Kernel#eval when the ERB code ;TI"is run;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below0F@I"ERB;TcRDoc::NormalClass0 def_method-i.ri 0000644 00000001260 15234553167 0007436 0 ustar 00 U:RDoc::AnyMethod[iI"def_method:ETI"ERB#def_method;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"ODefine _methodname_ as instance method of _mod_ from compiled Ruby source.;To:RDoc::Markup::BlankLine o;
; [I"
example:;To:RDoc::Markup::Verbatim; [ I"Pfilename = 'example.rhtml' # 'arg1' and 'arg2' are used in example.rhtml
;TI"(erb = ERB.new(File.read(filename))
;TI"=erb.def_method(MyClass, 'render(arg1, arg2)', filename)
;TI")print MyClass.new.render('foo', 123);T:@format0:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"%(mod, methodname, fname='(ERB)');T@FI"ERB;TcRDoc::NormalClass00 result_with_hash-i.ri 0000644 00000000573 15234553167 0010722 0 ustar 00 U:RDoc::AnyMethod[iI"result_with_hash:ETI"ERB#result_with_hash;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"PRender a template on a new toplevel binding with local variables specified ;TI"by a Hash object.;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(hash);T@FI"ERB;TcRDoc::NormalClass00 version-c.ri 0000644 00000000466 15234553167 0007026 0 ustar 00 U:RDoc::AnyMethod[iI"version:ETI"ERB::version;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"8Returns revision information for the erb.rb module.;T:
@fileI"lib/erb.rb;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"ERB;TcRDoc::NormalClass00