jrb 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/jrb.gemspec +2 -2
- data/lib/jrb/rails.rb +2 -2
- data/lib/jrb/version.rb +1 -1
- data/test/action_view_test.rb +2 -2
- data/test/dummy/config/application.rb +2 -0
- metadata +49 -51
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 73a0b2dcc0bfdf9e90aeca33b5f11ce0713fbf00
|
4
|
+
data.tar.gz: fda833283da0a1aaed2c5d5f0a27e4875397dec3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bff9c0e6dae49af2bf7425ca9f6042107a77256dddb2bb6cfc21856000ffff2178762bf77b77330039811ead38d4273223ce190e1530e46805f592fba2d5bef9
|
7
|
+
data.tar.gz: dcc22de73f45bc9979f151eb2228b93e02f50731a0d6bc10c073d3a776161936a82dfb86eaa89153e95d121f4009df1d10b1fdff2a53530828cf8aaafe001b6d
|
data/jrb.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = JRB::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Rolf Timmermans"]
|
10
|
-
s.email = ["
|
10
|
+
s.email = ["rolftimmermans@voormedia.com"]
|
11
11
|
s.homepage = "https://github.com/voormedia/jrb"
|
12
12
|
s.summary = %q{JRB templates are Just Ruby}
|
13
13
|
s.description = %q{JRB is a trivial templating engine that allows you to use plain Ruby files as templates.}
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.rubyforge_project = "jrb"
|
16
16
|
|
17
17
|
s.add_dependency("tilt", ["~> 1.3"])
|
18
|
-
s.add_development_dependency("rails", ["~>
|
18
|
+
s.add_development_dependency("rails", ["~> 4.0"])
|
19
19
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
21
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/jrb/rails.rb
CHANGED
@@ -2,10 +2,10 @@ module JRB
|
|
2
2
|
module Rails
|
3
3
|
class TemplateHandler
|
4
4
|
HTML_MIME_TYPES = ["text/html", "application/xhtml+xml"]
|
5
|
-
|
5
|
+
|
6
6
|
class << self
|
7
7
|
def call(template)
|
8
|
-
auto_escape = HTML_MIME_TYPES.include? template.
|
8
|
+
auto_escape = HTML_MIME_TYPES.include? template.type
|
9
9
|
tilt_template = JRB::Template.new(template.identifier, 1, :escape_html => auto_escape) { template.source }
|
10
10
|
tilt_template.send(:precompiled, {}).first
|
11
11
|
end
|
data/lib/jrb/version.rb
CHANGED
data/test/action_view_test.rb
CHANGED
@@ -21,9 +21,9 @@ class ActionViewTest < ActionController::TestCase
|
|
21
21
|
|
22
22
|
test "not escaping html characters in json templates" do
|
23
23
|
get :index, :name => "<script>safe</script>", :format => :json
|
24
|
-
assert_equal '{"greeting":"Hello
|
24
|
+
assert_equal '{"greeting":"Hello \\u003Cscript\\u003Esafe\\u003C/script\\u003E!"}', response.body
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
test "capturing content" do
|
28
28
|
get :capture, :name => "John"
|
29
29
|
assert_equal "<html><head></head><body>Hello John!</body></html>", response.body
|
metadata
CHANGED
@@ -1,50 +1,52 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jrb
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.2.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Rolf Timmermans
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
16
14
|
name: tilt
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: "1.3"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
24
20
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: rails
|
28
21
|
prerelease: false
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.0'
|
35
34
|
type: :development
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.0'
|
41
|
+
description: JRB is a trivial templating engine that allows you to use plain Ruby
|
42
|
+
files as templates.
|
43
|
+
email:
|
44
|
+
- rolftimmermans@voormedia.com
|
40
45
|
executables: []
|
41
|
-
|
42
46
|
extensions: []
|
43
|
-
|
44
47
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
|
47
|
-
- .gitignore
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
48
50
|
- Gemfile
|
49
51
|
- Gemfile.lock
|
50
52
|
- LICENSE
|
@@ -72,32 +74,28 @@ files:
|
|
72
74
|
- test/test_helper.rb
|
73
75
|
homepage: https://github.com/voormedia/jrb
|
74
76
|
licenses: []
|
75
|
-
|
77
|
+
metadata: {}
|
76
78
|
post_install_message:
|
77
79
|
rdoc_options: []
|
78
|
-
|
79
|
-
require_paths:
|
80
|
+
require_paths:
|
80
81
|
- lib
|
81
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
-
|
83
|
-
requirements:
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
84
|
- - ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version:
|
87
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
-
|
89
|
-
requirements:
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
90
89
|
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version:
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
93
92
|
requirements: []
|
94
|
-
|
95
93
|
rubyforge_project: jrb
|
96
|
-
rubygems_version:
|
94
|
+
rubygems_version: 2.2.0
|
97
95
|
signing_key:
|
98
|
-
specification_version:
|
96
|
+
specification_version: 4
|
99
97
|
summary: JRB templates are Just Ruby
|
100
|
-
test_files:
|
98
|
+
test_files:
|
101
99
|
- test/action_view_test.rb
|
102
100
|
- test/dummy/app/controllers/test_controller.rb
|
103
101
|
- test/dummy/app/views/layouts/_header.html.rb
|