oncall 0.0.2 → 0.0.3
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 +4 -4
- data/lib/oncall/cli.rb +37 -2
- data/lib/oncall/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d6ce91d61b2c62d1ba8e9b80ba7cf85a20c45d93ed6473258b67d693519d299b
|
|
4
|
+
data.tar.gz: 1f4c4647e7834a8b74f0c52a9b0041eb6e059d7c2bca682c4785bbed5c1390cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9f6de545aed6862dafe6045a0c870493c6e48b035c6fd812ea19cb2960fbe8c5740056418d0febe4909f5e8f135e9ac7708deab95863c5e432b1ccfbaba5cf3
|
|
7
|
+
data.tar.gz: be2529c8b0330be34d50b917d13260d86ee9676bfc272e06c71be6602cfff855f6dd0c808bd23bc20d4bd4537e18c55e0c34e11519dc7f617e9270ac551651e3
|
data/lib/oncall/cli.rb
CHANGED
|
@@ -1,16 +1,51 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
require 'net/http'
|
|
3
3
|
require 'yaml'
|
|
4
|
+
require 'optparse'
|
|
4
5
|
|
|
5
6
|
module Oncall
|
|
6
7
|
module CLI
|
|
7
|
-
|
|
8
|
+
extend self
|
|
8
9
|
|
|
10
|
+
USAGE = <<-EOF
|
|
11
|
+
Usage: oncall
|
|
12
|
+
|
|
13
|
+
Options:
|
|
14
|
+
--help Display this help message
|
|
15
|
+
EOF
|
|
16
|
+
|
|
17
|
+
def invoke
|
|
18
|
+
options = parse_options
|
|
19
|
+
|
|
20
|
+
if options[:help]
|
|
21
|
+
print_usage
|
|
22
|
+
exit 0
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
run_tests
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def parse_options
|
|
31
|
+
options = {}
|
|
32
|
+
OptionParser.new do |opt|
|
|
33
|
+
opt.on('--help') { |o| options[:help] = o }
|
|
34
|
+
end.parse!
|
|
35
|
+
|
|
36
|
+
options
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def print_usage
|
|
40
|
+
puts USAGE
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def run_tests
|
|
9
44
|
begin
|
|
10
45
|
config = YAML.load_file('oncall.yml')
|
|
11
46
|
rescue
|
|
12
47
|
puts 'Cannot load oncall.yml'
|
|
13
|
-
exit
|
|
48
|
+
exit 1
|
|
14
49
|
end
|
|
15
50
|
|
|
16
51
|
path = ARGV[0]
|
data/lib/oncall/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oncall
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Koen Woortman
|
|
@@ -86,5 +86,5 @@ requirements: []
|
|
|
86
86
|
rubygems_version: 3.0.3
|
|
87
87
|
signing_key:
|
|
88
88
|
specification_version: 4
|
|
89
|
-
summary: oncall-0.0.
|
|
89
|
+
summary: oncall-0.0.3
|
|
90
90
|
test_files: []
|