clutterbuck-erb 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/clutterbuck-erb.gemspec +2 -0
- data/lib/clutterbuck/erb.rb +10 -2
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0a2d0116765eab4d5b2df750ed66472a5500386
|
4
|
+
data.tar.gz: d60b680de7ba2cc63bb7649919b6c847e8f0c9b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e701c643284c247cc8ce82237ed663ccd6de2a2d4d141e85ffd36f6b76cb960e5758253fbc8f07cfa98ef62f96fc50b90667433060cdf75b8815dcc65579fad6
|
7
|
+
data.tar.gz: e398d7ced4c8ceb861c9e4ddc573234a434cd523c1789184876017bdde9d2829fd0a1cbe30dd59f0c046dd796246957e8183981abe976ba502d066ae9a674626
|
data/clutterbuck-erb.gemspec
CHANGED
data/lib/clutterbuck/erb.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'erb'
|
2
|
+
require 'rack'
|
2
3
|
|
3
4
|
#:nodoc:
|
4
5
|
module Clutterbuck; end
|
@@ -51,8 +52,9 @@ module Clutterbuck::ERB
|
|
51
52
|
|
52
53
|
#:nodoc:
|
53
54
|
#
|
54
|
-
# A special (very, *very* special) class which only defines methods for
|
55
|
-
# vars that are passed into it
|
55
|
+
# A special (very, *very* special) class which only defines methods for
|
56
|
+
# the vars that are passed into it, as well as fundamental HTML escaping
|
57
|
+
# methods.
|
56
58
|
#
|
57
59
|
class EvalBinding < BasicObject
|
58
60
|
def initialize(vars)
|
@@ -77,6 +79,12 @@ module Clutterbuck::ERB
|
|
77
79
|
instance_eval "def #{k}; @vars[#{k.inspect}]; end"
|
78
80
|
end
|
79
81
|
end
|
82
|
+
|
83
|
+
# HTML-escape the provided string.
|
84
|
+
#
|
85
|
+
def h(s)
|
86
|
+
::Rack::Utils.escape_html(s)
|
87
|
+
end
|
80
88
|
end
|
81
89
|
|
82
90
|
# Render an ERB template as a Rack response.
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clutterbuck-erb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|