lively 0.10.1 → 0.11.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/bin/lively +3 -2
- data/lib/lively/application.rb +6 -6
- data/lib/lively/assets.rb +8 -7
- data/lib/lively/environment/application.rb +5 -5
- data/lib/lively/hello_world.rb +5 -0
- data/lib/lively/pages/index.rb +1 -1
- data/lib/lively/version.rb +1 -1
- data/lib/lively.rb +4 -4
- data/license.md +1 -1
- data/readme.md +3 -3
- data.tar.gz.sig +0 -0
- metadata +6 -11
- 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: 39c0cab1f012ef1adc64dcdb197017f93fe45eed7f81a32b57ce102fc537ee75
|
4
|
+
data.tar.gz: d5309edbd47e795ecbde9cd34c1d23d8826a6f5ccba4bc79a8b3661077e8ef97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b672c594ae520e4a44985350ec393fca0074d581e7d2160c2ee03b12265b1aee1d59be3c26ce82038cd64c517673fe094844fd24a74922ecf26af380762c93b
|
7
|
+
data.tar.gz: '0483d26396b0062b3c40fd141e2827d089f805bc600fc1357f777ecaf220a4c7358dc8dd664dd7f6dcf6bd6c50107f16673bfd2f84564aeaf99214781d4a972e'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bin/lively
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require_relative
|
4
|
+
require "async/service"
|
5
|
+
require_relative "../lib/lively/environment/application"
|
5
6
|
|
6
7
|
ARGV.each do |path|
|
7
8
|
require(path)
|
data/lib/lively/application.rb
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
6
|
+
require "live"
|
7
|
+
require "protocol/http/middleware"
|
8
|
+
require "async/websocket/adapters/http"
|
9
9
|
|
10
|
-
require_relative
|
11
|
-
require_relative
|
10
|
+
require_relative "pages/index"
|
11
|
+
require_relative "hello_world"
|
12
12
|
|
13
13
|
module Lively
|
14
14
|
class Application < Protocol::HTTP::Middleware
|
@@ -57,7 +57,7 @@ module Lively
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def call(request)
|
60
|
-
if request.path ==
|
60
|
+
if request.path == "/live"
|
61
61
|
return Async::WebSocket::Adapters::HTTP.open(request, &self.method(:live)) || Protocol::HTTP::Response[400]
|
62
62
|
else
|
63
63
|
return handle(request)
|
data/lib/lively/assets.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require
|
7
|
-
require
|
6
|
+
require "protocol/http/middleware"
|
7
|
+
require "protocol/http/body/file"
|
8
8
|
|
9
9
|
module Lively
|
10
10
|
class Assets < Protocol::HTTP::Middleware
|
11
|
-
DEFAULT_CACHE_CONTROL =
|
11
|
+
DEFAULT_CACHE_CONTROL = "no-store, no-cache, must-revalidate, max-age=0"
|
12
12
|
|
13
13
|
DEFAULT_CONTENT_TYPES = {
|
14
14
|
".html" => "text/html",
|
@@ -18,9 +18,10 @@ module Lively
|
|
18
18
|
".jpeg" => "image/jpeg",
|
19
19
|
".gif" => "image/gif",
|
20
20
|
".mp3" => "audio/mpeg",
|
21
|
+
".wav" => "audio/wav",
|
21
22
|
}
|
22
23
|
|
23
|
-
PUBLIC_ROOT = File.expand_path(
|
24
|
+
PUBLIC_ROOT = File.expand_path("../../public", __dir__)
|
24
25
|
|
25
26
|
def initialize(delegate, root: PUBLIC_ROOT, content_types: DEFAULT_CONTENT_TYPES, cache_control: DEFAULT_CACHE_CONTROL)
|
26
27
|
super(delegate)
|
@@ -43,8 +44,8 @@ module Lively
|
|
43
44
|
|
44
45
|
def response_for(path, content_type)
|
45
46
|
headers = [
|
46
|
-
[
|
47
|
-
[
|
47
|
+
["content-type", content_type],
|
48
|
+
["cache-control", @cache_control],
|
48
49
|
]
|
49
50
|
|
50
51
|
return Protocol::HTTP::Response[200, headers, Protocol::HTTP::Body::File.open(path)]
|
@@ -3,10 +3,10 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "../application"
|
7
|
+
require_relative "../assets"
|
8
8
|
|
9
|
-
require
|
9
|
+
require "falcon/environment/server"
|
10
10
|
|
11
11
|
module Lively
|
12
12
|
module Environment
|
@@ -32,8 +32,8 @@ module Lively
|
|
32
32
|
|
33
33
|
def middleware
|
34
34
|
::Protocol::HTTP::Middleware.build do |builder|
|
35
|
-
builder.use Lively::Assets, root: File.expand_path(
|
36
|
-
builder.use Lively::Assets, root: File.expand_path(
|
35
|
+
builder.use Lively::Assets, root: File.expand_path("public", self.root)
|
36
|
+
builder.use Lively::Assets, root: File.expand_path("../../../public", __dir__)
|
37
37
|
builder.use self.application
|
38
38
|
end
|
39
39
|
end
|
data/lib/lively/hello_world.rb
CHANGED
data/lib/lively/pages/index.rb
CHANGED
data/lib/lively/version.rb
CHANGED
data/lib/lively.rb
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "lively/version"
|
7
7
|
|
8
|
-
require_relative
|
9
|
-
require_relative
|
8
|
+
require_relative "lively/assets"
|
9
|
+
require_relative "lively/application"
|
10
10
|
|
11
|
-
require_relative
|
11
|
+
require_relative "lively/environment/application"
|
data/license.md
CHANGED
data/readme.md
CHANGED
@@ -28,11 +28,11 @@ We welcome contributions to this project.
|
|
28
28
|
|
29
29
|
### Developer Certificate of Origin
|
30
30
|
|
31
|
-
|
31
|
+
In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
|
32
32
|
|
33
|
-
###
|
33
|
+
### Community Guidelines
|
34
34
|
|
35
|
-
This project is
|
35
|
+
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.
|
36
36
|
|
37
37
|
## See Also
|
38
38
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lively
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain:
|
11
10
|
- |
|
@@ -37,7 +36,7 @@ cert_chain:
|
|
37
36
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
37
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
38
|
-----END CERTIFICATE-----
|
40
|
-
date:
|
39
|
+
date: 2025-05-08 00:00:00.000000000 Z
|
41
40
|
dependencies:
|
42
41
|
- !ruby/object:Gem::Dependency
|
43
42
|
name: falcon
|
@@ -59,14 +58,14 @@ dependencies:
|
|
59
58
|
requirements:
|
60
59
|
- - "~>"
|
61
60
|
- !ruby/object:Gem::Version
|
62
|
-
version: '0.
|
61
|
+
version: '0.17'
|
63
62
|
type: :runtime
|
64
63
|
prerelease: false
|
65
64
|
version_requirements: !ruby/object:Gem::Requirement
|
66
65
|
requirements:
|
67
66
|
- - "~>"
|
68
67
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0.
|
68
|
+
version: '0.17'
|
70
69
|
- !ruby/object:Gem::Dependency
|
71
70
|
name: xrb
|
72
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,8 +80,6 @@ dependencies:
|
|
81
80
|
- - ">="
|
82
81
|
- !ruby/object:Gem::Version
|
83
82
|
version: '0'
|
84
|
-
description:
|
85
|
-
email:
|
86
83
|
executables:
|
87
84
|
- lively
|
88
85
|
extensions: []
|
@@ -118,7 +115,6 @@ licenses:
|
|
118
115
|
metadata:
|
119
116
|
documentation_uri: https://socketry.github.io/lively/
|
120
117
|
source_code_uri: https://github.com/socketry/lively.git
|
121
|
-
post_install_message:
|
122
118
|
rdoc_options: []
|
123
119
|
require_paths:
|
124
120
|
- lib
|
@@ -126,15 +122,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
122
|
requirements:
|
127
123
|
- - ">="
|
128
124
|
- !ruby/object:Gem::Version
|
129
|
-
version: '3.
|
125
|
+
version: '3.2'
|
130
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
127
|
requirements:
|
132
128
|
- - ">="
|
133
129
|
- !ruby/object:Gem::Version
|
134
130
|
version: '0'
|
135
131
|
requirements: []
|
136
|
-
rubygems_version: 3.
|
137
|
-
signing_key:
|
132
|
+
rubygems_version: 3.6.2
|
138
133
|
specification_version: 4
|
139
134
|
summary: A simple client-server SPA framework.
|
140
135
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|