Sha256: 7e8135022108e1cb195fd0fd25c8cf52abbb192cb78a3a2082e30dcf6a6a5503

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

module Snapme
  module CLI
    class Command
      def self.start(args)
        options    = Options.parse(args)
        auth_token = ENV['SNAPME_AUTH_TOKEN']

        if options.kill
          `killall snapme`
          return
        end

        if options.show_version
          puts Snapme::Version
          return
        end

        if auth_token
          Process.daemon(true) if options.daemon
          Snapper.new(options.host, options.interval, auth_token).run
        else
          puts <<-MSG
  Please set SNAPME_AUTH_TOKEN in your environment. You can get your
  auth token from http://snapme.herokuapp.com
          MSG
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
snapme-0.2.2 lib/snapme/cli/command.rb