impression 0.16 → 0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +19 -19
- data/impression.gemspec +7 -9
- data/lib/impression/rack_app.rb +32 -2
- data/lib/impression/version.rb +1 -1
- data/test/helper.rb +2 -2
- data/test/test_app.rb +2 -3
- data/test/test_file_tree.rb +1 -2
- data/test/test_file_watcher.rb +1 -1
- data/test/test_impression.rb +1 -1
- data/test/test_rack_app.rb +1 -1
- data/test/test_resource.rb +1 -1
- metadata +15 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc8c935df76dce2703fe415857bb3f700d527c32ee59cc0e59a508f5470aef8
|
4
|
+
data.tar.gz: 1fed2d81850f8dc28e9aafa8d012f2236dc2b7450db793916245f84949d49199
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '095b5f6cd4651b1dabfd26bea49a2993738720b6b7346bd4b6cae01de7aaf610e196935c15fca504e7d37fa8dbf134924d1ea7d7f793ad8b35822680ddc0401a'
|
7
|
+
data.tar.gz: fa9417ce89cf28562aad917f129dc7cafd1791a443e2dec81b7123faf9968649aed347043efdc0a594925559e9b076168e4727cb74119314e26976b2f95e3240
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,40 +1,40 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
impression (0.
|
5
|
-
papercraft (~> 1.
|
6
|
-
qeweney (~> 0.
|
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.
|
17
|
+
minitest (5.25.4)
|
19
18
|
modulation (1.2)
|
20
|
-
papercraft (1.
|
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.
|
24
|
+
sirop (~> 0.5)
|
26
25
|
prism (0.27.0)
|
27
|
-
qeweney (0.
|
28
|
-
escape_utils (
|
29
|
-
rake (
|
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.
|
31
|
+
simplecov (0.22.0)
|
33
32
|
docile (~> 1.1)
|
34
|
-
|
35
|
-
|
36
|
-
simplecov-html (0.
|
37
|
-
|
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.
|
47
|
-
modulation (~> 1.
|
48
|
-
rake (~>
|
49
|
-
simplecov (~> 0.
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
s.
|
27
|
-
|
28
|
-
s.add_development_dependency '
|
29
|
-
s.add_development_dependency '
|
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
|
data/lib/impression/rack_app.rb
CHANGED
@@ -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 =
|
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
|
data/lib/impression/version.rb
CHANGED
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/
|
7
|
+
require 'qeweney/mock_adapter'
|
8
8
|
require 'modulation'
|
9
9
|
|
10
10
|
module Kernel
|
11
11
|
def mock_req(**args)
|
12
|
-
Qeweney::
|
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 <
|
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 <
|
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' => '/')
|
data/test/test_file_tree.rb
CHANGED
data/test/test_file_watcher.rb
CHANGED
data/test/test_impression.rb
CHANGED
data/test/test_rack_app.rb
CHANGED
data/test/test_resource.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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:
|
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:
|
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.
|
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.
|
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.
|
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.
|
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.
|
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: []
|