Class: Extension::Tasks::ChooseNextAvailablePort
- Inherits:
-
Object
- Object
- Extension::Tasks::ChooseNextAvailablePort
- Includes:
- ShopifyCLI::MethodObject
- Defined in:
- lib/project_types/extension/tasks/choose_next_available_port.rb
Instance Method Summary collapse
Methods included from ShopifyCLI::MethodObject
Instance Method Details
#call ⇒ Object
14 15 16 17 18 |
# File 'lib/project_types/extension/tasks/choose_next_available_port.rb', line 14 def call available_port = port_range(from: from, to: to).find { |p| available?(host, p) } raise ArgumentError, "Ports between #{from} and #{to} are unavailable" if available_port.nil? available_port end |