Skip to content

Instantly share code, notes, and snippets.

@chrisseaton
Created December 21, 2014 19:12
Show Gist options
  • Save chrisseaton/b46adfe06b2d6c35f209 to your computer and use it in GitHub Desktop.
Save chrisseaton/b46adfe06b2d6c35f209 to your computer and use it in GitHub Desktop.
--- lib/ruby/stdlib/erb.rb 2014-12-21 16:00:01.000000000 +0000
+++ ../rubysl/rubysl-erb/lib/rubysl/erb/erb.rb 2014-12-21 02:19:58.000000000 +0000
@@ -68,7 +68,7 @@
# a magic comment, however, it returns a string in the encoding specified
# by the magic comment.
#
-# # -*- coding: utf-8 -*-
+# # -*- coding: UTF-8 -*-
# require 'erb'
#
# template = ERB.new <<EOF
@@ -252,13 +252,12 @@
# * Amrita (smart at producing HTML/XML);
# * cs/Template (written in C for speed);
# * RDoc, distributed with Ruby, uses its own template engine, which can be reused elsewhere;
-# * and others; search {RubyGems.org}[https://rubygems.org/] or
-# {The Ruby Toolbox}[https://www.ruby-toolbox.com/].
+# * and others; search the RAA.
#
# Rails, the web application framework, uses ERB to create views.
#
class ERB
- Revision = '$Date:: $' # :nodoc: #'
+ Revision = '$Date:: 2013-07-18 06:50:32 -0700#$' # :nodoc: #'
# Returns revision information for the erb.rb module.
def self.version
@@ -548,7 +547,7 @@
def initialize(compiler, enc=nil)
@compiler = compiler
@line = []
- @script = enc ? "#coding:#{enc}\n" : ""
+ @script = enc ? "#coding:#{enc.to_s}\n" : ""
@compiler.pre_cmd.each do |x|
push(x)
end
@@ -717,7 +716,7 @@
comment = $1 if comment[/-\*-\s*(.*?)\s*-*-$/]
if %r"coding\s*[=:]\s*([[:alnum:]\-_]+)" =~ comment
enc = $1.sub(/-(?:mac|dos|unix)/i, '')
- Encoding.find(enc)
+ enc = Encoding.find(enc)
end
end
end
@@ -837,7 +836,7 @@
# the results of that code. (See ERB::new for details on how this process
# can be affected by _safe_level_.)
#
- # _b_ accepts a Binding object which is used to set the context of
+ # _b_ accepts a Binding or Proc object which is used to set the context of
# code evaluation.
#
def result(b=new_toplevel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment