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 +4 -4
- data/lib/sinatra/capture.rb +1 -1
- data/lib/sinatra/config_file.rb +2 -2
- data/lib/sinatra/content_for.rb +1 -1
- data/lib/sinatra/contrib/version.rb +1 -1
- data/lib/sinatra/respond_with.rb +6 -7
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 181cb2475ddb6a42c84126e1723f08b13317fe84e84e34f87c6d825dedb3d50b
|
4
|
+
data.tar.gz: 7195ef32216c40ecc566bdaa62e3f4843b506021af646623c2c0dfb6f151131e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ca55fb88020f784dab9e5d1d47f518ae6c709b2609bd58648d94212e097e493ab8eb09e4ed3520c513da215679eb3a90ae426cbcbf07ef6e3a958790fb11b54
|
7
|
+
data.tar.gz: 459b6a3e00849f5f00ed2904c0b65da24d2cfa1ac7d075eaeed80fe1a45b87dff74a4fbdaa3f7db70f09a7387a944f6e369e13c2b7b0da99cbbeb50178927274
|
data/lib/sinatra/capture.rb
CHANGED
@@ -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
|
data/lib/sinatra/config_file.rb
CHANGED
@@ -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 .
|
137
|
+
'Invalid config file type, use .yml, .yaml or .erb'
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
data/lib/sinatra/content_for.rb
CHANGED
@@ -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|
|
data/lib/sinatra/respond_with.rb
CHANGED
@@ -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
|
-
|
177
|
-
|
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,
|
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.
|
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:
|
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.
|
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.
|
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.
|
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.
|
82
|
+
version: 2.0.8
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: multi_json
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|