Class: Gesund::CLI
- Inherits:
-
Thor
- Object
- Thor
- Gesund::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/gesund/cli.rb
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
10 11 12 13 14 |
# File 'lib/gesund/cli.rb', line 10 def check gesundfile = File.([:gesundfile]) if [:gesundfile] checks = Gesund::Dsl.evaluate(gesundfile) Gesund::Output::Text.new(checks) end |
#http ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/gesund/cli.rb', line 25 def http opts = { # defaults 'port' => 9998, 'host' => '0.0.0.0', 'daemonize' => false, 'debug' => false, 'warn' => true }.merge(.to_hash) gesundfile = File.(opts.delete('gesundfile')) raise Errno::EACCES, "Can't read file #{gesundfile}" unless File.readable?(gesundfile) checks = Gesund::Dsl.evaluate(gesundfile) Gesund::Output::Rack.start(checks, opts) end |