lively 0.19.0 → 0.20.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/context/getting-started.md +2 -5
- data/lib/lively/application.rb +6 -2
- data/lib/lively/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 6ffe05b0ea4fbdde40a40b59e85277e9a87bd2ca0cd57350f720a7c4dd1f8445
|
|
4
|
+
data.tar.gz: d53aedcf48bfd4eab8f1017b214ab2ee3b2cb424ca676c7f495cc7d68dcd5e11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 827c7ea471e0e9075422332e679b7ff05070d040f9e49dc2ce3e69dd23c852b70bd25fed8a6d0c53485391d2e0b906883fae64f6f97a7ad3bc9c30d845b9cc82
|
|
7
|
+
data.tar.gz: a2bd006da9cce6a5303c3e7aa78bf43d4e895c3fff1f7086b7d071872be1742349d7b6549d5e9b853b7e1e72141f0f4ee039de523f2f2de8bc72198a619eda6d
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/context/getting-started.md
CHANGED
|
@@ -128,11 +128,6 @@ class Application < Lively::Application
|
|
|
128
128
|
end
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
-
# Unmatched routes are passed here:
|
|
132
|
-
def handle(request)
|
|
133
|
-
delegate.call(request)
|
|
134
|
-
end
|
|
135
|
-
|
|
136
131
|
private
|
|
137
132
|
|
|
138
133
|
def render(body)
|
|
@@ -144,6 +139,8 @@ end
|
|
|
144
139
|
|
|
145
140
|
Routes match exact paths and may accept one or more HTTP methods. Query parameters are decoded using `protocol-url` and passed to the handler as its second argument. Routes without an explicit method accept every method.
|
|
146
141
|
|
|
142
|
+
Requests which do not match a route are passed to the application's delegate. An application using client-side history routing can instead override `#handle` to return its index page for unmatched paths.
|
|
143
|
+
|
|
147
144
|
## Live Reloading
|
|
148
145
|
|
|
149
146
|
To enable live reloading, add the `io-watch` gem to your `gems.rb` file:
|
data/lib/lively/application.rb
CHANGED
|
@@ -101,15 +101,19 @@ module Lively
|
|
|
101
101
|
|
|
102
102
|
# Handle a standard HTTP request which did not match a configured route.
|
|
103
103
|
# @parameter request [Protocol::HTTP::Request] The incoming HTTP request.
|
|
104
|
-
# @returns [Protocol::HTTP::Response] The
|
|
104
|
+
# @returns [Protocol::HTTP::Response] The delegate response.
|
|
105
105
|
def handle(request)
|
|
106
|
-
return
|
|
106
|
+
return delegate.call(request)
|
|
107
107
|
end
|
|
108
108
|
|
|
109
109
|
# Add the standard application routes to the given router.
|
|
110
110
|
# Override this method and call `super` to add application-specific routes.
|
|
111
111
|
# @parameter router [Router] The router to configure.
|
|
112
112
|
def configure_routes(router)
|
|
113
|
+
router.get("/") do
|
|
114
|
+
Protocol::HTTP::Response[200, [], [self.index.call]]
|
|
115
|
+
end
|
|
116
|
+
|
|
113
117
|
router.route("/live") do |request|
|
|
114
118
|
Async::WebSocket::Adapters::HTTP.open(request, &self.method(:live)) || Protocol::HTTP::Response[400]
|
|
115
119
|
end
|
data/lib/lively/version.rb
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|