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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54eb6afb0f21c0333d46c1a21602739146fa1e2a021d3ffda048c9763dc85e66
4
- data.tar.gz: c3d9476c0e34869f5d4e46121316dee4f2c78d91b0a9b51d05c14a0b4d4e63ac
3
+ metadata.gz: '0967eb2e920b41cf8800a494bcc514bdf4d7cbdf9811a1425a09bf80e99b65d9'
4
+ data.tar.gz: 8c36032ff83ebd1cdb5c4fb4cd7ff0c668deee2b6bf3384027b0c715cc50d53c
5
5
  SHA512:
6
- metadata.gz: b17d8159ba7eae3b144a6380385e68eb9a2b49b0733926d9e285bf60c8f0767646d30841ee90d62d4b3a359f5c5f9beb62d4793c6d48dff6f1887c9fd7367a70
7
- data.tar.gz: 0c47ed993c63378f0d562e341a44539bda1578c34d42ae8449c1dfd9dedabf7481e9e5f272c0869416893533fe31b5901368ebcc2e53c0752db120afb0e84c50
6
+ metadata.gz: 499f1fb69d65d04b5439ccf6eb32fac722edff716d5bbd710c8e35b6f68ff5e5e821b02a38e046889a8a08c2bf78efdf87eb2e684c76e1c36cb6a22990c171f7
7
+ data.tar.gz: 517e4f3b96279f8f8b4fd21c8e5eb441d4fceee1005bea476b655f3bb673a61d45a57d81667d378a60fa7b8c05f597393d6c6d87e994678adec73aa2cda188cd
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Motion
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
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.0
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-07-16 00:00:00.000000000 Z
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.0'`).
105
+ NPM package as well (`bin/yarn add '@unabridged/motion@0.4.1'`).
92
106
  rdoc_options: []
93
107
  require_paths:
94
108
  - lib