live 0.5.1 → 0.6.0
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
- checksums.yaml.gz.sig +0 -0
- data/lib/live/element.rb +2 -19
- data/lib/live/page.rb +2 -19
- data/lib/live/resolver.rb +2 -19
- data/lib/live/version.rb +4 -1
- data/lib/live/view.rb +5 -22
- data/lib/live.rb +2 -19
- data/license.md +22 -0
- data/readme.md +43 -0
- data.tar.gz.sig +0 -0
- metadata +11 -62
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7df6409f470eb90e1f1f68cd70dabcf23cf56c2cbcbcc5707222bcac7d721338
|
|
4
|
+
data.tar.gz: faac890736a9dc375e683405d29c534a55b7628e37abbcd64cfae0922ebdeda8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1f0603af15f67f6db3677126f45f1c766bccecf99d93aaae0fc9018c0da5deaaa5f0156fe187ea9d90cac5bf813540de62e084c840bbe28eedfdc18a69fe4af
|
|
7
|
+
data.tar.gz: 5db6880399468684e09034225faa3a63929563177d28b32ae67bbe9022158d15b98fc2ba0a967c6bd88177cb1b9518b85a45caeb3ef07309f446fe2b2b639862
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/live/element.rb
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
|
13
|
-
# all copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
# THE SOFTWARE.
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
|
22
5
|
|
|
23
6
|
require 'json'
|
|
24
7
|
|
data/lib/live/page.rb
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
|
13
|
-
# all copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
# THE SOFTWARE.
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
|
22
5
|
|
|
23
6
|
require_relative 'element'
|
|
24
7
|
require_relative 'resolver'
|
data/lib/live/resolver.rb
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
|
13
|
-
# all copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
# THE SOFTWARE.
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
|
22
5
|
|
|
23
6
|
require_relative 'element'
|
|
24
7
|
|
data/lib/live/version.rb
CHANGED
data/lib/live/view.rb
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
|
13
|
-
# all copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
# THE SOFTWARE.
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
|
22
5
|
|
|
23
6
|
require_relative 'element'
|
|
24
|
-
require '
|
|
7
|
+
require 'xrb/builder'
|
|
25
8
|
|
|
26
9
|
module Live
|
|
27
10
|
# Represents a single division of content on the page an provides helpers for rendering the content.
|
|
@@ -44,13 +27,13 @@ module Live
|
|
|
44
27
|
end
|
|
45
28
|
|
|
46
29
|
# Render the element.
|
|
47
|
-
# @parameter builder [
|
|
30
|
+
# @parameter builder [XRB::Builder] The HTML builder.
|
|
48
31
|
def render(builder)
|
|
49
32
|
end
|
|
50
33
|
|
|
51
34
|
# @returns [Object] The generated HTML.
|
|
52
35
|
def to_html
|
|
53
|
-
|
|
36
|
+
XRB::Builder.fragment do |builder|
|
|
54
37
|
builder.tag :div, id: @id, class: 'live', data: @data do
|
|
55
38
|
render(builder)
|
|
56
39
|
end
|
data/lib/live.rb
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
|
13
|
-
# all copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
# THE SOFTWARE.
|
|
3
|
+
# Released under the MIT License.
|
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
|
22
5
|
|
|
23
6
|
require_relative "live/version"
|
|
24
7
|
|
data/license.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright, 2021-2024, by Samuel Williams.
|
|
4
|
+
Copyright, 2023, by Olle Jonsson.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
data/readme.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Live
|
|
2
|
+
|
|
3
|
+
Provides bi-directional live HTML views using WebSockets for communication. You can try out a [live example](https://utopia-falcon-heroku.herokuapp.com/live/index)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/socketry/live/actions?workflow=Test)
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Transparent support for both static initial rendering and dynamic updates.
|
|
10
|
+
- Bi-directional event handling for seamless client/server implementation.
|
|
11
|
+
- Event-driven architecture for efficient handling of thousands of active connections.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Please see the [project documentation](https://socketry.github.io/live/) for more details.
|
|
16
|
+
|
|
17
|
+
- [Getting Started](https://socketry.github.io/live/guides/getting-started/index) - This guide explains how to use `live` to render dynamic content in real-time.
|
|
18
|
+
|
|
19
|
+
- [Rails Integration](https://socketry.github.io/live/guides/rails-integration/index) - This guide explains how to use the `live` gem with Ruby on Rails.
|
|
20
|
+
|
|
21
|
+
## Contributing
|
|
22
|
+
|
|
23
|
+
We welcome contributions to this project.
|
|
24
|
+
|
|
25
|
+
1. Fork it.
|
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
|
29
|
+
5. Create new Pull Request.
|
|
30
|
+
|
|
31
|
+
### Developer Certificate of Origin
|
|
32
|
+
|
|
33
|
+
This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
|
|
34
|
+
|
|
35
|
+
### Contributor Covenant
|
|
36
|
+
|
|
37
|
+
This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
|
38
|
+
|
|
39
|
+
## See Also
|
|
40
|
+
|
|
41
|
+
- [live-js](https://github.com/socketry/live-js) — The client-side JavaScript library.
|
|
42
|
+
- [morphdom](https://github.com/patrick-steele-idem/morphdom) — Efficiently update the client-side HTML.
|
|
43
|
+
- [stimulus-reflex](https://github.com/hopsoft/stimulus_reflex) — An alternative framework which provides similar functionality.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: live
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
8
|
+
- Olle Jonsson
|
|
8
9
|
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain:
|
|
@@ -37,7 +38,7 @@ cert_chain:
|
|
|
37
38
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
|
38
39
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
|
39
40
|
-----END CERTIFICATE-----
|
|
40
|
-
date:
|
|
41
|
+
date: 2024-04-28 00:00:00.000000000 Z
|
|
41
42
|
dependencies:
|
|
42
43
|
- !ruby/object:Gem::Dependency
|
|
43
44
|
name: async-websocket
|
|
@@ -54,7 +55,7 @@ dependencies:
|
|
|
54
55
|
- !ruby/object:Gem::Version
|
|
55
56
|
version: '0.23'
|
|
56
57
|
- !ruby/object:Gem::Dependency
|
|
57
|
-
name:
|
|
58
|
+
name: xrb
|
|
58
59
|
requirement: !ruby/object:Gem::Requirement
|
|
59
60
|
requirements:
|
|
60
61
|
- - ">="
|
|
@@ -67,62 +68,6 @@ dependencies:
|
|
|
67
68
|
- - ">="
|
|
68
69
|
- !ruby/object:Gem::Version
|
|
69
70
|
version: '0'
|
|
70
|
-
- !ruby/object:Gem::Dependency
|
|
71
|
-
name: async-rspec
|
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
|
73
|
-
requirements:
|
|
74
|
-
- - "~>"
|
|
75
|
-
- !ruby/object:Gem::Version
|
|
76
|
-
version: '1.1'
|
|
77
|
-
type: :development
|
|
78
|
-
prerelease: false
|
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
80
|
-
requirements:
|
|
81
|
-
- - "~>"
|
|
82
|
-
- !ruby/object:Gem::Version
|
|
83
|
-
version: '1.1'
|
|
84
|
-
- !ruby/object:Gem::Dependency
|
|
85
|
-
name: bundler
|
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
|
87
|
-
requirements:
|
|
88
|
-
- - ">="
|
|
89
|
-
- !ruby/object:Gem::Version
|
|
90
|
-
version: '0'
|
|
91
|
-
type: :development
|
|
92
|
-
prerelease: false
|
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
94
|
-
requirements:
|
|
95
|
-
- - ">="
|
|
96
|
-
- !ruby/object:Gem::Version
|
|
97
|
-
version: '0'
|
|
98
|
-
- !ruby/object:Gem::Dependency
|
|
99
|
-
name: covered
|
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
|
101
|
-
requirements:
|
|
102
|
-
- - "~>"
|
|
103
|
-
- !ruby/object:Gem::Version
|
|
104
|
-
version: '0.10'
|
|
105
|
-
type: :development
|
|
106
|
-
prerelease: false
|
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
108
|
-
requirements:
|
|
109
|
-
- - "~>"
|
|
110
|
-
- !ruby/object:Gem::Version
|
|
111
|
-
version: '0.10'
|
|
112
|
-
- !ruby/object:Gem::Dependency
|
|
113
|
-
name: rspec
|
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
|
115
|
-
requirements:
|
|
116
|
-
- - "~>"
|
|
117
|
-
- !ruby/object:Gem::Version
|
|
118
|
-
version: '3.6'
|
|
119
|
-
type: :development
|
|
120
|
-
prerelease: false
|
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
122
|
-
requirements:
|
|
123
|
-
- - "~>"
|
|
124
|
-
- !ruby/object:Gem::Version
|
|
125
|
-
version: '3.6'
|
|
126
71
|
description:
|
|
127
72
|
email:
|
|
128
73
|
executables: []
|
|
@@ -135,10 +80,14 @@ files:
|
|
|
135
80
|
- lib/live/resolver.rb
|
|
136
81
|
- lib/live/version.rb
|
|
137
82
|
- lib/live/view.rb
|
|
83
|
+
- license.md
|
|
84
|
+
- readme.md
|
|
138
85
|
homepage: https://github.com/socketry/live
|
|
139
86
|
licenses:
|
|
140
87
|
- MIT
|
|
141
|
-
metadata:
|
|
88
|
+
metadata:
|
|
89
|
+
documentation_uri: https://socketry.github.io/live/
|
|
90
|
+
source_code_uri: https://github.com/socketry/live.git
|
|
142
91
|
post_install_message:
|
|
143
92
|
rdoc_options: []
|
|
144
93
|
require_paths:
|
|
@@ -147,14 +96,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
147
96
|
requirements:
|
|
148
97
|
- - ">="
|
|
149
98
|
- !ruby/object:Gem::Version
|
|
150
|
-
version:
|
|
99
|
+
version: '3.1'
|
|
151
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
101
|
requirements:
|
|
153
102
|
- - ">="
|
|
154
103
|
- !ruby/object:Gem::Version
|
|
155
104
|
version: '0'
|
|
156
105
|
requirements: []
|
|
157
|
-
rubygems_version: 3.
|
|
106
|
+
rubygems_version: 3.5.3
|
|
158
107
|
signing_key:
|
|
159
108
|
specification_version: 4
|
|
160
109
|
summary: Live HTML tags updated via a WebSocket.
|
metadata.gz.sig
CHANGED
|
Binary file
|