rasti-web 2.0.0 → 2.0.1

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
- SHA1:
3
- metadata.gz: 0e0fd59bf5aab3c7c0aad0afbd3aa006c1e0db16
4
- data.tar.gz: 71b6c185792fb9e1246211b66b8ebca4a7f05100
2
+ SHA256:
3
+ metadata.gz: d5105988210acdb104ba5ad0088ab6b79083d43e27f29769a77d12c23c8af81f
4
+ data.tar.gz: 4d046ecf2410d04a1a655575c502d8c9b335f761820137ee96ff04fe51319484
5
5
  SHA512:
6
- metadata.gz: e5bcc4400759977cad9a9e2cbe92af7ba993d65e0ce6bcab66a7225e78cc1b5484e03184dfc62c8ccbbdf63d7af618d83568395b72493729c6f3db2f71e3614a
7
- data.tar.gz: 983d1a6f8ddfcdcf3456f74f16bf36266cb5cdb75a2f945844a369cd4ee8942f5066bed600263afc1bca87e9cb2fb5773d900ba3d9ec9db3df2dca40d77ed280
6
+ metadata.gz: 455368d0bd93f5c0b0a385a31165ecc089247d2c33359a328302556cb88201719c7103ded8a647cfbeda87badb280057e820d75eb9c178d7488c9f86375c6bb1
7
+ data.tar.gz: 8ab0436ee72e1a20f267cc2f7f87be68bffe46ce6438a870381ab94e4551e708c581841d1eda67d9de60445a5f2e598081d4c48e9f1499d87c2fdb6826bd08d3
@@ -1 +1 @@
1
- ruby-2.4.0
1
+ ruby-2.5.7
@@ -4,11 +4,12 @@ rvm:
4
4
  - 2.0
5
5
  - 2.1
6
6
  - 2.2
7
- - 2.3.0
8
- - 2.4.0
9
- - 2.5.0
10
- - 2.6.0
11
- - jruby-9.1.7.0
7
+ - 2.3
8
+ - 2.4
9
+ - 2.5
10
+ - 2.6
11
+ - 2.7
12
+ - jruby-9.2.9.0
12
13
  - ruby-head
13
14
  - jruby-head
14
15
 
@@ -16,8 +17,4 @@ matrix:
16
17
  fast_finish: true
17
18
  allow_failures:
18
19
  - rvm: ruby-head
19
- - rvm: jruby-head
20
-
21
- before_install:
22
- - rvm all-gemsets do gem uninstall bundler -ax || true
23
- - gem install bundler -v "< 2"
20
+ - rvm: jruby-head
@@ -20,7 +20,7 @@ module Rasti
20
20
  end
21
21
 
22
22
  def json?
23
- content_type && ContentType.parse(content_type).mime_type == 'application/json'
23
+ !content_type.nil? && ContentType.parse(content_type).mime_type == 'application/json'
24
24
  rescue
25
25
  false
26
26
  end
@@ -1,5 +1,5 @@
1
1
  module Rasti
2
2
  module Web
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
4
4
  end
5
5
  end
@@ -26,9 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'content-type', '~> 0.0'
27
27
  spec.add_dependency 'class_ancestry_sort', '~> 0.1'
28
28
 
29
- spec.add_development_dependency 'bundler', '~> 1.12'
30
29
  spec.add_development_dependency 'rake', '~> 11.0'
31
- spec.add_development_dependency 'minitest', '~> 5.0'
30
+ spec.add_development_dependency 'minitest', '~> 5.0', '< 5.11'
32
31
  spec.add_development_dependency 'minitest-colorin', '~> 0.1'
33
32
  spec.add_development_dependency 'minitest-line', '~> 0.6'
34
33
  spec.add_development_dependency 'simplecov', '~> 0.12'
@@ -30,24 +30,38 @@ describe Rasti::Web::Request do
30
30
  request.params['lon'].must_equal '20'
31
31
  end
32
32
 
33
- it 'Json body params' do
34
- env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}', 'CONTENT_TYPE' => 'application/json'
33
+ describe 'Json body params' do
35
34
 
36
- request = Rasti::Web::Request.new env
35
+ it 'Valid content type' do
36
+ env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}', 'CONTENT_TYPE' => 'application/json'
37
37
 
38
- request.must_be :json?
39
- request.params[:lat].must_equal 10
40
- request.params['lon'].must_equal 20
41
- end
38
+ request = Rasti::Web::Request.new env
42
39
 
43
- it 'No json body params' do
44
- env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}', 'CONTENT_TYPE' => 'other/type'
40
+ request.json?.must_equal true
41
+ request.params[:lat].must_equal 10
42
+ request.params['lon'].must_equal 20
43
+ end
45
44
 
46
- request = Rasti::Web::Request.new env
45
+ it 'Invalid content type' do
46
+ env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}', 'CONTENT_TYPE' => 'other/type'
47
+
48
+ request = Rasti::Web::Request.new env
49
+
50
+ request.json?.must_equal false
51
+ request.params[:lat].must_be_nil
52
+ request.params['lon'].must_be_nil
53
+ end
54
+
55
+ it 'Undefined content type' do
56
+ env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}'
57
+
58
+ request = Rasti::Web::Request.new env
59
+
60
+ request.json?.must_equal false
61
+ request.params[:lat].must_be_nil
62
+ request.params['lon'].must_be_nil
63
+ end
47
64
 
48
- request.wont_be :json?
49
- request.params[:lat].must_be_nil
50
- request.params['lon'].must_be_nil
51
65
  end
52
66
 
53
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasti-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-30 00:00:00.000000000 Z
11
+ date: 2020-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -108,20 +108,6 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.1'
111
- - !ruby/object:Gem::Dependency
112
- name: bundler
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.12'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '1.12'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: rake
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -143,6 +129,9 @@ dependencies:
143
129
  - - "~>"
144
130
  - !ruby/object:Gem::Version
145
131
  version: '5.0'
132
+ - - "<"
133
+ - !ruby/object:Gem::Version
134
+ version: '5.11'
146
135
  type: :development
147
136
  prerelease: false
148
137
  version_requirements: !ruby/object:Gem::Requirement
@@ -150,6 +139,9 @@ dependencies:
150
139
  - - "~>"
151
140
  - !ruby/object:Gem::Version
152
141
  version: '5.0'
142
+ - - "<"
143
+ - !ruby/object:Gem::Version
144
+ version: '5.11'
153
145
  - !ruby/object:Gem::Dependency
154
146
  name: minitest-colorin
155
147
  requirement: !ruby/object:Gem::Requirement
@@ -299,8 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
291
  - !ruby/object:Gem::Version
300
292
  version: '0'
301
293
  requirements: []
302
- rubyforge_project:
303
- rubygems_version: 2.6.8
294
+ rubygems_version: 3.0.6
304
295
  signing_key:
305
296
  specification_version: 4
306
297
  summary: Web blocks to build robust applications