diff options
author | makoto kuwata <kwa@kuwata-lab.com> | 2008-06-12 23:04:21 +0000 |
---|---|---|
committer | makoto kuwata <kwa@kuwata-lab.com> | 2008-06-12 23:04:21 +0000 |
commit | 7b9c3481ca6c485d270cdb401968914e1459ddd0 (patch) | |
tree | 2721133154d8793ad831c625d2cb7c561ebef9fe | |
parent | 57135ec28e3d7928e7650546f03c200e835355af (diff) | |
download | erubis-7b9c3481ca6c485d270cdb401968914e1459ddd0.tar.gz |
- [release] preparation for 2.6.2
-rw-r--r-- | CHANGES.txt | 3 | ||||
-rw-r--r-- | ChangeLog.txt | 9 | ||||
-rw-r--r-- | Rookbook.props | 2 | ||||
-rw-r--r-- | doc/users-guide.html | 9 | ||||
-rw-r--r-- | doc/users-guide.txt | 9 |
5 files changed, 21 insertions, 11 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 2176a61..f4a38cd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,7 +13,8 @@ bugfixes: - | - Remove empty file ('lib/erubis/convert.rb:'). (Thanks to Tim Morgan) + Fixed a bug that it is not able to install Erubis on windows + (Thanks to Tim Morgan and Allen). - release: 2.6.1 diff --git a/ChangeLog.txt b/ChangeLog.txt index b69becb..619e477 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -3,9 +3,16 @@ .?lastupdate: $Date$ .?version: $Rev$ -: Rev.116 (2008-06-12) +: Rev.118 (2008-06-13) + .- [update] users-guide + .- [release] preparation for 2.6.2 + +: Rev.117 (2008-06-12) .- [update] README.txt, users-guide, CHANGES.txt +: Rev.116 (2008-06-12) + .- [change] use "#{ENV['_']} -wc" instead of 'ruby -wc' to check syntax (-z) if ENV['_'] is not nil + : Rev.115 (2008-06-12) .- [enhance] test/testutil.rb: add TestCase::post_definition .- [enhance] Ruby 1.9 support diff --git a/Rookbook.props b/Rookbook.props index d12aae5..af70c94 100644 --- a/Rookbook.props +++ b/Rookbook.props @@ -1,2 +1,2 @@ -release: 2.6.1 +release: 2.6.2 copyright: copyright(c) 2006-2008 kuwata-lab.com all rights reserved. diff --git a/doc/users-guide.html b/doc/users-guide.html index d806e4e..0fe65db 100644 --- a/doc/users-guide.html +++ b/doc/users-guide.html @@ -257,6 +257,7 @@ puts <strong>eruby.src</strong> # print script source puts "---------- result ----------" list = ['aaa', 'bbb', 'ccc'] puts <strong>eruby.result(binding())</strong> # get result +## or puts eruby.result(<strong>:list=>list</strong>) # or pass Hash instead of Binding ## # or ## eruby = Erubis::Eruby.new @@ -621,22 +622,22 @@ This means that data is passed into eRuby script via local variables when Eruby: </p> <div class="program_caption"> definition of result(binding) and evaluate(context)</div> -<pre class="program">def result(_binding) +<pre class="program">def result(_binding=TOPLEVEL_BINDING) if _binding.is_a?(Hash) # load hash data as local variable _h = _binding - eval _h.keys.inject("") {|s,k| s << "#{k} = _h[#{k.inspect}];"} _binding = binding() + eval _h.collect{|k,v| "#{k} = _h[#{k.inspect}];"}.join, _binding end return <strong>eval(@src, _binding)</strong> end -def evaluate(_context) +def evaluate(_context=Erubis::Context.new) if _context.is_a?(Hash) # convert hash object to Context object _hash = _context _context = Erubis::Context.new - _hash.each { |key, val| _context[key] = val } + _hash.each {|k, v| _context[k] = v } end return <strong>_context.instance_eval(@src)</strong> end diff --git a/doc/users-guide.txt b/doc/users-guide.txt index bbd4b71..da64462 100644 --- a/doc/users-guide.txt +++ b/doc/users-guide.txt @@ -125,6 +125,7 @@ puts {{*eruby.src*}} # print script source puts "---------- result ----------" list = ['aaa', 'bbb', 'ccc'] puts {{*eruby.result(binding())*}} # get result +## or puts eruby.result({{*:list=>list*}}) # or pass Hash instead of Binding ## # or ## eruby = Erubis::Eruby.new @@ -488,22 +489,22 @@ Here is the definition of Erubis#result() and Erubis#evaluate(). .? definition of result(binding) and evaluate(context) .-------------------- -def result(_binding) +def result(_binding=TOPLEVEL_BINDING) if _binding.is_a?(Hash) # load hash data as local variable _h = _binding - eval _h.keys.inject("") {|s,k| s << "#{k} = _h[#{k.inspect}];"} _binding = binding() + eval _h.collect{|k,v| "#{k} = _h[#{k.inspect}];"}.join, _binding end return {{*eval(@src, _binding)*}} end -def evaluate(_context) +def evaluate(_context=Erubis::Context.new) if _context.is_a?(Hash) # convert hash object to Context object _hash = _context _context = Erubis::Context.new - _hash.each { |key, val| _context[key] = val } + _hash.each {|k, v| _context[k] = v } end return {{*_context.instance_eval(@src)*}} end |