motion 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/motion/serializer.rb +11 -2
- data/lib/motion/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0967eb2e920b41cf8800a494bcc514bdf4d7cbdf9811a1425a09bf80e99b65d9'
|
4
|
+
data.tar.gz: 8c36032ff83ebd1cdb5c4fb4cd7ff0c668deee2b6bf3384027b0c715cc50d53c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 499f1fb69d65d04b5439ccf6eb32fac722edff716d5bbd710c8e35b6f68ff5e5e821b02a38e046889a8a08c2bf78efdf87eb2e684c76e1c36cb6a22990c171f7
|
7
|
+
data.tar.gz: 517e4f3b96279f8f8b4fd21c8e5eb441d4fceee1005bea476b655f3bb673a61d45a57d81667d378a60fa7b8c05f597393d6c6d87e994678adec73aa2cda188cd
|
data/lib/motion/serializer.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "digest"
|
4
|
+
require "lz4-ruby"
|
4
5
|
require "active_support/message_encryptor"
|
5
6
|
|
6
7
|
require "motion"
|
@@ -37,7 +38,7 @@ module Motion
|
|
37
38
|
end
|
38
39
|
|
39
40
|
def serialize(component)
|
40
|
-
state = dump(component)
|
41
|
+
state = deflate(dump(component))
|
41
42
|
state_with_revision = "#{revision}#{NULL_BYTE}#{state}"
|
42
43
|
|
43
44
|
[
|
@@ -49,7 +50,7 @@ module Motion
|
|
49
50
|
def deserialize(serialized_component)
|
50
51
|
state_with_revision = decrypt_and_verify(serialized_component)
|
51
52
|
serialized_revision, state = state_with_revision.split(NULL_BYTE, 2)
|
52
|
-
component = load(state)
|
53
|
+
component = load(inflate(state))
|
53
54
|
|
54
55
|
if revision == serialized_revision
|
55
56
|
component
|
@@ -70,6 +71,14 @@ module Motion
|
|
70
71
|
Marshal.load(state)
|
71
72
|
end
|
72
73
|
|
74
|
+
def deflate(dumped_component)
|
75
|
+
LZ4.compress(dumped_component)
|
76
|
+
end
|
77
|
+
|
78
|
+
def inflate(deflated_state)
|
79
|
+
LZ4.uncompress(deflated_state)
|
80
|
+
end
|
81
|
+
|
73
82
|
def encrypt_and_sign(cleartext)
|
74
83
|
encryptor.encrypt_and_sign(cleartext)
|
75
84
|
end
|
data/lib/motion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alec Larsen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -39,6 +39,20 @@ dependencies:
|
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '5.2'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: lz4-ruby
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 0.3.3
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.3.3
|
42
56
|
description: |
|
43
57
|
Motion extends Github's `view_component` to allow you to build reactive,
|
44
58
|
real-time frontend UI components in your Rails application using pure Ruby.
|
@@ -88,7 +102,7 @@ metadata:
|
|
88
102
|
source_code_uri: https://github.com/unabridged/motion
|
89
103
|
post_install_message: |
|
90
104
|
Friendly reminder: When updating the motion gem, don't forget to update the
|
91
|
-
NPM package as well (`bin/yarn add '@unabridged/motion@0.4.
|
105
|
+
NPM package as well (`bin/yarn add '@unabridged/motion@0.4.1'`).
|
92
106
|
rdoc_options: []
|
93
107
|
require_paths:
|
94
108
|
- lib
|