tilt 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/tilt.rb +2 -2
- data/lib/tilt/template.rb +1 -1
- data/test/tilt_csv_test.rb +2 -6
- data/test/tilt_template_test.rb +11 -0
- data/tilt.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTA1ZmRhM2QwODJjZDM1YTAzMzM2ZTZlMGIwNmI3MzMxOTZlYjA2ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmNmOTUwNTQyNzg2MTViMDkzMzU0YTAwMTVhZjJjM2JlMjhlMDAzZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGFmMDlkYjgxY2ExMjJkYjZkZDg3ZjliMjk4MmFiNjUyOTlkYjYwOGUwOTUz
|
10
|
+
OGIwYWRjOTFmNjhmMDYwNjU3NDhiMTM0MmViN2NjZmNlMDVlYjkzODFhMzI4
|
11
|
+
MThjZDJkY2QwODM2OTU3NGFhZDQ4MGRjYTQ4NDUwZTIyNGE2ZWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTE3OTkzYWQzZTEyODUxNzk5NDcyNDUxN2NjZWE0NTA4ZTIzYjM1MWI0NmE4
|
14
|
+
MTJjMjYxYjdiNTk3YTEwNWRjNWQzZWM4M2ExZDIzNmIxMjUyYWUzZmFmYzQz
|
15
|
+
ODJhNjNmNzY2MDkxODcxMGE0NDhkOWVhOGIzYmMwYzFiZjQ3Y2E=
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -47,7 +47,7 @@ Support for these template engines is included with the package:
|
|
47
47
|
Creole (Wiki markup) .wiki, .creole creole
|
48
48
|
WikiCloth (Wiki markup) .wiki, .mediawiki, .mw wikicloth
|
49
49
|
Yajl .yajl yajl-ruby
|
50
|
-
CSV .
|
50
|
+
CSV .rcsv none (Ruby >= 1.9), fastercsv (Ruby < 1.9)
|
51
51
|
|
52
52
|
These template engines ship with their own Tilt integration:
|
53
53
|
|
data/lib/tilt.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Tilt
|
2
|
-
VERSION = '1.3.
|
2
|
+
VERSION = '1.3.6'
|
3
3
|
|
4
4
|
@preferred_mappings = Hash.new
|
5
5
|
@template_mappings = Hash.new { |h, k| h[k] = [] }
|
@@ -154,7 +154,7 @@ module Tilt
|
|
154
154
|
register LessTemplate, 'less'
|
155
155
|
|
156
156
|
require 'tilt/csv'
|
157
|
-
register CSVTemplate, '
|
157
|
+
register CSVTemplate, 'rcsv'
|
158
158
|
|
159
159
|
require 'tilt/coffee'
|
160
160
|
register CoffeeScriptTemplate, 'coffee'
|
data/lib/tilt/template.rb
CHANGED
@@ -41,9 +41,9 @@ module Tilt
|
|
41
41
|
[options, line, file].compact.each do |arg|
|
42
42
|
case
|
43
43
|
when arg.respond_to?(:to_str) ; @file = arg.to_str
|
44
|
-
when arg.respond_to?(:path) ; @file = arg.path
|
45
44
|
when arg.respond_to?(:to_int) ; @line = arg.to_int
|
46
45
|
when arg.respond_to?(:to_hash) ; @options = arg.to_hash.dup
|
46
|
+
when arg.respond_to?(:path) ; @file = arg.path
|
47
47
|
else raise TypeError
|
48
48
|
end
|
49
49
|
end
|
data/test/tilt_csv_test.rb
CHANGED
@@ -10,12 +10,8 @@ begin
|
|
10
10
|
|
11
11
|
class CSVTemplateTest < Test::Unit::TestCase
|
12
12
|
|
13
|
-
test "
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
test "registered for '.csv' files" do
|
18
|
-
assert Tilt.mappings['csv'].include?(Tilt::CSVTemplate)
|
13
|
+
test "registered for '.rcsv' files" do
|
14
|
+
assert Tilt.mappings['rcsv'].include?(Tilt::CSVTemplate)
|
19
15
|
end
|
20
16
|
|
21
17
|
test "compiles and evaluates the template on #render" do
|
data/test/tilt_template_test.rb
CHANGED
@@ -30,6 +30,17 @@ class TiltTemplateTest < Test::Unit::TestCase
|
|
30
30
|
assert_equal File.basename(tempfile.path), inst.basename
|
31
31
|
end
|
32
32
|
|
33
|
+
class SillyHash < Hash
|
34
|
+
def path(arg)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
test "initialize with hash that implements #path" do
|
39
|
+
options = SillyHash[:key => :value]
|
40
|
+
inst = MockTemplate.new(options) {}
|
41
|
+
assert_equal :value, inst.options[:key]
|
42
|
+
end
|
43
|
+
|
33
44
|
test "uses correct eval_file" do
|
34
45
|
inst = MockTemplate.new('foo.erb', 55) {}
|
35
46
|
assert_equal 'foo.erb', inst.eval_file
|
data/tilt.gemspec
CHANGED
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
4
4
|
|
5
5
|
s.name = 'tilt'
|
6
|
-
s.version = '1.3.
|
7
|
-
s.date = '2013-03-
|
6
|
+
s.version = '1.3.6'
|
7
|
+
s.date = '2013-03-17'
|
8
8
|
|
9
9
|
s.description = "Generic interface to multiple Ruby template engines"
|
10
10
|
s.summary = s.description
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tilt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Tomayko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|