sinatra 2.0.0.rc1 → 2.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sinatra might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/LICENSE +2 -0
- data/lib/sinatra/base.rb +13 -6
- data/lib/sinatra/version.rb +1 -1
- data/sinatra.gemspec +12 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd75c727db7b65c390511a4adeb420a6d8a93e18
|
4
|
+
data.tar.gz: a0be265c79512e4f331270bf1fb71af08a06ee1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6de783030b6c39cd7d3f0bab6dc7789fc83d714c41f52f89a953014798dfcf4d8c98565a2df4ac53165d077a98c3431b448a89754a7b3a6d029eb83415df5c2
|
7
|
+
data.tar.gz: 3bc6a1b14338af6e723bbdd07dd22ffed9058def429183be213df539cf5b3ec04bb021eb40adae0f66266c8883a827963e42f118ea8eeb4d16f65765111a1909
|
data/LICENSE
CHANGED
data/lib/sinatra/base.rb
CHANGED
@@ -240,6 +240,18 @@ module Sinatra
|
|
240
240
|
def http_status; 404 end
|
241
241
|
end
|
242
242
|
|
243
|
+
class IndifferentHash < Hash
|
244
|
+
def [](key)
|
245
|
+
value = super(key)
|
246
|
+
return super(key.to_s) if value.nil? && Symbol === key
|
247
|
+
value
|
248
|
+
end
|
249
|
+
|
250
|
+
def has_key?(key)
|
251
|
+
super(key) || (Symbol === key && super(key.to_s))
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
243
255
|
# Methods available to routes, before/after filters, and views.
|
244
256
|
module Helpers
|
245
257
|
# Set or retrieve the response status code.
|
@@ -1070,7 +1082,7 @@ module Sinatra
|
|
1070
1082
|
def indifferent_params(object)
|
1071
1083
|
case object
|
1072
1084
|
when Hash
|
1073
|
-
new_hash =
|
1085
|
+
new_hash = IndifferentHash.new
|
1074
1086
|
object.each { |key, value| new_hash[key] = indifferent_params(value) }
|
1075
1087
|
new_hash
|
1076
1088
|
when Array
|
@@ -1080,11 +1092,6 @@ module Sinatra
|
|
1080
1092
|
end
|
1081
1093
|
end
|
1082
1094
|
|
1083
|
-
# Creates a Hash with indifferent access.
|
1084
|
-
def indifferent_hash
|
1085
|
-
Hash.new { |hash, key| hash[key.to_s] if Symbol === key }
|
1086
|
-
end
|
1087
|
-
|
1088
1095
|
# Run the block with 'throw :halt' support and apply result to the response.
|
1089
1096
|
def invoke
|
1090
1097
|
res = catch(:halt) { yield }
|
data/lib/sinatra/version.rb
CHANGED
data/sinatra.gemspec
CHANGED
@@ -8,7 +8,17 @@ Gem::Specification.new 'sinatra', Sinatra::VERSION do |s|
|
|
8
8
|
s.email = "sinatrarb@googlegroups.com"
|
9
9
|
s.homepage = "http://www.sinatrarb.com/"
|
10
10
|
s.license = 'MIT'
|
11
|
-
s.files
|
11
|
+
s.files = Dir['README*.md', 'lib/**/*', 'examples/*'] + [
|
12
|
+
".yardopts",
|
13
|
+
"AUTHORS.md",
|
14
|
+
"CHANGELOG.md",
|
15
|
+
"CONTRIBUTING.md",
|
16
|
+
"Gemfile",
|
17
|
+
"LICENSE",
|
18
|
+
"MAINTENANCE.md",
|
19
|
+
"Rakefile",
|
20
|
+
"SECURITY.md",
|
21
|
+
"sinatra.gemspec"]
|
12
22
|
s.test_files = s.files.select { |p| p =~ /^test\/.*_test.rb/ }
|
13
23
|
s.extra_rdoc_files = s.files.select { |p| p =~ /^README/ } << 'LICENSE'
|
14
24
|
s.rdoc_options = %w[--line-numbers --inline-source --title Sinatra --main README.rdoc --encoding=UTF-8]
|
@@ -17,6 +27,6 @@ Gem::Specification.new 'sinatra', Sinatra::VERSION do |s|
|
|
17
27
|
|
18
28
|
s.add_dependency 'rack', '~> 2.0'
|
19
29
|
s.add_dependency 'tilt', '~> 2.0'
|
20
|
-
s.add_dependency 'rack-protection', '2.0.0.
|
30
|
+
s.add_dependency 'rack-protection', '2.0.0.rc2'
|
21
31
|
s.add_dependency 'mustermann', '1.0.0'
|
22
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Mizerany
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-03-
|
14
|
+
date: 2017-03-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rack
|
@@ -47,14 +47,14 @@ dependencies:
|
|
47
47
|
requirements:
|
48
48
|
- - '='
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 2.0.0.
|
50
|
+
version: 2.0.0.rc2
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - '='
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 2.0.0.
|
57
|
+
version: 2.0.0.rc2
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: mustermann
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: 1.3.1
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
149
|
+
rubygems_version: 2.6.8
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Classy web-development dressed in a DSL
|