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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bc8c935df76dce2703fe415857bb3f700d527c32ee59cc0e59a508f5470aef8
4
- data.tar.gz: 1fed2d81850f8dc28e9aafa8d012f2236dc2b7450db793916245f84949d49199
3
+ metadata.gz: 21cbdbcabed8fc3f6fb8c84c40845fab6e8b8dfbe3c4d72b99aa22183b1e054e
4
+ data.tar.gz: d1ea4c3d1c57a87e3a77a1ead41c7b9e7e62e36de10554b844e42595e1266966
5
5
  SHA512:
6
- metadata.gz: '095b5f6cd4651b1dabfd26bea49a2993738720b6b7346bd4b6cae01de7aaf610e196935c15fca504e7d37fa8dbf134924d1ea7d7f793ad8b35822680ddc0401a'
7
- data.tar.gz: fa9417ce89cf28562aad917f129dc7cafd1791a443e2dec81b7123faf9968649aed347043efdc0a594925559e9b076168e4727cb74119314e26976b2f95e3240
6
+ metadata.gz: 1452a646d9707f65ae1d3ae23dfb41718de01b5483f141db83f515a260a34409a4fec8e5f36ddc8ee8e14eb5761142fc61e02d3cee995f76922c8652b1a37831
7
+ data.tar.gz: 952cbbe582f0f6426a81404fbcab10629eaa4f48be477ddce5af5f0e1470ee148f47b84f2ed95a5f428568d292923c6e57abd1bbe672a786ef47e98e70ddfb8b
@@ -8,7 +8,7 @@ jobs:
8
8
  fail-fast: false
9
9
  matrix:
10
10
  os: [ubuntu-latest, macos-latest]
11
- ruby: ['2.7', '3.0', '3.1', 'head']
11
+ ruby: ['3.2', '3.3', '3.4']
12
12
 
13
13
  name: >-
14
14
  ${{matrix.os}}, ${{matrix.ruby}}
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.18 2025-06-15
2
+
3
+ - Fix behaviour of App resource for not found paths
4
+
1
5
  ## 0.17 2025-01-09
2
6
 
3
7
  - Update deps, cleanup tests
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.4)
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.0)
30
- rouge (4.5.1)
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 = '>= 2.6'
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'
@@ -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
- mod_path_info = up_tree_resource_module_path_info(req, path_info)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Impression
4
- VERSION = '0.17'
4
+ VERSION = '0.18'
5
5
  end
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.response_body
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)
@@ -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.response_body
168
+ assert_equal 'foobar', req.adapter.body
169
169
  assert_equal 'bar', req.response_headers['Foo']
170
170
  end
171
171
  end
@@ -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.response_body
13
+ assert_equal 'foobar', req.adapter.body
14
14
  assert_equal Qeweney::Status::TEAPOT, req.response_status
15
15
  end
16
16
 
@@ -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.response_body
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.response_body
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.response_body
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.response_body
46
+ assert_equal 'path: /foo/bar', req.adapter.body
47
47
  end
48
48
  end
@@ -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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.response_body
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.17'
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: 2025-01-09 00:00:00.000000000 Z
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: '2.6'
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.2
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: []