tilt 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTRjMjJiNzI3ZDRkYTY1N2QxMDE2NDFjODFmODc5MDc0NzQ5MDM1YQ==
4
+ MTA1ZmRhM2QwODJjZDM1YTAzMzM2ZTZlMGIwNmI3MzMxOTZlYjA2ZQ==
5
5
  data.tar.gz: !binary |-
6
- YjJiMDBkZjQwMDlhNDhiMWI1MmU2MTJmMmEyZDY1NjJjOTJkZjFiMQ==
6
+ ZmNmOTUwNTQyNzg2MTViMDkzMzU0YTAwMTVhZjJjM2JlMjhlMDAzZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OTJkN2NiNjhiM2FmN2E0NTY3YTg2ZGUwMzM2MDZiOWJiMDNkNjEyMTVmODQ5
10
- NzJhMDhkNTgxMzdkZDRmYTg4YWE5MTAxODNjMDhmYjNlYjNjYjUxMjI2NWY2
11
- MDhhMTg4NTQ2Njk0MTI3OTU2NmFlYTk4MGZjODkzMzdhOThlOWE=
9
+ NGFmMDlkYjgxY2ExMjJkYjZkZDg3ZjliMjk4MmFiNjUyOTlkYjYwOGUwOTUz
10
+ OGIwYWRjOTFmNjhmMDYwNjU3NDhiMTM0MmViN2NjZmNlMDVlYjkzODFhMzI4
11
+ MThjZDJkY2QwODM2OTU3NGFhZDQ4MGRjYTQ4NDUwZTIyNGE2ZWM=
12
12
  data.tar.gz: !binary |-
13
- NzgxM2UyNTM2N2NkZDY4YmYyNDMxZTI2NGEyNWM5NDIwZGZkNDU4ZDdkZTYx
14
- ODgzMDkzZjM4ZGRhYzI5Y2FjNWQxMzVlMzk5ZjIwNzBiODcxNTlkOTc4YWFl
15
- YjNlNzViNWNjYzI2MGYxYTVmOGNkZmIzZDljMTNmNTY4ZjM2MWM=
13
+ OTE3OTkzYWQzZTEyODUxNzk5NDcyNDUxN2NjZWE0NTA4ZTIzYjM1MWI0NmE4
14
+ MTJjMjYxYjdiNTk3YTEwNWRjNWQzZWM4M2ExZDIzNmIxMjUyYWUzZmFmYzQz
15
+ ODJhNjNmNzY2MDkxODcxMGE0NDhkOWVhOGIzYmMwYzFiZjQ3Y2E=
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## master
2
2
 
3
+ ## 1.3.6 (2013-03-17)
4
+
5
+ * Accept Hash that implements #path as options (#180, lawso017)
6
+ * Changed extension for CsvTemplate from '.csv' to '.rcsv' (#177, alexgb)
7
+
3
8
  ## 1.3.5 (2013-03-06)
4
9
 
5
10
  * Fixed extension for PlainTemplate (judofyr)
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 .csv none (Ruby >= 1.9), fastercsv (Ruby < 1.9)
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.5'
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, 'csv'
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
@@ -10,12 +10,8 @@ begin
10
10
 
11
11
  class CSVTemplateTest < Test::Unit::TestCase
12
12
 
13
- test "is registered for '.csv' files" do
14
- assert_equal Tilt::CSVTemplate, Tilt['test.csv']
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
@@ -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.5'
7
- s.date = '2013-03-06'
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.5
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-06 00:00:00.000000000 Z
11
+ date: 2013-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor