cubism 0.1.1 → 0.2.0

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: 0c3361767976fb4e04ccb86179a2d1ed2c6e2b55f75dbb53834e293c98d32b47
4
- data.tar.gz: 94635e8dc51fb3d63d83a014c6c7b5ccc1309611077018914d34701e2f1bb70e
3
+ metadata.gz: 57b07ebb0e4be69fc3547a79061710ecbbae9718fbc369052e020dc4062967fe
4
+ data.tar.gz: bfedff76bdf839db5e58d96a9abb7f4a13f20f909154a1294c6d92eb3d965ed4
5
5
  SHA512:
6
- metadata.gz: a4747a2c05eefd056a954f7f166ff7e7df11baaf3a4b9603ceef97644e88600ce02c20f99d70f6fb4919f944271d2d2f36461db55c3f3441395f03548137c959
7
- data.tar.gz: dcf467acad0433f66eca65a5bc00814e50a413afdf08ccf0c685208d9127c1e622bd1b8fad2845d0b58a92802c68639ffd0bbff9030c49044d453deef445f0f9
6
+ metadata.gz: 7e5240cf040e37c614a2f6a6e3313dc52ca3e361a1dd64a312070e1a8fb19ec3117de68357c67e266b9e28817aec051b02b0b759e67ba998731fa5a6afd56c52
7
+ data.tar.gz: fc43eb982192114e6e975b63b0468eafd37d049f5989ea16ffa7250b7c469700c4cd5e4611677164ede6d60f8a14cf3c094cfd57328ce1c3fc0af863ef921532
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cubism (0.1.1)
4
+ cubism (0.2.0)
5
5
  cable_ready (>= 5.0.0)
6
6
  kredis (>= 0.4)
7
7
  rails (>= 6.0)
@@ -9,98 +9,114 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (7.0.8)
13
- actionpack (= 7.0.8)
14
- activesupport (= 7.0.8)
12
+ actioncable (7.1.3.2)
13
+ actionpack (= 7.1.3.2)
14
+ activesupport (= 7.1.3.2)
15
15
  nio4r (~> 2.0)
16
16
  websocket-driver (>= 0.6.1)
17
- actionmailbox (7.0.8)
18
- actionpack (= 7.0.8)
19
- activejob (= 7.0.8)
20
- activerecord (= 7.0.8)
21
- activestorage (= 7.0.8)
22
- activesupport (= 7.0.8)
17
+ zeitwerk (~> 2.6)
18
+ actionmailbox (7.1.3.2)
19
+ actionpack (= 7.1.3.2)
20
+ activejob (= 7.1.3.2)
21
+ activerecord (= 7.1.3.2)
22
+ activestorage (= 7.1.3.2)
23
+ activesupport (= 7.1.3.2)
23
24
  mail (>= 2.7.1)
24
25
  net-imap
25
26
  net-pop
26
27
  net-smtp
27
- actionmailer (7.0.8)
28
- actionpack (= 7.0.8)
29
- actionview (= 7.0.8)
30
- activejob (= 7.0.8)
31
- activesupport (= 7.0.8)
28
+ actionmailer (7.1.3.2)
29
+ actionpack (= 7.1.3.2)
30
+ actionview (= 7.1.3.2)
31
+ activejob (= 7.1.3.2)
32
+ activesupport (= 7.1.3.2)
32
33
  mail (~> 2.5, >= 2.5.4)
33
34
  net-imap
34
35
  net-pop
35
36
  net-smtp
36
- rails-dom-testing (~> 2.0)
37
- actionpack (7.0.8)
38
- actionview (= 7.0.8)
39
- activesupport (= 7.0.8)
40
- rack (~> 2.0, >= 2.2.4)
37
+ rails-dom-testing (~> 2.2)
38
+ actionpack (7.1.3.2)
39
+ actionview (= 7.1.3.2)
40
+ activesupport (= 7.1.3.2)
41
+ nokogiri (>= 1.8.5)
42
+ racc
43
+ rack (>= 2.2.4)
44
+ rack-session (>= 1.0.1)
41
45
  rack-test (>= 0.6.3)
42
- rails-dom-testing (~> 2.0)
43
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
44
- actiontext (7.0.8)
45
- actionpack (= 7.0.8)
46
- activerecord (= 7.0.8)
47
- activestorage (= 7.0.8)
48
- activesupport (= 7.0.8)
46
+ rails-dom-testing (~> 2.2)
47
+ rails-html-sanitizer (~> 1.6)
48
+ actiontext (7.1.3.2)
49
+ actionpack (= 7.1.3.2)
50
+ activerecord (= 7.1.3.2)
51
+ activestorage (= 7.1.3.2)
52
+ activesupport (= 7.1.3.2)
49
53
  globalid (>= 0.6.0)
50
54
  nokogiri (>= 1.8.5)
51
- actionview (7.0.8)
52
- activesupport (= 7.0.8)
55
+ actionview (7.1.3.2)
56
+ activesupport (= 7.1.3.2)
53
57
  builder (~> 3.1)
54
- erubi (~> 1.4)
55
- rails-dom-testing (~> 2.0)
56
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
57
- activejob (7.0.8)
58
- activesupport (= 7.0.8)
58
+ erubi (~> 1.11)
59
+ rails-dom-testing (~> 2.2)
60
+ rails-html-sanitizer (~> 1.6)
61
+ activejob (7.1.3.2)
62
+ activesupport (= 7.1.3.2)
59
63
  globalid (>= 0.3.6)
60
- activemodel (7.0.8)
61
- activesupport (= 7.0.8)
62
- activerecord (7.0.8)
63
- activemodel (= 7.0.8)
64
- activesupport (= 7.0.8)
65
- activestorage (7.0.8)
66
- actionpack (= 7.0.8)
67
- activejob (= 7.0.8)
68
- activerecord (= 7.0.8)
69
- activesupport (= 7.0.8)
64
+ activemodel (7.1.3.2)
65
+ activesupport (= 7.1.3.2)
66
+ activerecord (7.1.3.2)
67
+ activemodel (= 7.1.3.2)
68
+ activesupport (= 7.1.3.2)
69
+ timeout (>= 0.4.0)
70
+ activestorage (7.1.3.2)
71
+ actionpack (= 7.1.3.2)
72
+ activejob (= 7.1.3.2)
73
+ activerecord (= 7.1.3.2)
74
+ activesupport (= 7.1.3.2)
70
75
  marcel (~> 1.0)
71
- mini_mime (>= 1.1.0)
72
- activesupport (7.0.8)
76
+ activesupport (7.1.3.2)
77
+ base64
78
+ bigdecimal
73
79
  concurrent-ruby (~> 1.0, >= 1.0.2)
80
+ connection_pool (>= 2.2.5)
81
+ drb
74
82
  i18n (>= 1.6, < 2)
75
83
  minitest (>= 5.1)
84
+ mutex_m
76
85
  tzinfo (~> 2.0)
77
86
  appraisal (2.4.1)
78
87
  bundler
79
88
  rake
80
89
  thor (>= 0.14.0)
81
90
  ast (2.4.2)
91
+ base64 (0.2.0)
92
+ bigdecimal (3.1.7)
82
93
  builder (3.2.4)
83
- cable_ready (5.0.1)
94
+ cable_ready (5.0.3)
84
95
  actionpack (>= 5.2)
85
96
  actionview (>= 5.2)
86
97
  activesupport (>= 5.2)
87
98
  railties (>= 5.2)
88
99
  thread-local (>= 1.1.0)
89
100
  coderay (1.1.3)
90
- concurrent-ruby (1.2.2)
101
+ concurrent-ruby (1.2.3)
91
102
  connection_pool (2.4.1)
92
103
  crass (1.0.6)
93
- date (3.3.3)
104
+ date (3.3.4)
105
+ drb (2.2.1)
94
106
  erubi (1.12.0)
95
107
  globalid (1.2.1)
96
108
  activesupport (>= 6.1)
97
- i18n (1.14.1)
109
+ i18n (1.14.4)
98
110
  concurrent-ruby (~> 1.0)
99
- kredis (1.5.0)
111
+ io-console (0.7.2)
112
+ irb (1.12.0)
113
+ rdoc
114
+ reline (>= 0.4.2)
115
+ kredis (1.7.0)
100
116
  activemodel (>= 6.0.0)
101
117
  activesupport (>= 6.0.0)
102
118
  redis (>= 4.2, < 6)
103
- loofah (2.21.3)
119
+ loofah (2.22.0)
104
120
  crass (~> 1.0.2)
105
121
  nokogiri (>= 1.12.0)
106
122
  mail (2.8.1)
@@ -108,26 +124,27 @@ GEM
108
124
  net-imap
109
125
  net-pop
110
126
  net-smtp
111
- marcel (1.0.2)
127
+ marcel (1.0.4)
112
128
  method_source (1.0.0)
113
129
  mini_mime (1.1.5)
114
- mini_portile2 (2.8.1)
115
- minitest (5.20.0)
130
+ mini_portile2 (2.8.5)
131
+ minitest (5.22.3)
116
132
  mocha (1.13.0)
133
+ mutex_m (0.2.0)
117
134
  net-imap (0.3.7)
118
135
  date
119
136
  net-protocol
120
137
  net-pop (0.1.2)
121
138
  net-protocol
122
- net-protocol (0.2.1)
139
+ net-protocol (0.2.2)
123
140
  timeout
124
- net-smtp (0.4.0)
141
+ net-smtp (0.5.0)
125
142
  net-protocol
126
- nio4r (2.5.9)
127
- nokogiri (1.14.3)
128
- mini_portile2 (~> 2.8.0)
143
+ nio4r (2.7.1)
144
+ nokogiri (1.15.6)
145
+ mini_portile2 (~> 2.8.2)
129
146
  racc (~> 1.4)
130
- nokogiri (1.14.3-arm64-darwin)
147
+ nokogiri (1.15.6-arm64-darwin)
131
148
  racc (~> 1.4)
132
149
  parallel (1.21.0)
133
150
  parser (3.1.0.0)
@@ -135,24 +152,31 @@ GEM
135
152
  pry (0.14.1)
136
153
  coderay (~> 1.1)
137
154
  method_source (~> 1.0)
138
- racc (1.6.2)
139
- rack (2.2.8)
155
+ psych (5.1.2)
156
+ stringio
157
+ racc (1.7.3)
158
+ rack (3.0.10)
159
+ rack-session (2.0.0)
160
+ rack (>= 3.0.0)
140
161
  rack-test (2.1.0)
141
162
  rack (>= 1.3)
142
- rails (7.0.8)
143
- actioncable (= 7.0.8)
144
- actionmailbox (= 7.0.8)
145
- actionmailer (= 7.0.8)
146
- actionpack (= 7.0.8)
147
- actiontext (= 7.0.8)
148
- actionview (= 7.0.8)
149
- activejob (= 7.0.8)
150
- activemodel (= 7.0.8)
151
- activerecord (= 7.0.8)
152
- activestorage (= 7.0.8)
153
- activesupport (= 7.0.8)
163
+ rackup (2.1.0)
164
+ rack (>= 3)
165
+ webrick (~> 1.8)
166
+ rails (7.1.3.2)
167
+ actioncable (= 7.1.3.2)
168
+ actionmailbox (= 7.1.3.2)
169
+ actionmailer (= 7.1.3.2)
170
+ actionpack (= 7.1.3.2)
171
+ actiontext (= 7.1.3.2)
172
+ actionview (= 7.1.3.2)
173
+ activejob (= 7.1.3.2)
174
+ activemodel (= 7.1.3.2)
175
+ activerecord (= 7.1.3.2)
176
+ activestorage (= 7.1.3.2)
177
+ activesupport (= 7.1.3.2)
154
178
  bundler (>= 1.15.0)
155
- railties (= 7.0.8)
179
+ railties (= 7.1.3.2)
156
180
  rails-dom-testing (2.2.0)
157
181
  activesupport (>= 5.0.0)
158
182
  minitest
@@ -160,20 +184,25 @@ GEM
160
184
  rails-html-sanitizer (1.6.0)
161
185
  loofah (~> 2.21)
162
186
  nokogiri (~> 1.14)
163
- railties (7.0.8)
164
- actionpack (= 7.0.8)
165
- activesupport (= 7.0.8)
166
- method_source
187
+ railties (7.1.3.2)
188
+ actionpack (= 7.1.3.2)
189
+ activesupport (= 7.1.3.2)
190
+ irb
191
+ rackup (>= 1.0.0)
167
192
  rake (>= 12.2)
168
- thor (~> 1.0)
169
- zeitwerk (~> 2.5)
193
+ thor (~> 1.0, >= 1.2.2)
194
+ zeitwerk (~> 2.6)
170
195
  rainbow (3.0.0)
171
- rake (13.0.6)
172
- redis (5.0.7)
173
- redis-client (>= 0.9.0)
174
- redis-client (0.17.0)
196
+ rake (13.1.0)
197
+ rdoc (6.6.3.1)
198
+ psych (>= 4.0.0)
199
+ redis (5.1.0)
200
+ redis-client (>= 0.17.0)
201
+ redis-client (0.21.1)
175
202
  connection_pool
176
203
  regexp_parser (2.2.0)
204
+ reline (0.5.0)
205
+ io-console (~> 0.5)
177
206
  rexml (3.2.5)
178
207
  rubocop (1.23.0)
179
208
  parallel (~> 1.10)
@@ -194,16 +223,18 @@ GEM
194
223
  standard (1.5.0)
195
224
  rubocop (= 1.23.0)
196
225
  rubocop-performance (= 1.12.0)
197
- thor (1.2.1)
226
+ stringio (3.1.0)
227
+ thor (1.3.1)
198
228
  thread-local (1.1.0)
199
- timeout (0.4.0)
229
+ timeout (0.4.1)
200
230
  tzinfo (2.0.6)
201
231
  concurrent-ruby (~> 1.0)
202
232
  unicode-display_width (2.1.0)
233
+ webrick (1.8.1)
203
234
  websocket-driver (0.7.6)
204
235
  websocket-extensions (>= 0.1.0)
205
236
  websocket-extensions (0.1.5)
206
- zeitwerk (2.6.11)
237
+ zeitwerk (2.6.13)
207
238
 
208
239
  PLATFORMS
209
240
  arm64-darwin-21
@@ -21,10 +21,14 @@ class Cubism::PresenceChannel < ActionCable::Channel::Base
21
21
 
22
22
  def appear
23
23
  resource.set_present_users_for_scope(resource.present_users_for_scope(scope).add(user.id), scope) if scope
24
+ rescue ActiveRecord::RecordNotFound
25
+ # do nothing if the user wasn't found
24
26
  end
25
27
 
26
28
  def disappear
27
29
  resource.set_present_users_for_scope(resource.present_users_for_scope(scope).delete(user.id), scope) if scope
30
+ rescue ActiveRecord::RecordNotFound
31
+ # do nothing if the user wasn't found
28
32
  end
29
33
 
30
34
  private
data/cubism.gemspec~ CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_dependency "rails", ">= 6.0"
28
28
  spec.add_dependency "kredis", ">= 0.4"
29
- spec.add_dependency "cable_ready", "= 5.0.0.rc2"
29
+ spec.add_dependency "cable_ready", ">= 5.0.0"
30
30
 
31
31
  spec.add_development_dependency "standard"
32
32
  spec.add_development_dependency "nokogiri"
@@ -14,6 +14,7 @@ module Cubism
14
14
  begin
15
15
  do_parse
16
16
  rescue NameError
17
+ # TODO we need a better way to handle this, leads to false negatives
17
18
  # we ignore any name errors from unset instance variables or local assigns here
18
19
  end
19
20
 
@@ -23,11 +24,21 @@ module Cubism
23
24
  private
24
25
 
25
26
  def do_parse
26
- ActionView::Template::Handlers::ERB::Erubi.new(@source).evaluate(@view_context)
27
+ erubi = ActionView::Template::Handlers::ERB::Erubi.new(@source)
28
+
29
+ evaluate_view(erubi, @view_context)
27
30
  rescue SyntaxError
28
31
  end_at_end = /(<%\s+end\s+%>)\z/.match(@source)
29
32
  @source = end_at_end ? @source[..-(end_at_end[0].length + 1)] : @source[..-2]
30
33
  do_parse
31
34
  end
35
+
36
+ def evaluate_view(erubi, view_context)
37
+ view = Class.new(ActionView::Base) {
38
+ include view_context._routes.url_helpers
39
+ class_eval("define_method(:_template) { |local_assigns, output_buffer| #{erubi.src} }", erubi.filename.nil? ? "(erubi)" : erubi.filename, 0)
40
+ }.empty
41
+ view._run(:_template, nil, {}, ActionView::OutputBuffer.new)
42
+ end
32
43
  end
33
44
  end
@@ -1,3 +1,3 @@
1
1
  module Cubism
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minthesize/cubism",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Lightweight Resource-Based Presence Solution with CableReady.",
5
5
  "main": "./dist/cubism.umd.min.js",
6
6
  "module": "./dist/cubism.min.js",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cubism
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Rubisch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-25 00:00:00.000000000 Z
11
+ date: 2024-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -217,7 +217,7 @@ licenses:
217
217
  metadata:
218
218
  homepage_uri: https://github.com/julianrubisch/cubism
219
219
  source_code_uri: https://github.com/julianrubisch/cubism.git
220
- post_install_message:
220
+ post_install_message:
221
221
  rdoc_options: []
222
222
  require_paths:
223
223
  - lib
@@ -233,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  version: '0'
234
234
  requirements: []
235
235
  rubygems_version: 3.1.4
236
- signing_key:
236
+ signing_key:
237
237
  specification_version: 4
238
238
  summary: Lightweight Resource-Based Presence Solution with CableReady
239
239
  test_files: