checkson 1.0 → 1.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
  SHA256:
3
- metadata.gz: 1b76e9bdf83ad9a6c86e628c5bdabcac86d07be2ec46c4466ba0f3968c6e28bd
4
- data.tar.gz: 82abf35550e9975fb3541601ab9726bc753e84ccdc309d7f9acf1a38c2f6a88b
3
+ metadata.gz: 5c386902ce53a7dc5f22c4b031122443c0906e02303ddac2789e01e174a72649
4
+ data.tar.gz: 8ea2d1a92101dd4505997739e6032274fc001d75fbd54d415cd157e073a09f51
5
5
  SHA512:
6
- metadata.gz: 754b5f0c8b01185b4d0c0b938b8d6a6cdae4b4309fee27b6bb825fb9d541fa0d6fbdfe894920579b35d29eb08655eb8f745f0f84a8116347e0396d734e07e69e
7
- data.tar.gz: 8dd7bd04ea760424349955e6560b34242080d0ebdbde899820607d29d64fc96874e5e92dd039a4ec76bdae2155dd594f293288f47a7fb1de73d070e699e11619
6
+ metadata.gz: 77ad21c9c5beaa23cb75337eeda4fbf91d2609fc2522be1d99575f29f382d698792fcb01ad56e3946b60d00151255b8e68dbcdc0b2ac7a95d7075f20e8d5768b
7
+ data.tar.gz: 75a3dc66221a03904b0165358c971f3b24646ba66c11f4513cfe3e3ace5f99a29c4eb34a12f697291ab5a4d2adb755f027875e0556cc9c94ca87ff513acbf8a5
data/README.md CHANGED
@@ -1,4 +1,24 @@
1
1
  # Checkson
2
- [![pipeline status](https://gitlab.fsrv.xyz/fsrv/checkson/badges/master/pipeline.svg)](https://gitlab.fsrv.xyz/fsrv/checkson/commits/master)
3
- [![Gem Version](https://badge.fury.io/rb/checkson.svg)](https://badge.fury.io/rb/checkson)
4
2
 
3
+ ## Basic information
4
+
5
+ Checkson is a simple framework for host and network checking. It supports multiple modules.
6
+
7
+ An example config will include multiple blocks, each for a singe test.
8
+
9
+ ## Example configuration
10
+
11
+ ```
12
+ check 'port 61000 is open' do
13
+ using Shell
14
+ set :code, %(sockstat -4 | grep \*:61000)
15
+ help 'Port 61000 is closed'
16
+ end
17
+
18
+ check 'ssh daemon is running' do
19
+ using Process
20
+ set :name, 'sshd'
21
+ help 'Enable and start sshd'
22
+ end
23
+
24
+ ```
File without changes
@@ -10,8 +10,8 @@ require 'logger'
10
10
 
11
11
  module Checkson
12
12
  class APIClient
13
- attr_reader :apiaddr
14
- attr_reader :outfile
13
+ attr_reader :apiaddr, :outfile
14
+
15
15
  def initialize(apiaddr, outfile)
16
16
  @apiaddr = apiaddr
17
17
  @outfile = outfile
@@ -51,7 +51,7 @@ module Checkson
51
51
  private
52
52
 
53
53
  def remove_empty_lines(string)
54
- regex = /^[\s]*$\n/
54
+ regex = /^\s]$\n/
55
55
  string.gsub(regex, '')
56
56
  end
57
57
 
File without changes
@@ -24,8 +24,8 @@ module Checkson
24
24
 
25
25
  def file_check
26
26
  require 'openssl'
27
- raw = File.read @opts[:certfile] if File.file? @opts[:certfile]
28
27
  begin
28
+ raw = File.read @opts[:certfile] if File.file? @opts[:certfile]
29
29
  certificate = OpenSSL::X509::Certificate.new raw
30
30
  cert_check certificate
31
31
  rescue StandardError
File without changes
File without changes
File without changes
File without changes
@@ -5,6 +5,7 @@ require 'ostruct'
5
5
  module Checkson
6
6
  class Config
7
7
  attr_reader :checks, :name
8
+
8
9
  include Checkson::Check
9
10
 
10
11
  def initialize(file)
@@ -3,6 +3,7 @@
3
3
  module Checkson
4
4
  class Context
5
5
  attr_reader :klass, :params
6
+
6
7
  def initialize(&block)
7
8
  @klass = nil
8
9
  @params = {}
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkson
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-18 00:00:00.000000000 Z
11
+ date: 2020-12-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple framework for checking node facts
14
14
  email: florian@fsrv.xyz
@@ -43,14 +43,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: '2.6'
47
47
  required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  requirements: []
53
- rubygems_version: 3.1.2
53
+ rubygems_version: 3.1.4
54
54
  signing_key:
55
55
  specification_version: 4
56
56
  summary: A simple framework for checking