Sha256: 2c7acb5052312d7d3f8fd0897e876ff9ca6dd8da77ea7dfc44af5e5b76599754

Contents?: true

Size: 941 Bytes

Versions: 15

Compression:

Stored size: 941 Bytes

Contents

require 'padrino-support'

module Padrino
  module Cli
    module Adapter
      class << self
        # Start for the given options a rackup handler
        def start(options)
          Padrino.run!(Utils.symbolize_keys(options))
        end

        # Method that stop (if exist) a running Padrino.application
        def stop(options)
          options = Utils.symbolize_keys(options)
          if File.exist?(options[:pid])
            pid = File.read(options[:pid]).to_i
            puts "=> Sending INT to process with pid #{pid}"
            begin
              Process.kill(2, pid)
            rescue Errno::ESRCH, RangeError => error
              puts error.message
              exit
            rescue Errno::EPERM => error
              puts error.message
              abort
            end
          else
            puts "=> #{options[:pid]} not found!"
            abort
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
padrino-core-0.16.0.pre3 lib/padrino-core/cli/adapter.rb
padrino-core-0.16.0.pre2 lib/padrino-core/cli/adapter.rb
padrino-core-0.15.3 lib/padrino-core/cli/adapter.rb
padrino-core-0.15.2 lib/padrino-core/cli/adapter.rb
padrino-core-0.15.1 lib/padrino-core/cli/adapter.rb
padrino-core-0.15.0 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.4 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.3 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.2 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.1.1 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.1 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.0.2 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.0.1 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.0 lib/padrino-core/cli/adapter.rb
padrino-core-0.14.0.rc2 lib/padrino-core/cli/adapter.rb