impression 0.16 → 0.17

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: 5bffd1fd2193a7ece32fa7cfa6b90a709a3fd54ed3f92d9ff93314fd565ba9c2
4
- data.tar.gz: 198b729951f6a0202eb53e6c7703ec7459e22f6bd011de67d408c7258efe6740
3
+ metadata.gz: 5bc8c935df76dce2703fe415857bb3f700d527c32ee59cc0e59a508f5470aef8
4
+ data.tar.gz: 1fed2d81850f8dc28e9aafa8d012f2236dc2b7450db793916245f84949d49199
5
5
  SHA512:
6
- metadata.gz: 9102da1086ce2158a9cd423f6d32bca80f9f2e85f5a64a271c54f373dfba207ad96eec4fa62f5e7dc2ecb5e9d3e16758f2c90885ae02d030219206340e2fddfd
7
- data.tar.gz: 95b007b04f7937763ab5f5f4c827cf48b4670afc2e91ae1caf3bdbba09288ce90251fb4f501f46d201412df4972452eebf7b58f9893c591c97b7fa8ba60317f7
6
+ metadata.gz: '095b5f6cd4651b1dabfd26bea49a2993738720b6b7346bd4b6cae01de7aaf610e196935c15fca504e7d37fa8dbf134924d1ea7d7f793ad8b35822680ddc0401a'
7
+ data.tar.gz: fa9417ce89cf28562aad917f129dc7cafd1791a443e2dec81b7123faf9968649aed347043efdc0a594925559e9b076168e4727cb74119314e26976b2f95e3240
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.17 2025-01-09
2
+
3
+ - Update deps, cleanup tests
4
+
1
5
  ## 0.14 2024-12-11
2
6
 
3
7
  - Remove Polyphony, Tipi deps
data/Gemfile.lock CHANGED
@@ -1,40 +1,40 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- impression (0.16)
5
- papercraft (~> 1.3)
6
- qeweney (~> 0.20)
4
+ impression (0.17)
5
+ papercraft (~> 1.4)
6
+ qeweney (~> 0.21)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  docile (1.4.1)
12
12
  escape_utils (1.3.0)
13
- json (2.9.0)
14
13
  kramdown (2.5.1)
15
14
  rexml (>= 3.3.9)
16
15
  kramdown-parser-gfm (1.1.0)
17
16
  kramdown (~> 2.0)
18
- minitest (5.11.3)
17
+ minitest (5.25.4)
19
18
  modulation (1.2)
20
- papercraft (1.3)
19
+ papercraft (1.4)
21
20
  escape_utils (~> 1.3.0)
22
21
  kramdown (~> 2.5.1)
23
22
  kramdown-parser-gfm (~> 1.1.0)
24
23
  rouge (~> 4.5.1)
25
- sirop (~> 0.4)
24
+ sirop (~> 0.5)
26
25
  prism (0.27.0)
27
- qeweney (0.20)
28
- escape_utils (~> 1.3.0)
29
- rake (12.3.3)
26
+ qeweney (0.21)
27
+ escape_utils (= 1.3.0)
28
+ rake (13.2.1)
30
29
  rexml (3.4.0)
31
30
  rouge (4.5.1)
32
- simplecov (0.17.1)
31
+ simplecov (0.22.0)
33
32
  docile (~> 1.1)
34
- json (>= 1.8, < 3)
35
- simplecov-html (~> 0.10.0)
36
- simplecov-html (0.10.2)
37
- sirop (0.4)
33
+ simplecov-html (~> 0.11)
34
+ simplecov_json_formatter (~> 0.1)
35
+ simplecov-html (0.13.1)
36
+ simplecov_json_formatter (0.1.4)
37
+ sirop (0.5)
38
38
  prism (~> 0.27.0)
39
39
 
40
40
  PLATFORMS
@@ -43,10 +43,10 @@ PLATFORMS
43
43
 
44
44
  DEPENDENCIES
45
45
  impression!
46
- minitest (~> 5.11.3)
47
- modulation (~> 1.1)
48
- rake (~> 12.3.3)
49
- simplecov (~> 0.17.1)
46
+ minitest (~> 5.25.4)
47
+ modulation (~> 1.2)
48
+ rake (~> 13.2.1)
49
+ simplecov (~> 0.22.0)
50
50
 
51
51
  BUNDLED WITH
52
52
  2.5.22
data/impression.gemspec CHANGED
@@ -20,13 +20,11 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
  s.required_ruby_version = '>= 2.6'
22
22
 
23
- # s.add_runtime_dependency 'polyphony', '~>0.93'
24
- # s.add_runtime_dependency 'tipi', '~>0.52'
25
- s.add_runtime_dependency 'qeweney', '~>0.20'
26
- s.add_runtime_dependency 'papercraft', '~>1.3'
27
-
28
- s.add_development_dependency 'modulation', '~>1.1'
29
- s.add_development_dependency 'rake', '~>12.3.3'
30
- s.add_development_dependency 'minitest', '~>5.11.3'
31
- s.add_development_dependency 'simplecov', '~>0.17.1'
23
+ s.add_runtime_dependency 'qeweney', '~>0.21'
24
+ s.add_runtime_dependency 'papercraft', '~>1.4'
25
+
26
+ s.add_development_dependency 'modulation', '~>1.2'
27
+ s.add_development_dependency 'rake', '~>13.2.1'
28
+ s.add_development_dependency 'minitest', '~>5.25.4'
29
+ s.add_development_dependency 'simplecov', '~>0.22.0'
32
30
  end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'fileutils'
4
- # require 'tipi'
5
4
  require_relative './resource'
6
5
 
7
6
  module Impression
@@ -14,7 +13,7 @@ module Impression
14
13
  # We pass nil as the block, otherwise the block will pass to
15
14
  # Resource#initialize, which will cause #call to be overidden.
16
15
  super(**props, &nil)
17
- @handler = Tipi::RackAdapter.run(app || block)
16
+ @handler = RackAdapter.run(app || block)
18
17
  end
19
18
 
20
19
  def call(req)
@@ -24,4 +23,35 @@ module Impression
24
23
  @handler.(req)
25
24
  end
26
25
  end
26
+
27
+ module RackAdapter
28
+ class << self
29
+ def run(app)
30
+ ->(req) { respond(req, app.(env(req))) }
31
+ end
32
+
33
+ def load(path)
34
+ src = IO.read(path)
35
+ instance_eval(src, path, 1)
36
+ end
37
+
38
+ def env(request)
39
+ Qeweney.rack_env_from_request(request)
40
+ end
41
+
42
+ def respond(request, (status_code, headers, body))
43
+ headers[':status'] = status_code.to_s
44
+
45
+ content =
46
+ if body.respond_to?(:to_path)
47
+ File.open(body.to_path, 'rb') { |f| f.read }
48
+ else
49
+ body.first
50
+ end
51
+
52
+ request.respond(content, headers)
53
+ end
54
+ end
55
+ end
56
+
27
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Impression
4
- VERSION = '0.16'
4
+ VERSION = '0.17'
5
5
  end
data/test/helper.rb CHANGED
@@ -4,12 +4,12 @@ require 'bundler/setup'
4
4
  require_relative './coverage' if ENV['COVERAGE']
5
5
  require 'minitest/autorun'
6
6
  require 'impression'
7
- require 'qeweney/test_adapter'
7
+ require 'qeweney/mock_adapter'
8
8
  require 'modulation'
9
9
 
10
10
  module Kernel
11
11
  def mock_req(**args)
12
- Qeweney::TestAdapter.mock(**args)
12
+ Qeweney::MockAdapter.mock(**args)
13
13
  end
14
14
 
15
15
  def capture_exception
data/test/test_app.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'helper'
4
- require 'qeweney/test_adapter'
5
4
 
6
- class AppTest < MiniTest::Test
5
+ class AppTest < Minitest::Test
7
6
  APP_PATH = File.join(__dir__, 'app')
8
7
 
9
8
  def setup
@@ -349,7 +348,7 @@ class AppTest < MiniTest::Test
349
348
  end
350
349
  end
351
350
 
352
- class AbstractAppTest < MiniTest::Test
351
+ class AbstractAppTest < Minitest::Test
353
352
  def test_abstract_app_default_response
354
353
  app = Impression::App.new(path: '/')
355
354
  req = mock_req(':method' => 'GET', ':path' => '/')
@@ -1,9 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'helper'
4
- require 'qeweney/test_adapter'
5
4
 
6
- class FileTreeTest < MiniTest::Test
5
+ class FileTreeTest < Minitest::Test
7
6
  STATIC_PATH = File.join(__dir__, 'static')
8
7
 
9
8
  def setup
@@ -3,7 +3,7 @@
3
3
  require_relative 'helper'
4
4
  require 'fileutils'
5
5
 
6
- # class FileWatcherTest < MiniTest::Test
6
+ # class FileWatcherTest < Minitest::Test
7
7
  # def setup
8
8
  # @tmp_path = File.expand_path('../tmp', __dir__)
9
9
  # FileUtils.mkdir(@tmp_path)
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative 'helper'
4
4
 
5
- class ImpressionModuleTest < MiniTest::Test
5
+ class ImpressionModuleTest < Minitest::Test
6
6
  def test_resource_method
7
7
  r1 = Impression.resource do |req|
8
8
  req.respond('foobar', ':status' => Qeweney::Status::TEAPOT)
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative 'helper'
4
4
 
5
- class RackAppTest < MiniTest::Test
5
+ class RackAppTest < Minitest::Test
6
6
  def test_basic_rack_app
7
7
  app = Impression.rack_app(path: '/etc/rack') { |env|
8
8
  [
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative 'helper'
4
4
 
5
- class ResourceTest < MiniTest::Test
5
+ class ResourceTest < Minitest::Test
6
6
  def test_absolute_path
7
7
  r1 = Impression::Resource.new(path: 'foo')
8
8
  assert_equal '/foo', r1.absolute_path
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: impression
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.16'
4
+ version: '0.17'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-16 00:00:00.000000000 Z
10
+ date: 2025-01-09 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: qeweney
@@ -16,85 +15,84 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '0.20'
18
+ version: '0.21'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '0.20'
25
+ version: '0.21'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: papercraft
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '1.3'
32
+ version: '1.4'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '1.3'
39
+ version: '1.4'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: modulation
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: '1.1'
46
+ version: '1.2'
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: '1.1'
53
+ version: '1.2'
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: rake
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: 12.3.3
60
+ version: 13.2.1
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: 12.3.3
67
+ version: 13.2.1
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: minitest
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: 5.11.3
74
+ version: 5.25.4
76
75
  type: :development
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: 5.11.3
81
+ version: 5.25.4
83
82
  - !ruby/object:Gem::Dependency
84
83
  name: simplecov
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - "~>"
88
87
  - !ruby/object:Gem::Version
89
- version: 0.17.1
88
+ version: 0.22.0
90
89
  type: :development
91
90
  prerelease: false
92
91
  version_requirements: !ruby/object:Gem::Requirement
93
92
  requirements:
94
93
  - - "~>"
95
94
  - !ruby/object:Gem::Version
96
- version: 0.17.1
97
- description:
95
+ version: 0.22.0
98
96
  email: sharon@noteflakes.com
99
97
  executables: []
100
98
  extensions: []
@@ -161,7 +159,6 @@ metadata:
161
159
  documentation_uri: https://www.rubydoc.info/gems/impression
162
160
  homepage_uri: https://github.com/digital-fabric/impression
163
161
  changelog_uri: https://github.com/digital-fabric/impression/blob/master/CHANGELOG.md
164
- post_install_message:
165
162
  rdoc_options:
166
163
  - "--title"
167
164
  - impression
@@ -180,8 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
177
  - !ruby/object:Gem::Version
181
178
  version: '0'
182
179
  requirements: []
183
- rubygems_version: 3.5.16
184
- signing_key:
180
+ rubygems_version: 3.6.2
185
181
  specification_version: 4
186
182
  summary: Impression - a modern web framework for Ruby
187
183
  test_files: []