sinatra-contrib 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32e41b42273b4dff36c72e1bd901a13347f5dbbfaa83175185af9f4678677782
4
- data.tar.gz: 86bc4a0a68d0c62aa2fa757846f2859e4d0f4d058d79e71989860fa704e83f53
3
+ metadata.gz: 181cb2475ddb6a42c84126e1723f08b13317fe84e84e34f87c6d825dedb3d50b
4
+ data.tar.gz: 7195ef32216c40ecc566bdaa62e3f4843b506021af646623c2c0dfb6f151131e
5
5
  SHA512:
6
- metadata.gz: ccf4ecac97a7122b4b1b5fb8f717e74b7a6404c67591db5cc8d599a4a9dba7fb57bfe60f2b7596137b22ec4420539454706cc8baa47dedf3412607159be3a953
7
- data.tar.gz: af89061e536cb04e6c53bcf5bd42a64c3ecfd57d7fd68e59ed2065476000f11f9596f79d368b32593d0d14f60eaeb2c0db6261bcd877a7f89adddd7b86d45465
6
+ metadata.gz: 4ca55fb88020f784dab9e5d1d47f518ae6c709b2609bd58648d94212e097e493ab8eb09e4ed3520c513da215679eb3a90ae426cbcbf07ef6e3a958790fb11b54
7
+ data.tar.gz: 459b6a3e00849f5f00ed2904c0b65da24d2cfa1ac7d075eaeed80fe1a45b87dff74a4fbdaa3f7db70f09a7387a944f6e369e13c2b7b0da99cbbeb50178927274
@@ -86,7 +86,7 @@ module Sinatra
86
86
 
87
87
  def capture(*args, &block)
88
88
  return block[*args] if ruby?
89
- if haml?
89
+ if haml? && Tilt[:haml] == Tilt::HamlTemplate
90
90
  buffer = Haml::Buffer.new(nil, Haml::Options.new.for_buffer)
91
91
  with_haml_buffer(buffer) { capture_haml(*args, &block) }
92
92
  else
@@ -121,7 +121,7 @@ module Sinatra
121
121
  Dir.chdir(root || '.') do
122
122
  paths.each do |pattern|
123
123
  Dir.glob(pattern) do |file|
124
- raise UnsupportedConfigType unless ['.yml', '.erb'].include?(File.extname(file))
124
+ raise UnsupportedConfigType unless ['.yml', '.yaml', '.erb'].include?(File.extname(file))
125
125
  logger.info "loading config file '#{file}'" if logging? && respond_to?(:logger)
126
126
  document = ERB.new(IO.read(file)).result
127
127
  yaml = YAML.load(document)
@@ -134,7 +134,7 @@ module Sinatra
134
134
 
135
135
  class UnsupportedConfigType < Exception
136
136
  def message
137
- 'Invalid config file type, use .yml or .yml.erb'
137
+ 'Invalid config file type, use .yml, .yaml or .erb'
138
138
  end
139
139
  end
140
140
 
@@ -174,7 +174,7 @@ module Sinatra
174
174
  # for <tt>:head</tt>.
175
175
  def yield_content(key, *args, &block)
176
176
  if block_given? && !content_for?(key)
177
- haml? ? capture_haml(*args, &block) : yield(*args)
177
+ (haml? && Tilt[:haml] == Tilt::HamlTemplate) ? capture_haml(*args, &block) : yield(*args)
178
178
  else
179
179
  content = content_blocks[key.to_sym].map { |b| capture(*args, &b) }
180
180
  content.join.tap do |c|
@@ -1,6 +1,6 @@
1
1
  module Sinatra
2
2
  module Contrib
3
- VERSION = '2.0.7'
3
+ VERSION = '2.0.8'
4
4
  end
5
5
  end
6
6
 
@@ -169,15 +169,14 @@ module Sinatra
169
169
  settings.template_engines[:all].each do |engine|
170
170
  exts.each { |ext| possible << [engine, "#{name}.#{ext}"] }
171
171
  end
172
+
172
173
  exts.each do |ext|
173
174
  settings.template_engines[ext].each { |e| possible << [e, name] }
174
175
  end
176
+
175
177
  possible.each do |engine, template|
176
- begin
177
- klass = Tilt[engine]
178
- rescue LoadError
179
- next
180
- end
178
+ klass = Tilt.default_mapping.template_map[engine.to_s] ||
179
+ Tilt.lazy_map[engine.to_s].fetch(0, [])[0]
181
180
 
182
181
  find_template(settings.views, template, klass) do |file|
183
182
  next unless File.exist? file
@@ -241,8 +240,8 @@ module Sinatra
241
240
  :css => [:less, :sass, :scss],
242
241
  :xml => [:builder, :nokogiri],
243
242
  :js => [:coffee],
244
- :html => [:erb, :erubi, :erubis, :haml, :slim, :liquid, :radius, :mab,
245
- :markdown, :textile, :rdoc],
243
+ :html => [:erb, :erubi, :erubis, :haml, :halmit, :slim, :liquid, :radius,
244
+ :mab, :markdown, :textile, :rdoc],
246
245
  :all => (Sinatra::Templates.instance_methods.map(&:to_sym) +
247
246
  [:mab] - [:find_template, :markaby]),
248
247
  :json => [:yajl],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/sinatra/sinatra/graphs/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-22 00:00:00.000000000 Z
11
+ date: 2020-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.7
19
+ version: 2.0.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.7
26
+ version: 2.0.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mustermann
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 2.0.7
75
+ version: 2.0.8
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.7
82
+ version: 2.0.8
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: multi_json
85
85
  requirement: !ruby/object:Gem::Requirement