gesund 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ec1a89a0ea157b733c627882094e3cfa86a3489
4
- data.tar.gz: 4e7379ccf36fcbfb21ba20590ea5cb2092c264b7
3
+ metadata.gz: 5e28d68c032337e62cdeef2496e97e3985989fba
4
+ data.tar.gz: 156cf02c7bab3935794b707bb7796448b8faccc9
5
5
  SHA512:
6
- metadata.gz: dd03f74f3495b5f870370880e8ba305f9e7adaa793b06e3a6d0ec8d5fd32cdcf18a2b7b4f13cc4f21fc2bbfc44586727afdd2a526006f419e2b045fb1b750bc9
7
- data.tar.gz: fe2f508b127285b0fd0baf60efca950e03284d14256ccadc59438cbe45d39a22be0f2625e2a7aa742d0174b428bf627c5f37f3673fb6b3f2bdd9768ecc007cd2
6
+ metadata.gz: 1ec43f142c703802f8d70e0a8afb24e3a6443a71e0702f6f579aea783805a5e55f0b03be72a045953674b7f902228e36c41fbe763d50e6265c73e20b93fbf60b
7
+ data.tar.gz: 74b3c92d6bb955260306fe7d20ade368dd8cfa579b74536cb7a482929244e590d8e0d5cd089ddd14aa12ac66689bae6907446cc9fc5b7f674259a583bf906305
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gesund (0.0.5)
4
+ gesund (0.0.6)
5
5
  rack
6
6
  thor
7
7
 
@@ -23,8 +23,14 @@ module Gesund
23
23
  option :warn, :type => :boolean, :default => true, :desc => 'turn on warnings'
24
24
  desc "http", "Starts a web server that answers to requests with results of checks from Gesundfile"
25
25
  def http
26
- opts = options.dup
27
- gesundfile = File.expand_path(opts.delete(:gesundfile))
26
+ opts = { # defaults
27
+ 'port' => 9998,
28
+ 'host' => '0.0.0.0',
29
+ 'daemonize' => false,
30
+ 'debug' => false,
31
+ 'warn' => true
32
+ }.merge(options.to_hash)
33
+ gesundfile = File.expand_path(opts.delete('gesundfile'))
28
34
  raise Errno::EACCES, "Can't read file #{gesundfile}" unless File.readable?(gesundfile)
29
35
  checks = Gesund::Dsl.evaluate(gesundfile)
30
36
  Gesund::Output::Rack.start(checks, opts)
@@ -1,3 +1,3 @@
1
1
  module Gesund
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -12,6 +12,14 @@ describe Gesund::CLI do
12
12
  end
13
13
  end
14
14
  context "#http" do
15
+ let(:default_opts) do
16
+ { 'port' => 9998,
17
+ 'host' => '0.0.0.0',
18
+ 'daemonize' => false,
19
+ 'debug' => false,
20
+ 'warn' => true
21
+ }
22
+ end
15
23
  it "should raise an error when the Gesundfile is not readable" do
16
24
  expect(File).to receive(:readable?).with(gesundfile) { false }
17
25
  expect { subject.http }.to raise_error(Errno::EACCES, /Can't read file #{gesundfile}/)
@@ -22,7 +30,7 @@ describe Gesund::CLI do
22
30
  end
23
31
  it "evaluates a supplied gesundfile" do
24
32
  expect(Gesund::Dsl).to receive(:evaluate).with(gesundfile) { ['checks-http'] }
25
- expect(Gesund::Output::Rack).to receive(:start).with(['checks-http'], {})
33
+ expect(Gesund::Output::Rack).to receive(:start).with(['checks-http'], default_opts)
26
34
  subject.http
27
35
  end
28
36
  end
@@ -1,3 +1,3 @@
1
1
  describe Gesund::VERSION do
2
- it { should == "0.0.5" }
2
+ it { should == "0.0.6" }
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gesund
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Zislis