Class: Falcon::Command::Redirect
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Falcon::Command::Redirect
- Includes:
- Paths
- Defined in:
- lib/falcon/command/redirect.rb
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
One or more paths to the configuration files.
Instance Method Summary collapse
-
#call ⇒ Object
Prepare the environment and run the controller.
-
#container_class ⇒ Object
The container class to use.
-
#container_options ⇒ Object
Options for the container.
-
#controller ⇒ Object
Prepare a new controller for the command.
-
#endpoint(**options) ⇒ Object
The endpoint to bind to.
-
#redirect_endpoint(**options) ⇒ Object
The template endpoint to redirect to.
Methods included from Paths
#configuration, #resolved_paths
Instance Attribute Details
#paths ⇒ Object (readonly)
One or more paths to the configuration files.
28 |
# File 'lib/falcon/command/redirect.rb', line 28 many :paths |
Instance Method Details
#call ⇒ Object
Prepare the environment and run the controller.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/falcon/command/redirect.rb', line 49 def call Console.logger.info(self) do |buffer| buffer.puts "Falcon Redirect v#{VERSION} taking flight!" buffer.puts "- Binding to: #{@options[:bind]}" buffer.puts "- To terminate: Ctrl-C or kill #{Process.pid}" buffer.puts "- To reload: kill -HUP #{Process.pid}" end self.controller.run end |
#container_class ⇒ Object
The container class to use.
38 39 40 |
# File 'lib/falcon/command/redirect.rb', line 38 def container_class Async::Container.best_container_class end |
#container_options ⇒ Object
Options for the container. See Falcon::Controller::Serve#setup.
44 45 46 |
# File 'lib/falcon/command/redirect.rb', line 44 def {} end |
#controller ⇒ Object
Prepare a new controller for the command.
33 34 35 |
# File 'lib/falcon/command/redirect.rb', line 33 def controller Controller::Redirect.new(self) end |
#endpoint(**options) ⇒ Object
The endpoint to bind to.
61 62 63 |
# File 'lib/falcon/command/redirect.rb', line 61 def endpoint(**) Async::HTTP::Endpoint.parse(@options[:bind], timeout: @options[:timeout], **) end |
#redirect_endpoint(**options) ⇒ Object
The template endpoint to redirect to.
66 67 68 |
# File 'lib/falcon/command/redirect.rb', line 66 def redirect_endpoint(**) Async::HTTP::Endpoint.parse(@options[:redirect], **) end |