impression 0.17 → 0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +3 -3
- data/impression.gemspec +1 -1
- data/lib/impression/app.rb +1 -6
- data/lib/impression/version.rb +1 -1
- data/test/helper.rb +1 -5
- data/test/test_app.rb +6 -6
- data/test/test_file_tree.rb +1 -1
- data/test/test_impression.rb +1 -1
- data/test/test_rack_app.rb +4 -4
- data/test/test_resource.rb +14 -14
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21cbdbcabed8fc3f6fb8c84c40845fab6e8b8dfbe3c4d72b99aa22183b1e054e
|
4
|
+
data.tar.gz: d1ea4c3d1c57a87e3a77a1ead41c7b9e7e62e36de10554b844e42595e1266966
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1452a646d9707f65ae1d3ae23dfb41718de01b5483f141db83f515a260a34409a4fec8e5f36ddc8ee8e14eb5761142fc61e02d3cee995f76922c8652b1a37831
|
7
|
+
data.tar.gz: 952cbbe582f0f6426a81404fbcab10629eaa4f48be477ddce5af5f0e1470ee148f47b84f2ed95a5f428568d292923c6e57abd1bbe672a786ef47e98e70ddfb8b
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
rexml (>= 3.3.9)
|
15
15
|
kramdown-parser-gfm (1.1.0)
|
16
16
|
kramdown (~> 2.0)
|
17
|
-
minitest (5.25.
|
17
|
+
minitest (5.25.5)
|
18
18
|
modulation (1.2)
|
19
19
|
papercraft (1.4)
|
20
20
|
escape_utils (~> 1.3.0)
|
@@ -26,8 +26,8 @@ GEM
|
|
26
26
|
qeweney (0.21)
|
27
27
|
escape_utils (= 1.3.0)
|
28
28
|
rake (13.2.1)
|
29
|
-
rexml (3.4.
|
30
|
-
rouge (4.5.
|
29
|
+
rexml (3.4.1)
|
30
|
+
rouge (4.5.2)
|
31
31
|
simplecov (0.22.0)
|
32
32
|
docile (~> 1.1)
|
33
33
|
simplecov-html (~> 0.11)
|
data/impression.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.rdoc_options = ["--title", "impression", "--main", "README.md"]
|
19
19
|
s.extra_rdoc_files = ["README.md"]
|
20
20
|
s.require_paths = ["lib"]
|
21
|
-
s.required_ruby_version = '>=
|
21
|
+
s.required_ruby_version = '>= 3.3'
|
22
22
|
|
23
23
|
s.add_runtime_dependency 'qeweney', '~>0.21'
|
24
24
|
s.add_runtime_dependency 'papercraft', '~>1.4'
|
data/lib/impression/app.rb
CHANGED
@@ -145,12 +145,7 @@ module Impression
|
|
145
145
|
def render_from_path_info(req, path_info)
|
146
146
|
case (kind = path_info[:kind])
|
147
147
|
when :not_found
|
148
|
-
|
149
|
-
if mod_path_info
|
150
|
-
render_module(req, mod_path_info)
|
151
|
-
else
|
152
|
-
req.respond(nil, ':status' => Qeweney::Status::NOT_FOUND)
|
153
|
-
end
|
148
|
+
req.respond(nil, ':status' => Qeweney::Status::NOT_FOUND)
|
154
149
|
when :module
|
155
150
|
render_module(req, path_info)
|
156
151
|
when :markdown
|
data/lib/impression/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -46,7 +46,7 @@ module Minitest::Assertions
|
|
46
46
|
msg = message(msg) { "Expected HTTP status 200 OK, but instead got #{status}" }
|
47
47
|
assert_equal 200, status, msg
|
48
48
|
|
49
|
-
actual = req.
|
49
|
+
actual = req.adapter.body
|
50
50
|
assert_equal exp_body.gsub("\n", ''), actual&.gsub("\n", '')
|
51
51
|
|
52
52
|
return unless exp_content_type
|
@@ -83,10 +83,6 @@ class Qeweney::Request
|
|
83
83
|
adapter.headers
|
84
84
|
end
|
85
85
|
|
86
|
-
def response_body
|
87
|
-
adapter.body
|
88
|
-
end
|
89
|
-
|
90
86
|
def response_status
|
91
87
|
adapter.status
|
92
88
|
end
|
data/test/test_app.rb
CHANGED
@@ -322,9 +322,9 @@ class AppTest < Minitest::Test
|
|
322
322
|
@app.route_and_call(req)
|
323
323
|
assert_response 'Hello, world!', :text, req
|
324
324
|
|
325
|
-
req = mock_req(':method' => 'GET', ':path' => '/resources/recurse/resources/greeter?name=foo')
|
326
|
-
@app.route_and_call(req)
|
327
|
-
assert_response 'Hello, foo!', :text, req
|
325
|
+
# req = mock_req(':method' => 'GET', ':path' => '/resources/recurse/resources/greeter?name=foo')
|
326
|
+
# @app.route_and_call(req)
|
327
|
+
# assert_response 'Hello, foo!', :text, req
|
328
328
|
end
|
329
329
|
|
330
330
|
def test_recursive_resource_loading_on_non_root_app
|
@@ -338,9 +338,9 @@ class AppTest < Minitest::Test
|
|
338
338
|
app.route_and_call(req)
|
339
339
|
assert_response 'Hello, world!', :text, req
|
340
340
|
|
341
|
-
req = mock_req(':method' => 'GET', ':path' => '/foo/bar/resources/recurse/resources/greeter?name=foo')
|
342
|
-
app.route_and_call(req)
|
343
|
-
assert_response 'Hello, foo!', :text, req
|
341
|
+
# req = mock_req(':method' => 'GET', ':path' => '/foo/bar/resources/recurse/resources/greeter?name=foo')
|
342
|
+
# app.route_and_call(req)
|
343
|
+
# assert_response 'Hello, foo!', :text, req
|
344
344
|
|
345
345
|
# req = mock_req(':method' => 'GET', ':path' => '/foo/bar/resources/recurse/bar')
|
346
346
|
# @app.route_and_call(req)
|
data/test/test_file_tree.rb
CHANGED
@@ -165,7 +165,7 @@ class FileTreeTest < Minitest::Test
|
|
165
165
|
req = mock_req(':method' => 'GET', ':path' => '/foobar')
|
166
166
|
@file_tree.route_and_call(req)
|
167
167
|
assert_equal Qeweney::Status::OK, req.response_status
|
168
|
-
assert_equal 'foobar', req.
|
168
|
+
assert_equal 'foobar', req.adapter.body
|
169
169
|
assert_equal 'bar', req.response_headers['Foo']
|
170
170
|
end
|
171
171
|
end
|
data/test/test_impression.rb
CHANGED
@@ -10,7 +10,7 @@ class ImpressionModuleTest < Minitest::Test
|
|
10
10
|
|
11
11
|
req = mock_req(':method' => 'GET', ':path' => '/')
|
12
12
|
r1.route_and_call(req)
|
13
|
-
assert_equal 'foobar', req.
|
13
|
+
assert_equal 'foobar', req.adapter.body
|
14
14
|
assert_equal Qeweney::Status::TEAPOT, req.response_status
|
15
15
|
end
|
16
16
|
|
data/test/test_rack_app.rb
CHANGED
@@ -19,7 +19,7 @@ class RackAppTest < Minitest::Test
|
|
19
19
|
app.route_and_call(req)
|
20
20
|
assert_equal '200', req.response_status
|
21
21
|
assert_equal 'text/plain', req.response_headers['Content-Type']
|
22
|
-
assert_equal 'Hello, world!', req.
|
22
|
+
assert_equal 'Hello, world!', req.adapter.body
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_path_rewriting
|
@@ -29,7 +29,7 @@ class RackAppTest < Minitest::Test
|
|
29
29
|
|
30
30
|
req = mock_req(':method' => 'GET', ':path' => '/foo/bar')
|
31
31
|
app.route_and_call(req)
|
32
|
-
assert_equal 'path: /foo/bar', req.
|
32
|
+
assert_equal 'path: /foo/bar', req.adapter.body
|
33
33
|
|
34
34
|
###
|
35
35
|
|
@@ -39,10 +39,10 @@ class RackAppTest < Minitest::Test
|
|
39
39
|
|
40
40
|
req = mock_req(':method' => 'GET', ':path' => '/etc/rack')
|
41
41
|
app.route_and_call(req)
|
42
|
-
assert_equal 'path: /', req.
|
42
|
+
assert_equal 'path: /', req.adapter.body
|
43
43
|
|
44
44
|
req = mock_req(':method' => 'GET', ':path' => '/etc/rack/foo/bar')
|
45
45
|
app.route_and_call(req)
|
46
|
-
assert_equal 'path: /foo/bar', req.
|
46
|
+
assert_equal 'path: /foo/bar', req.adapter.body
|
47
47
|
end
|
48
48
|
end
|
data/test/test_resource.rb
CHANGED
@@ -84,11 +84,11 @@ class ResourceTest < Minitest::Test
|
|
84
84
|
|
85
85
|
req = mock_req(':method' => 'GET', ':path' => '/foo/bar')
|
86
86
|
r1.route_and_call(req)
|
87
|
-
assert_equal '/foo/bar', req.
|
87
|
+
assert_equal '/foo/bar', req.adapter.body
|
88
88
|
|
89
89
|
req = mock_req(':method' => 'GET', ':path' => '/foo/baz')
|
90
90
|
r1.route_and_call(req)
|
91
|
-
assert_equal '/foo/baz', req.
|
91
|
+
assert_equal '/foo/baz', req.adapter.body
|
92
92
|
|
93
93
|
req = mock_req(':method' => 'GET', ':path' => '/foo/bbb')
|
94
94
|
assert_equal r1, r1.route(req)
|
@@ -104,27 +104,27 @@ class ResourceTest < Minitest::Test
|
|
104
104
|
|
105
105
|
req = mock_req(':method' => 'GET', ':path' => '/foo')
|
106
106
|
r1.route_and_call(req)
|
107
|
-
assert_equal '/foo /', req.
|
107
|
+
assert_equal '/foo /', req.adapter.body
|
108
108
|
|
109
109
|
req = mock_req(':method' => 'GET', ':path' => '/foo/zzz')
|
110
110
|
r1.route_and_call(req)
|
111
|
-
assert_equal '/foo /zzz', req.
|
111
|
+
assert_equal '/foo /zzz', req.adapter.body
|
112
112
|
|
113
113
|
req = mock_req(':method' => 'GET', ':path' => '/foo/bar')
|
114
114
|
r1.route_and_call(req)
|
115
|
-
assert_equal '/foo/bar /', req.
|
115
|
+
assert_equal '/foo/bar /', req.adapter.body
|
116
116
|
|
117
117
|
req = mock_req(':method' => 'GET', ':path' => '/foo/bar/zzz')
|
118
118
|
r1.route_and_call(req)
|
119
|
-
assert_equal '/foo/bar /zzz', req.
|
119
|
+
assert_equal '/foo/bar /zzz', req.adapter.body
|
120
120
|
|
121
121
|
req = mock_req(':method' => 'GET', ':path' => '/foo/baz')
|
122
122
|
r1.route_and_call(req)
|
123
|
-
assert_equal '/foo/baz /', req.
|
123
|
+
assert_equal '/foo/baz /', req.adapter.body
|
124
124
|
|
125
125
|
req = mock_req(':method' => 'GET', ':path' => '/foo/baz/xxx/yyy')
|
126
126
|
r1.route_and_call(req)
|
127
|
-
assert_equal '/foo/baz /xxx/yyy', req.
|
127
|
+
assert_equal '/foo/baz /xxx/yyy', req.adapter.body
|
128
128
|
end
|
129
129
|
|
130
130
|
class CallableResource < Impression::Resource
|
@@ -144,7 +144,7 @@ class ResourceTest < Minitest::Test
|
|
144
144
|
|
145
145
|
req = mock_req(':method' => 'GET', ':path' => '/foo/bar')
|
146
146
|
r1.route_and_call(req)
|
147
|
-
assert_equal 'hi', req.
|
147
|
+
assert_equal 'hi', req.adapter.body
|
148
148
|
end
|
149
149
|
|
150
150
|
class CallableRouteResource < Impression::Resource
|
@@ -164,7 +164,7 @@ class ResourceTest < Minitest::Test
|
|
164
164
|
|
165
165
|
req = mock_req(':method' => 'GET', ':path' => '/foo/bar')
|
166
166
|
r1.route_and_call(req)
|
167
|
-
assert_equal 'bye', req.
|
167
|
+
assert_equal 'bye', req.adapter.body
|
168
168
|
end
|
169
169
|
|
170
170
|
def test_text_response
|
@@ -185,17 +185,17 @@ class ResourceTest < Minitest::Test
|
|
185
185
|
|
186
186
|
req = mock_req(':method' => 'GET', ':path' => '/text')
|
187
187
|
r.route_and_call(req)
|
188
|
-
assert_equal 'foo', req.
|
188
|
+
assert_equal 'foo', req.adapter.body
|
189
189
|
assert_equal 'text/plain', req.response_content_type
|
190
190
|
|
191
191
|
req = mock_req(':method' => 'GET', ':path' => '/html')
|
192
192
|
r.route_and_call(req)
|
193
|
-
assert_equal 'bar', req.
|
193
|
+
assert_equal 'bar', req.adapter.body
|
194
194
|
assert_equal 'text/html', req.response_content_type
|
195
195
|
|
196
196
|
req = mock_req(':method' => 'GET', ':path' => '/json')
|
197
197
|
r.route_and_call(req)
|
198
|
-
assert_equal '{"baz":123}', req.
|
198
|
+
assert_equal '{"baz":123}', req.adapter.body
|
199
199
|
assert_equal 'application/json', req.response_content_type
|
200
200
|
end
|
201
201
|
|
@@ -206,7 +206,7 @@ class ResourceTest < Minitest::Test
|
|
206
206
|
|
207
207
|
req = mock_req(':method' => 'GET', ':path' => '/')
|
208
208
|
r1.route_and_call(req)
|
209
|
-
assert_equal 'foobar', req.
|
209
|
+
assert_equal 'foobar', req.adapter.body
|
210
210
|
assert_equal Qeweney::Status::TEAPOT, req.response_status
|
211
211
|
end
|
212
212
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: impression
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.18'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: qeweney
|
@@ -170,14 +170,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
170
|
requirements:
|
171
171
|
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
173
|
+
version: '3.3'
|
174
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
175
|
requirements:
|
176
176
|
- - ">="
|
177
177
|
- !ruby/object:Gem::Version
|
178
178
|
version: '0'
|
179
179
|
requirements: []
|
180
|
-
rubygems_version: 3.6.
|
180
|
+
rubygems_version: 3.6.8
|
181
181
|
specification_version: 4
|
182
182
|
summary: Impression - a modern web framework for Ruby
|
183
183
|
test_files: []
|