Sha256: cf83c59b66aaa7b55a3538e49573039a20a94eb46470efe653c952b187849117

Contents?: true

Size: 661 Bytes

Versions: 1

Compression:

Stored size: 661 Bytes

Contents

require 'activehook/server'

module ActiveHook
  class CLI
    def initialize(argv)
      setup_options(argv)
    end

    def start
      server = ActiveHook::Server.new
      server.start
    end

    private

    def setup_options(argv)
      parser = OptionParser.new do |o|
        o.banner = 'Usage: bundle exec bin/activehook [options]'

        o.on('-c', '--config PATH', 'Load PATH for config file') do |arg|
          load(arg)
          ActiveHook.log.info("Loaded configuration from #{arg}")
        end

        o.on('-h', '--help', 'Prints this help') do
          puts o && exit
        end
      end
      parser.parse!(argv)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activehook-0.1.0 lib/activehook/cli.rb