oncall 0.1.3 → 0.1.4
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/bin/oncall +1 -1
- data/lib/oncall/cli.rb +4 -4
- data/lib/oncall/commands/base_command.rb +18 -46
- data/lib/oncall/commands/init_command.rb +9 -4
- data/lib/oncall/commands/run_command.rb +4 -6
- data/lib/oncall/configuration.rb +5 -0
- data/lib/oncall/dsl.rb +4 -0
- data/lib/oncall/templates/oncall.yml.template +4 -0
- data/lib/oncall/version.rb +1 -1
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31d579e917f9d0d901321e0d2338a6634242af577d39cc47aa03d6a16ca320bd
|
4
|
+
data.tar.gz: 2d8ed801f79a30dfe9bd2229b5e480fbc1886fdd242383933afa7f1cdc171c5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d40805eb76731aa2759b4ead7d1ab76bbafae194b4117605972edd62f4d2f5c947201a18266176df99861682aa28e9360dfa008d03bb64c43dc76c8e355ae326
|
7
|
+
data.tar.gz: fa7d697ca82deb7b7b793667f324ff7af89530339b9584dc2b4e79cf958258e2e8c39ef2c8eeeb088431b1f79e3665fb7c04ce6f731900b2ec9363b2da345ef3
|
data/bin/oncall
CHANGED
data/lib/oncall/cli.rb
CHANGED
@@ -8,14 +8,14 @@ module Oncall
|
|
8
8
|
module CLI
|
9
9
|
extend self
|
10
10
|
|
11
|
-
def
|
11
|
+
def self.run
|
12
12
|
case ARGV[0].to_s.downcase
|
13
13
|
when 'init'
|
14
|
-
Oncall::Commands::InitCommand.invoke
|
14
|
+
Oncall::Commands::InitCommand.invoke(ARGV.shift)
|
15
15
|
when 'run'
|
16
|
-
Oncall::Commands::RunCommand.invoke
|
16
|
+
Oncall::Commands::RunCommand.invoke(ARGV.shift)
|
17
17
|
else
|
18
|
-
Oncall::Commands::BaseCommand.invoke
|
18
|
+
Oncall::Commands::BaseCommand.invoke(ARGV)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -3,53 +3,25 @@ require_relative '../version'
|
|
3
3
|
module Oncall
|
4
4
|
module Commands
|
5
5
|
class BaseCommand
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
--
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
def self.invoke
|
25
|
-
exit new.call.to_i
|
26
|
-
end
|
27
|
-
|
28
|
-
def call
|
29
|
-
case @options[0]
|
30
|
-
when :version
|
31
|
-
print_version
|
32
|
-
else
|
33
|
-
puts USAGE
|
34
|
-
end
|
35
|
-
|
36
|
-
SUCCESS
|
37
|
-
end
|
38
|
-
|
39
|
-
protected
|
40
|
-
|
41
|
-
def print_version
|
42
|
-
puts "oncall: version #{Oncall::VERSION}"
|
43
|
-
end
|
44
|
-
|
45
|
-
def parse_options
|
46
|
-
options = []
|
47
|
-
OptionParser.new do |opt|
|
48
|
-
opt.on('--help') { options.push(:help) }
|
49
|
-
opt.on('--version') { options.push(:version) }
|
6
|
+
def self.invoke(args)
|
7
|
+
OptionParser.new do |opts|
|
8
|
+
opts.banner = 'Usage: oncall'
|
9
|
+
opts.separator ''
|
10
|
+
opts.separator 'Options:'
|
11
|
+
|
12
|
+
opts.on('--version', 'Show version information.') do
|
13
|
+
puts "oncall: version #{Oncall::VERSION}"
|
14
|
+
exit
|
15
|
+
end
|
16
|
+
|
17
|
+
opts.on('--help', 'Display this help message.') do
|
18
|
+
puts opts
|
19
|
+
exit
|
20
|
+
end
|
21
|
+
|
22
|
+
puts opts
|
23
|
+
exit
|
50
24
|
end.parse!
|
51
|
-
|
52
|
-
options
|
53
25
|
end
|
54
26
|
end
|
55
27
|
end
|
@@ -1,10 +1,15 @@
|
|
1
1
|
module Oncall
|
2
2
|
module Commands
|
3
|
-
class InitCommand
|
4
|
-
def
|
5
|
-
|
3
|
+
class InitCommand
|
4
|
+
def self.invoke(args)
|
5
|
+
config_template_path = File.join(File.dirname(__FILE__), '..', 'templates', 'oncall.yml.template')
|
6
|
+
template = File.read(config_template_path)
|
6
7
|
|
7
|
-
|
8
|
+
File.open(File.join(Dir.getwd, 'oncall.yml'), 'w') do |file|
|
9
|
+
file.write(template)
|
10
|
+
end
|
11
|
+
|
12
|
+
exit
|
8
13
|
end
|
9
14
|
end
|
10
15
|
end
|
@@ -1,12 +1,10 @@
|
|
1
1
|
module Oncall
|
2
2
|
module Commands
|
3
|
-
class RunCommand
|
4
|
-
def
|
5
|
-
env = ARGV[
|
3
|
+
class RunCommand
|
4
|
+
def self.invoke(args)
|
5
|
+
env = ARGV[0]
|
6
6
|
runner = Oncall::Runner.new(env)
|
7
|
-
|
8
|
-
|
9
|
-
SUCCESS
|
7
|
+
exit runner.run.to_i
|
10
8
|
end
|
11
9
|
end
|
12
10
|
end
|
data/lib/oncall/dsl.rb
ADDED
data/lib/oncall/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oncall
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koen Woortman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.2.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: sinatra
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,8 +81,11 @@ files:
|
|
67
81
|
- lib/oncall/commands/base_command.rb
|
68
82
|
- lib/oncall/commands/init_command.rb
|
69
83
|
- lib/oncall/commands/run_command.rb
|
84
|
+
- lib/oncall/configuration.rb
|
85
|
+
- lib/oncall/dsl.rb
|
70
86
|
- lib/oncall/request.rb
|
71
87
|
- lib/oncall/runner.rb
|
88
|
+
- lib/oncall/templates/oncall.yml.template
|
72
89
|
- lib/oncall/test_case.rb
|
73
90
|
- lib/oncall/test_wrapper.rb
|
74
91
|
- lib/oncall/version.rb
|