rackula 1.3.2 → 1.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: 88a788f2105cbba5d2b73f3eafec273639c9553ebfa8c2fb03fc7a759f1c6089
4
- data.tar.gz: 6fc23962c9da639b66f33cb58c4745a5f0f6629190c59c5b48423efe4c715b6a
3
+ metadata.gz: ccc36740b9e7e49a82036a7b3b15ec0eb8a1c856602f24131546e8dadbb18226
4
+ data.tar.gz: 12765e13ba4e2812a6b43cc8d6ed7493100c640302fd6197541c4f91f9e0c8a9
5
5
  SHA512:
6
- metadata.gz: 381f72627bd42c4417e989f96372e98764ddc3818f899ccd6d058dfc3c9c1eb30459cd2c272286b0a7d19ee7233df845697ca0f2a5cfb174817df722f05209e5
7
- data.tar.gz: 568e77791aa8f68c68474118ba0e337aa41a5200f05ce00c5cc680bf1c0120e797367b78534cf2c3177de9d9bd3427d079e35ba102f76eaef74398e8f4b69476
6
+ metadata.gz: 2f4dc00059ef1933403658f8d2a66a63c0a732e1319ebad770f0b8ac87daff83bb2580e301ab52da15f0ace54f0e252a4175e3af2276d5a5e8cad4035117cc3b
7
+ data.tar.gz: df6f4a56a88d5ec8a0c88d6bb24a0eafdf68409122f85bb6eff073f46b4140fa27ab522ff84d2cda51d694a05ac626948a3cca2648ab9ad9e81e2c503970e4c5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -12,7 +12,7 @@ require 'rack'
12
12
 
13
13
  require 'falcon/server'
14
14
 
15
- require 'io/endpoint'
15
+ require 'io/endpoint/host_endpoint'
16
16
  require 'async/container'
17
17
  require 'async/http'
18
18
 
@@ -63,7 +63,7 @@ module Rackula
63
63
  config_path = root + @options[:config]
64
64
 
65
65
  container.run do |instance|
66
- Async do
66
+ Sync do
67
67
  rack_app, _ = Rack::Builder.parse_file(config_path.to_s)
68
68
  app = ::Falcon::Server.middleware(rack_app, verbose: @options[:verbose])
69
69
  server = ::Falcon::Server.new(app, endpoint)
@@ -79,8 +79,12 @@ module Rackula
79
79
  return container
80
80
  end
81
81
 
82
- def run(address, root)
83
- endpoint = Async::HTTP::Endpoint.parse("http://localhost", port: address.ip_port, reuse_port: true)
82
+ def run(bound_endpoint, root)
83
+ # We need to determine the actual port we are bound to:
84
+ local_addresses = bound_endpoint.sockets.map(&:local_address)
85
+ address = local_addresses.first
86
+
87
+ endpoint = Async::HTTP::Endpoint.parse("http://localhost", bound_endpoint)
84
88
 
85
89
  Console.logger.info(self) {"Setting up container to serve site on port #{address.ip_port}..."}
86
90
  container = serve(endpoint, root)
@@ -96,10 +100,13 @@ module Rackula
96
100
 
97
101
  endpoint = ::IO::Endpoint.tcp("localhost", 0, reuse_port: true)
98
102
 
99
- # We bind to a socket to generate a temporary port:
100
- socket = Sync{endpoint.bind.first}
101
-
102
- run(socket.local_address, Pathname.new(parent.root))
103
+ begin
104
+ bound_endpoint = endpoint.bound
105
+
106
+ run(bound_endpoint, Pathname.new(parent.root))
107
+ ensure
108
+ bound_endpoint&.close
109
+ end
103
110
  end
104
111
  end
105
112
  end
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2024, by Samuel Williams.
5
5
 
6
6
  module Rackula
7
- VERSION = "1.3.2"
7
+ VERSION = "1.4.1"
8
8
  end
data/readme.md CHANGED
@@ -8,7 +8,7 @@ Rackula will immortalize your rackup web app by generating a static copy. It can
8
8
 
9
9
  Please see the [project documentation](https://socketry.github.io/rackula/) for more details.
10
10
 
11
- - [Getting Started](https://socketry.github.io/rackula/guides/getting-started/index) - This guide will show you how to use the `rakula` gem to create a simple static website.
11
+ - [Getting Started](https://socketry.github.io/rackula/guides/getting-started/index) - This guide will show you how to use the `rackula` gem to create a simple static website.
12
12
 
13
13
  ## Contributing
14
14
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackula
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -39,7 +39,7 @@ cert_chain:
39
39
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
40
40
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
41
41
  -----END CERTIFICATE-----
42
- date: 2024-04-24 00:00:00.000000000 Z
42
+ date: 2024-08-02 00:00:00.000000000 Z
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: falcon
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
- rubygems_version: 3.5.3
121
+ rubygems_version: 3.5.11
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Generate a static site from any rackup compatible application.
metadata.gz.sig CHANGED
Binary file