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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4f90097ca71e02dffa056e9251b96a63f0d45262ad5eddd0f073d2d02d42b6e
4
- data.tar.gz: 214a19575d3f3fa624a3d71494b888feccebc18774fa1e38255ec4ceb90c84a6
3
+ metadata.gz: 6ffe05b0ea4fbdde40a40b59e85277e9a87bd2ca0cd57350f720a7c4dd1f8445
4
+ data.tar.gz: d53aedcf48bfd4eab8f1017b214ab2ee3b2cb424ca676c7f495cc7d68dcd5e11
5
5
  SHA512:
6
- metadata.gz: 23cc87763d59471eaabdfee09f234f389c3576f7bb6d59df85f65e0205d7f6244710c20cfed77c3e0543513f4db581664e776062383c9a05491673ca8bfc88b8
7
- data.tar.gz: 5b905206f71fcea3f15da3f6db3f0e8fcd9f1bd85f06278654d621affb4d72cf42828b828a1f6821602a98f8af5b8441fe701a4785a7626b4327f972dad8b03d
6
+ metadata.gz: 827c7ea471e0e9075422332e679b7ff05070d040f9e49dc2ce3e69dd23c852b70bd25fed8a6d0c53485391d2e0b906883fae64f6f97a7ad3bc9c30d845b9cc82
7
+ data.tar.gz: a2bd006da9cce6a5303c3e7aa78bf43d4e895c3fff1f7086b7d071872be1742349d7b6549d5e9b853b7e1e72141f0f4ee039de523f2f2de8bc72198a619eda6d
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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:
@@ -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 HTTP response with the rendered page.
104
+ # @returns [Protocol::HTTP::Response] The delegate response.
105
105
  def handle(request)
106
- return Protocol::HTTP::Response[200, [], [self.index.call]]
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
@@ -5,5 +5,5 @@
5
5
 
6
6
  # @namespace
7
7
  module Lively
8
- VERSION = "0.19.0"
8
+ VERSION = "0.20.0"
9
9
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lively
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file