falcon 0.26.0 → 0.27.0

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: fab1eafce5a511075f7339beabec2ef2364693ffeb050b84e90a8223e3faf614
4
- data.tar.gz: 6f2512f83e06c16ab5600c66ceefc0d2ea910e6f8a53df3d8d919600c75671af
3
+ metadata.gz: 5d8f6d04def38b5f391b3cdcc17935b06612a9c95137bfaf563c58ac21cc0edc
4
+ data.tar.gz: '085234503af9930b2d0a9bf7430673bb896456c2093cc627eee83fb7a6d9e1a3'
5
5
  SHA512:
6
- metadata.gz: 0ce28b54426aa8ccbba9801e18c548a284ffbc8c64b54a9cf03b6d3af75ed11b029b999de1e923509b8e16ff525c465ac82695e6a37c9a207f002447333d5c83
7
- data.tar.gz: 916bf5e17a59d440c633471a809fad988693f050d8912dd236150983bbb81a4fd2235406418f5a740072aec8e21ed8844593c123d47533d6b6255ddaa7221d14
6
+ metadata.gz: 41223e695feb4428ef06b260dd4b4a178c35f8889708198f5f94f4f598b6322b2c0d431e0268372debe54fd670fdb146efa2126295d8022a956a4878dd9ce095
7
+ data.tar.gz: 33728e72a25355cb7025b0ae1c4f4883fc200251d82fe8d7ee1011c240ec9f49769c601a95da80801736a6cfeb3c1f78f3d499ac9c013425cc82c27c90987016
data/README.md CHANGED
@@ -52,7 +52,7 @@ falcon [--verbose | --quiet] [-h/--help] [-v/--version] <command>
52
52
  An asynchronous HTTP server.
53
53
 
54
54
  [--verbose | --quiet] Verbosity of output for debugging.
55
- [-h/--help] Print out help information.
55
+ [-h/--help] Print out help information.
56
56
  [-v/--version] Print out the application version.
57
57
  <command> One of: serve, virtual. Default: serve
58
58
 
@@ -60,15 +60,16 @@ falcon [--verbose | --quiet] [-h/--help] [-v/--version] <command>
60
60
  Run an HTTP server.
61
61
 
62
62
  [-b/--bind <address>] Bind to the given hostname/address Default: https://localhost:9292
63
- [-p/--port <number>] Override the specified port
63
+ [-p/--port <number>] Override the specified port
64
64
  [-h/--hostname <hostname>] Specify the hostname which would be used for certificates, etc.
65
- [-t/--timeout <duration>] Specify the maximum time to wait for blocking operations. Default: 60
66
- [--reuse-port] Enable SO_REUSEPORT if possible. Default: false
67
- [-c/--config <path>] Rackup configuration file to load Default: config.ru
68
- [--forked | --threaded | --hybrid] Select a specific parallelism model Default: forked
69
- [-n/--count <count>] Number of instances to start. Default: 8
70
- [--forks <count>] Number of forks (hybrid only).
71
- [--threads <count>] Number of threads (hybrid only). ```
65
+ [-t/--timeout <duration>] Specify the maximum time to wait for blocking operations. Default: 60
66
+ [--reuse-port] Enable SO_REUSEPORT if possible. Default: false
67
+ [-c/--config <path>] Rackup configuration file to load Default: config.ru
68
+ [--forked | --threaded | --hybrid] Select a specific parallelism model Default: forked
69
+ [-n/--count <count>] Number of instances to start. Default: 8
70
+ [--forks <count>] Number of forks (hybrid only).
71
+ [--threads <count>] Number of threads (hybrid only).
72
+ ```
72
73
 
73
74
  To run on a different port:
74
75
 
data/bin/falcon CHANGED
@@ -23,6 +23,6 @@
23
23
  require_relative '../lib/falcon'
24
24
 
25
25
  begin
26
- Falcon::Command.parse(ARGV).invoke
26
+ Falcon::Command.call
27
27
  rescue Interrupt
28
28
  end
data/falcon.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_dependency "rack", ">= 1.0"
27
27
 
28
- spec.add_dependency 'samovar', "~> 1.3"
28
+ spec.add_dependency 'samovar', "~> 2.1"
29
29
  spec.add_dependency 'localhost', "~> 1.1"
30
30
  spec.add_dependency 'build-environment', '~> 1.6'
31
31
 
@@ -28,8 +28,8 @@ require 'logger'
28
28
 
29
29
  module Falcon
30
30
  module Command
31
- def self.parse(*args)
32
- Top.parse(*args)
31
+ def self.call(*args)
32
+ Top.call(*args)
33
33
  end
34
34
 
35
35
  class Top < Samovar::Command
@@ -41,7 +41,7 @@ module Falcon
41
41
  option '-v/--version', "Print out the application version."
42
42
  end
43
43
 
44
- nested '<command>', {
44
+ nested :command, {
45
45
  'serve' => Serve,
46
46
  'virtual' => Virtual
47
47
  }, default: 'serve'
@@ -54,7 +54,7 @@ module Falcon
54
54
  @options[:logging] == :quiet
55
55
  end
56
56
 
57
- def invoke(program_name: File.basename($0))
57
+ def call
58
58
  if verbose?
59
59
  Async.logger.level = Logger::DEBUG
60
60
  elsif quiet?
@@ -64,11 +64,11 @@ module Falcon
64
64
  end
65
65
 
66
66
  if @options[:version]
67
- puts "falcon v#{Falcon::VERSION}"
68
- elsif @options[:help] or @command.nil?
69
- print_usage(program_name)
67
+ puts "#{self.name} v#{Falcon::VERSION}"
68
+ elsif @options[:help]
69
+ self.print_usage
70
70
  else
71
- @command.invoke(self)
71
+ @command.call
72
72
  end
73
73
  end
74
74
  end
@@ -146,7 +146,7 @@ module Falcon
146
146
  return container
147
147
  end
148
148
 
149
- def invoke(parent)
149
+ def call
150
150
  container = run(parent.verbose?)
151
151
 
152
152
  container.wait
@@ -59,7 +59,7 @@ module Falcon
59
59
  return hosts.run(@options)
60
60
  end
61
61
 
62
- def invoke(parent)
62
+ def call
63
63
  container = run(parent.verbose?)
64
64
 
65
65
  container.wait
@@ -94,6 +94,12 @@ module Falcon
94
94
  end
95
95
  end
96
96
 
97
+ add(:lets_encrypt, :ssl) do
98
+ lets_encrypt_root '/etc/letsencrypt/live'
99
+ ssl_certificate_path {File.join(lets_encrypt_root, authority, "fullchain.pem")}
100
+ ssl_private_key_path {File.join(lets_encrypt_root, authority, "privkey.pem")}
101
+ end
102
+
97
103
  add(:self_signed, :ssl) do
98
104
  ssl_context do
99
105
  contexts = Localhost::Authority.fetch(authority)
@@ -189,7 +195,7 @@ module Falcon
189
195
  end
190
196
 
191
197
  def load_file(path)
192
- self.instance_eval(File.read(path), path)
198
+ self.instance_eval(File.read(path), File.realpath(path))
193
199
  end
194
200
  end
195
201
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Falcon
22
- VERSION = "0.26.0"
22
+ VERSION = "0.27.0"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: falcon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-04 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-protocol
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.3'
103
+ version: '2.1'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.3'
110
+ version: '2.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: localhost
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  - !ruby/object:Gem::Version
322
322
  version: '0'
323
323
  requirements: []
324
- rubygems_version: 3.0.2
324
+ rubygems_version: 3.0.3
325
325
  signing_key:
326
326
  specification_version: 4
327
327
  summary: A fast, asynchronous, rack-compatible web server.