summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormakoto kuwata <kwa@kuwata-lab.com>2006-02-01 10:54:24 +0000
committermakoto kuwata <kwa@kuwata-lab.com>2006-02-01 10:54:24 +0000
commit7bcc0ee5583e3b64b26c57f39a3c70bb69d09ca0 (patch)
tree4e61ee16fcae8c4e9a8d25e81c96be2772cec837
parent3e1cd0c3e8fbc9b26da3bdf53189674e2df9e488 (diff)
downloaderubis-7bcc0ee5583e3b64b26c57f39a3c70bb69d09ca0.tar.gz
- [bugifx] bin/erubis run with RubyGems
-rw-r--r--ChangeLog15
-rw-r--r--ChangeLog.txt3
-rwxr-xr-xbin/erubis4
-rw-r--r--lib/erubis.rb8
4 files changed, 20 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e5ef80..a4b9f79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,16 @@
# $Release$
# $Copyright$
-- release: 1.0
- date: 2005-02-01
- desc: first release
+- release: 1.0.1
+ date: 2005-02-01
+ desc:
+ - tag: bugfix
+ text: bin/erubis is available with RubyGems
+
+- release: 1.0.0
+ date: 2005-02-01
+ desc:
+ - tag: note
+ text: first release
+
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 118e92c..dd92fc8 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -2,6 +2,9 @@
.?lastupdate: $Date$
.?version: $Rev$
+.: Rev.4 (2005-02-01)
+ .- [bugifx] bin/erubis run with RubyGems
+
.: Rev.3 (2005-01-31)
.- [bufix] XmlEruby outs <%=== expr %> to $stdout, it changed to $stderr
.- [change] rename var name 'kind' to 'indicator' in Eruby#compile()
diff --git a/bin/erubis b/bin/erubis
index 666df6e..7aa715e 100755
--- a/bin/erubis
+++ b/bin/erubis
@@ -175,7 +175,7 @@ END
end
-if __FILE__ == $0
+#if __FILE__ == $0
status = 0
begin
Main.new.execute(ARGV)
@@ -184,4 +184,4 @@ if __FILE__ == $0
status = 1
end
exit(status)
-end
+#end
diff --git a/lib/erubis.rb b/lib/erubis.rb
index aeceea3..9390e47 100644
--- a/lib/erubis.rb
+++ b/lib/erubis.rb
@@ -82,7 +82,7 @@ module Erubis
return result(binding())
end
- private
+ #private
def compile(input)
src = ""
@@ -90,10 +90,8 @@ module Erubis
prefix, postfix = @pattern.split()
regexp = /(.*?)(^[ \t]*)?#{prefix}(=*)(.*?)#{postfix}([ \t]*\r?\n)?/m
input.scan(regexp) do |text, head_space, indicator, code, tail_space|
- ## * when <%= %>, do nothing
- ## * when <% %>,
- ## - if before/after string is spaces then delete those spaces
- ## - else do nothing
+ ## * when '<%= %>', do nothing
+ ## * when '<% %>', delete spaces iff only spaces are around '<% %>'
flag_trim = @trim && indicator.empty? && head_space && tail_space
add_src_text(src, text)
add_src_text(src, head_space) if !flag_trim && head_space