artery-browser 0.1.1 → 0.1.3
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/.rubocop.yml +16 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +32 -3
- data/artery-browser.gemspec +3 -1
- data/checksums/artery-browser-0.1.1.gem.sha512 +1 -0
- data/checksums/artery-browser-0.1.2.gem.sha512 +1 -0
- data/lib/artery/browser/app.rb +13 -11
- data/lib/artery/browser/router.rb +1 -1
- data/lib/artery/browser/version.rb +1 -1
- metadata +5 -17
- data/checksums/artery-browser-0.1.0.gem.sha512 +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 360e9041e59a4c540a1e6d2b244e5c76f14742d8e0b8872b2d1d8372eead8f6b
|
|
4
|
+
data.tar.gz: 79be7296890d771d41d95a5c812ffeee4d4ecece19dc1a905b89ca3ebe3ae308
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1da48b10c7fe3bfe311fca343156e04b2d4571877646bc5e3405806677b47b43c45e6d815c901afc6f6379d66b8971bd3889ecfb00cc2b579910792d569792c
|
|
7
|
+
data.tar.gz: 9216ed2b1dd2f2fcaa2b3ca3753444e65da5134930fa46227e8714ff91ff518ad7ce9989f2a434432f6483ff19cbd6e91caa4e5455f6446c0ee09b199a7259fc
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# The behavior of RuboCop can be controlled via the .rubocop.yml
|
|
2
|
+
# configuration file. It makes it possible to enable/disable
|
|
3
|
+
# certain cops (checks) and to alter their behavior if they accept
|
|
4
|
+
# any parameters. The file can be placed either in your home
|
|
5
|
+
# directory or in some project directory.
|
|
6
|
+
#
|
|
7
|
+
# RuboCop will start looking for the configuration file in the directory
|
|
8
|
+
# where the inspected file is and continue its way up to the root directory.
|
|
9
|
+
#
|
|
10
|
+
# See https://docs.rubocop.org/rubocop/configuration
|
|
11
|
+
|
|
12
|
+
Style/Documentation:
|
|
13
|
+
Enabled: false
|
|
14
|
+
|
|
15
|
+
Metrics/MethodLength:
|
|
16
|
+
Max: 50
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
artery-browser (0.1.
|
|
4
|
+
artery-browser (0.1.2)
|
|
5
5
|
rack (~> 3.2)
|
|
6
|
-
webrick (~> 1.9)
|
|
7
6
|
|
|
8
7
|
GEM
|
|
9
8
|
remote: https://rubygems.org/
|
|
10
9
|
specs:
|
|
10
|
+
ast (2.4.3)
|
|
11
11
|
diff-lcs (1.6.2)
|
|
12
|
+
json (2.16.0)
|
|
13
|
+
language_server-protocol (3.17.0.5)
|
|
14
|
+
lint_roller (1.1.0)
|
|
15
|
+
parallel (1.27.0)
|
|
16
|
+
parser (3.3.10.0)
|
|
17
|
+
ast (~> 2.4.1)
|
|
18
|
+
racc
|
|
19
|
+
prism (1.6.0)
|
|
20
|
+
racc (1.8.1)
|
|
12
21
|
rack (3.2.4)
|
|
13
22
|
rack-test (2.2.0)
|
|
14
23
|
rack (>= 1.3)
|
|
24
|
+
rainbow (3.1.1)
|
|
15
25
|
rake (10.5.0)
|
|
26
|
+
regexp_parser (2.11.3)
|
|
16
27
|
rspec (3.13.2)
|
|
17
28
|
rspec-core (~> 3.13.0)
|
|
18
29
|
rspec-expectations (~> 3.13.0)
|
|
@@ -26,7 +37,24 @@ GEM
|
|
|
26
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
27
38
|
rspec-support (~> 3.13.0)
|
|
28
39
|
rspec-support (3.13.6)
|
|
29
|
-
|
|
40
|
+
rubocop (1.81.7)
|
|
41
|
+
json (~> 2.3)
|
|
42
|
+
language_server-protocol (~> 3.17.0.2)
|
|
43
|
+
lint_roller (~> 1.1.0)
|
|
44
|
+
parallel (~> 1.10)
|
|
45
|
+
parser (>= 3.3.0.2)
|
|
46
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
47
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
48
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
49
|
+
ruby-progressbar (~> 1.7)
|
|
50
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
51
|
+
rubocop-ast (1.48.0)
|
|
52
|
+
parser (>= 3.3.7.2)
|
|
53
|
+
prism (~> 1.4)
|
|
54
|
+
ruby-progressbar (1.13.0)
|
|
55
|
+
unicode-display_width (3.2.0)
|
|
56
|
+
unicode-emoji (~> 4.1)
|
|
57
|
+
unicode-emoji (4.1.0)
|
|
30
58
|
|
|
31
59
|
PLATFORMS
|
|
32
60
|
arm64-darwin-24
|
|
@@ -39,6 +67,7 @@ DEPENDENCIES
|
|
|
39
67
|
rack-test
|
|
40
68
|
rake (~> 10.0)
|
|
41
69
|
rspec (~> 3.0)
|
|
70
|
+
rubocop (~> 1.81)
|
|
42
71
|
|
|
43
72
|
BUNDLED WITH
|
|
44
73
|
2.6.9
|
data/artery-browser.gemspec
CHANGED
|
@@ -33,12 +33,14 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
34
34
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
35
35
|
end
|
|
36
|
+
|
|
36
37
|
spec.bindir = 'exe'
|
|
37
38
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
38
39
|
spec.require_paths = ['lib']
|
|
39
40
|
|
|
41
|
+
spec.required_ruby_version = '>= 2.7'
|
|
42
|
+
|
|
40
43
|
spec.add_dependency 'rack', '~> 3.2'
|
|
41
|
-
spec.add_dependency 'webrick', '~> 1.9'
|
|
42
44
|
|
|
43
45
|
spec.add_development_dependency 'bundler', '~> 2.6.9'
|
|
44
46
|
spec.add_development_dependency 'rake', '~> 10.0'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0549022cfbcab5c23b96f79c8a17d185402d267d8583ce75d338f6cf9c9a2bf4aecf92a44f2a5e313a104c3b50d9f62aca8db905e06bbed142cc62db6b400fe4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1e087ca524bbf3db235de3f47e76c22b8c0f3a40dc842c90d8b59004d11e49c2ba5bfc0852c29805bfa29c02ec4a6392cb1e3da8628174bd381f6e34692a48ea
|
data/lib/artery/browser/app.rb
CHANGED
|
@@ -13,13 +13,10 @@ module Artery
|
|
|
13
13
|
::Rack::Builder.new do
|
|
14
14
|
use Rack::Static,
|
|
15
15
|
urls:
|
|
16
|
-
%w[
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
assets/index-Dw-hdo5G.css
|
|
21
|
-
assets/validate-routes-Cx95rB3S.js
|
|
22
|
-
].map { |f| ["/#{f}", f] }.to_h,
|
|
16
|
+
%w[index.html logo.svg
|
|
17
|
+
assets/index-CFTHRyuc.js
|
|
18
|
+
assets/index-Dw-hdo5G.css
|
|
19
|
+
assets/validate-routes-Cx95rB3S.js].map { |f| ["/#{f}", f] }.to_h,
|
|
23
20
|
root: "#{__dir__}/../../../public"
|
|
24
21
|
run App.new
|
|
25
22
|
end
|
|
@@ -27,6 +24,7 @@ module Artery
|
|
|
27
24
|
|
|
28
25
|
def initialize; end
|
|
29
26
|
|
|
27
|
+
# rubocop:disable Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/CyclomaticComplexity
|
|
30
28
|
def call(env)
|
|
31
29
|
router = Router.new
|
|
32
30
|
%w[/].each do |starting_route|
|
|
@@ -54,22 +52,26 @@ module Artery
|
|
|
54
52
|
end
|
|
55
53
|
|
|
56
54
|
router.add_route('PUT', '/listeners/:listener_id') do |params, request|
|
|
57
|
-
|
|
55
|
+
listener_info = Artery.subscription_info_class.find(params.fetch('listener_id'))
|
|
58
56
|
updates = JSON.parse(request.body.gets).slice('latest_index')
|
|
59
|
-
|
|
57
|
+
|
|
60
58
|
Artery.subscriptions.each_value do |listeners|
|
|
61
59
|
listeners.each do |subscription_listener|
|
|
62
|
-
|
|
60
|
+
subscription_listener_info = subscription_listener.info
|
|
61
|
+
next unless subscription_listener_info == listener_info
|
|
62
|
+
|
|
63
|
+
subscription_listener_info.with_lock { subscription_listener_info.update!(updates) }
|
|
63
64
|
end
|
|
64
65
|
end
|
|
65
66
|
|
|
66
|
-
json(
|
|
67
|
+
json(listener_info.attributes.slice('id'))
|
|
67
68
|
end
|
|
68
69
|
|
|
69
70
|
router.handle(::Rack::Request.new(env))
|
|
70
71
|
rescue Router::NoMatch
|
|
71
72
|
not_found
|
|
72
73
|
end
|
|
74
|
+
# rubocop:enable Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/CyclomaticComplexity
|
|
73
75
|
|
|
74
76
|
private
|
|
75
77
|
|
|
@@ -6,7 +6,7 @@ module Artery
|
|
|
6
6
|
NoMatch = Class.new(StandardError)
|
|
7
7
|
|
|
8
8
|
class Route
|
|
9
|
-
NAMED_SEGMENTS_PATTERN = %r{/([^/]*):([^:$/]+)}
|
|
9
|
+
NAMED_SEGMENTS_PATTERN = %r{/([^/]*):([^:$/]+)}.freeze
|
|
10
10
|
private_constant :NAMED_SEGMENTS_PATTERN
|
|
11
11
|
|
|
12
12
|
def initialize(request_method, pattern, &block)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: artery-browser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Askar Zinurov
|
|
@@ -23,20 +23,6 @@ dependencies:
|
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '3.2'
|
|
26
|
-
- !ruby/object:Gem::Dependency
|
|
27
|
-
name: webrick
|
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
|
29
|
-
requirements:
|
|
30
|
-
- - "~>"
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: '1.9'
|
|
33
|
-
type: :runtime
|
|
34
|
-
prerelease: false
|
|
35
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
-
requirements:
|
|
37
|
-
- - "~>"
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: '1.9'
|
|
40
26
|
- !ruby/object:Gem::Dependency
|
|
41
27
|
name: bundler
|
|
42
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -88,6 +74,7 @@ extra_rdoc_files: []
|
|
|
88
74
|
files:
|
|
89
75
|
- ".gitignore"
|
|
90
76
|
- ".rspec"
|
|
77
|
+
- ".rubocop.yml"
|
|
91
78
|
- ".ruby-version"
|
|
92
79
|
- ".travis.yml"
|
|
93
80
|
- Gemfile
|
|
@@ -96,7 +83,8 @@ files:
|
|
|
96
83
|
- README.md
|
|
97
84
|
- Rakefile
|
|
98
85
|
- artery-browser.gemspec
|
|
99
|
-
- checksums/artery-browser-0.1.
|
|
86
|
+
- checksums/artery-browser-0.1.1.gem.sha512
|
|
87
|
+
- checksums/artery-browser-0.1.2.gem.sha512
|
|
100
88
|
- lib/artery/browser.rb
|
|
101
89
|
- lib/artery/browser/app.rb
|
|
102
90
|
- lib/artery/browser/router.rb
|
|
@@ -146,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
146
134
|
requirements:
|
|
147
135
|
- - ">="
|
|
148
136
|
- !ruby/object:Gem::Version
|
|
149
|
-
version: '
|
|
137
|
+
version: '2.7'
|
|
150
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
139
|
requirements:
|
|
152
140
|
- - ">="
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
93e63729fc36eb69839910adb9924954dc7b73d9a7e2f554a4a1078988191c29c8ff2024837ccd286283e08a14091b3ec5d933da9460fb58e206a5ca02bf2f3e
|