cuba 3.9.3 → 4.0.0

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: 0dd5ceaab614b795ad92e63b73c2d1d3359455a7970c703a366c781fc2b983ea
4
- data.tar.gz: aa14c451bcfff884a710dd41105f1fc1ec24d03ab2dfb3ec25b264f3a136f2c7
3
+ metadata.gz: 7d1132f58ee467460030f12c618ab68ec947bb83d8b20df22588475d37e95994
4
+ data.tar.gz: 7e73fb3214fa781d9a5564d780d3a0a4e6e32ba1833ce55e286ab62b75002b04
5
5
  SHA512:
6
- metadata.gz: 970cab90c32a0c39862e79087f5740debd0d5d264b6bca0c6d94d60fee73645dc34e9c634459d9c952316f6000328f23f137d2f908a4e6e08a7040fecf1f667d
7
- data.tar.gz: cbc70d253a2951d31d6f82c0fb8bb25e687817d687a0508d8ddd960bec9f43d062b680bd9221503a58f60fb3d594b51ff51668f594e4022b04c416148169d5c1
6
+ metadata.gz: 046baecf8b875441123af6279840efa324757e9579324e5accc5f39b5d5f1df01be38c07af2e08c164f2a55e611c7653282239bbc3fd558feb6290a658c46eb1
7
+ data.tar.gz: b2812bc154953daa7e84972d1380aaaf68612e3f7162389315932404614e625a0a002ab21ba13c76c77727694a6b4696810206927a7798c600cce0aff70fa3c2
data/.gems CHANGED
@@ -1,4 +1,5 @@
1
- rack -v 2.2.3
2
- rack-test -v 1.1.0
3
1
  cutest -v 1.2.3
4
2
  tilt -v 2.0.10
3
+ rack -v 3.0.2
4
+ rack-test -v 2.0.2
5
+ rack-session -v 0.3.0
data/cuba.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cuba"
3
- s.version = "3.9.3"
3
+ s.version = "4.0.0"
4
4
  s.summary = "Microframework for web applications."
5
5
  s.description = "Cuba is a microframework for web applications."
6
6
  s.authors = ["Michel Martens"]
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
 
11
11
  s.files = `git ls-files`.split("\n")
12
12
 
13
- s.add_dependency "rack", ">= 1.6.0"
13
+ s.add_dependency "rack", ">= 3.0.0"
14
14
  s.add_development_dependency "cutest"
15
15
  s.add_development_dependency "rack-test"
16
16
  s.add_development_dependency "tilt"
@@ -22,7 +22,7 @@ class Cuba
22
22
 
23
23
  def safe?
24
24
  return req.get? || req.head? ||
25
- req[:csrf_token] == token ||
25
+ req.params["csrf_token"] == token ||
26
26
  req.env["HTTP_X_CSRF_TOKEN"] == token
27
27
  end
28
28
 
data/lib/cuba.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "delegate"
2
2
  require "rack"
3
+ require "rack/session"
3
4
 
4
5
  class Cuba
5
6
  SLASH = "/".freeze
data/test/accept.rb CHANGED
@@ -3,7 +3,7 @@ require File.expand_path("helper", File.dirname(__FILE__))
3
3
  test "accept mimetypes" do
4
4
  Cuba.define do
5
5
  on accept("application/xml") do
6
- res.write res["Content-Type"]
6
+ res.write res["content-type"]
7
7
  end
8
8
  end
9
9
 
data/test/cookie.rb CHANGED
@@ -13,7 +13,7 @@ test "set cookie" do
13
13
 
14
14
  _, headers, body = Cuba.call(env)
15
15
 
16
- assert_equal "foo=bar\nbar=baz", headers["Set-Cookie"]
16
+ assert_equal ["foo=bar", "bar=baz"], headers["set-cookie"]
17
17
  end
18
18
 
19
19
  test "delete cookie" do
@@ -29,6 +29,6 @@ test "delete cookie" do
29
29
 
30
30
  _, headers, body = Cuba.call(env)
31
31
 
32
- assert_equal "foo=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT",
33
- headers["Set-Cookie"]
32
+ assert_equal ["foo=bar", "foo=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"],
33
+ headers["set-cookie"]
34
34
  end
data/test/csrf.rb CHANGED
@@ -13,7 +13,8 @@ scope do
13
13
  setup do
14
14
  Cuba.reset!
15
15
 
16
- Cuba.use(Rack::Session::Cookie, secret: "_this_must_be_secret")
16
+ Cuba.use(Rack::Session::Cookie,
17
+ secret: "R6zSBQWz0VGVSwvT8THurhJwaVqzpnsH27J5FoI58pxoIciDQYvE4opVvDTLMyfjj7c5inIc6PDNaQWvArMvK3")
17
18
  Cuba.plugin(Cuba::Safe::CSRF)
18
19
  end
19
20
 
data/test/integration.rb CHANGED
@@ -78,7 +78,7 @@ test "reset and use" do
78
78
  status, headers, resp = Cuba.call(env)
79
79
 
80
80
  assert_equal 200, status
81
- assert "text/html; charset=utf-8" == headers["Content-Type"]
81
+ assert "text/html; charset=utf-8" == headers["content-type"]
82
82
  assert_response resp, ["2nd Default"]
83
83
 
84
84
  assert "1" == env["m.first"]
@@ -109,6 +109,6 @@ test "custom response" do
109
109
  status, headers, resp = Cuba.call(env)
110
110
 
111
111
  assert 200 == status
112
- assert "text/html; charset=utf-8" == headers["Content-Type"]
112
+ assert "text/html; charset=utf-8" == headers["content-type"]
113
113
  assert_response resp, ["Default"]
114
114
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuba
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.3
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Martens
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-11 00:00:00.000000000 Z
11
+ date: 2023-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.6.0
19
+ version: 3.0.0
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: 1.6.0
26
+ version: 3.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cutest
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -137,7 +137,7 @@ homepage: https://github.com/soveran/cuba
137
137
  licenses:
138
138
  - MIT
139
139
  metadata: {}
140
- post_install_message:
140
+ post_install_message:
141
141
  rdoc_options: []
142
142
  require_paths:
143
143
  - lib
@@ -152,8 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubygems_version: 3.1.2
156
- signing_key:
155
+ rubygems_version: 3.0.3.1
156
+ signing_key:
157
157
  specification_version: 4
158
158
  summary: Microframework for web applications.
159
159
  test_files: []