oncall 0.1.2 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9ad3d2188d3421e55651793b44f1373d884140447ea306eee4cb5ac4d5230cc
4
- data.tar.gz: 4c08ead424c1c35d9c40ab42e0665d7d9f0fd6849c29de876917fc5c099e2edd
3
+ metadata.gz: fd2e38b00bff96ea8ddbf5a16246e61269c82dc8d4d81521f53eef86476885c7
4
+ data.tar.gz: fbeace3395aeeab3140c8694e16d3c5b0081c554e8edb70a0d3916e02bbf44c8
5
5
  SHA512:
6
- metadata.gz: a16db8a950a63c3121b36ad03c0d2b6f06bd755bf2b0d32515403d7c43c588db30fca9eb37d72fb92add0ac8b8053eeb6e5233a8008897b4500038a940b8881f
7
- data.tar.gz: add232c3a1ffb336b396309a9319c5e286d0659f572422377c32ca2e3a75dd52e3a205a8b35b5f3b57bc75705023aaaee01b94daea8b808745a87f1f53f95751
6
+ metadata.gz: 255ec92f86b9b69e4583e16b2e8561ab73c506f6243c88fd79d8d47cbf568966d01c338ba12594860458cdac5c3def3d6390ba32c42a5d26f8411fd0f0d8508b
7
+ data.tar.gz: 976916dbdee674163ba5222c30408653ebc26f40ba5d7f361c8b91dfc4f88404c6b2e5a31564aba76998fa9620482e2621725861489f0826d6da4364572c15e6
@@ -38,7 +38,7 @@ module Oncall
38
38
 
39
39
  protected
40
40
 
41
- def print_version
41
+ def print_version
42
42
  puts "oncall: version #{Oncall::VERSION}"
43
43
  end
44
44
 
@@ -2,7 +2,8 @@ module Oncall
2
2
  module Commands
3
3
  class RunCommand < BaseCommand
4
4
  def call
5
- runner = Oncall::Runner.new
5
+ env = ARGV[1]
6
+ runner = Oncall::Runner.new(env)
6
7
  status = runner.run.to_i
7
8
 
8
9
  SUCCESS
data/lib/oncall/runner.rb CHANGED
@@ -4,10 +4,11 @@ module Oncall
4
4
  class Runner
5
5
  DEFAULT_PATTERN = '**{,/*/**}/*_oncall.rb'
6
6
 
7
- def initialize
7
+ def initialize(env)
8
8
  @config = {}
9
9
  @pattern = DEFAULT_PATTERN
10
10
  @test_wrapper = Oncall::TestWrapper.new
11
+ @env = env
11
12
  end
12
13
 
13
14
  def run
@@ -36,7 +37,13 @@ module Oncall
36
37
  private
37
38
 
38
39
  def merge_config(config)
39
- @config = config
40
+ if config.key?(@env)
41
+ @config = config[@env]
42
+ elsif config.key?('default')
43
+ @config = config[config['default']]
44
+ else
45
+ raise 'Config error'
46
+ end
40
47
  end
41
48
  end
42
49
  end
@@ -10,7 +10,7 @@ module Oncall
10
10
  end
11
11
 
12
12
  def set_config(config)
13
- @config = config['develop']
13
+ @config = config
14
14
  end
15
15
  end
16
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Oncall
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
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.2
4
+ version: 0.1.3
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-28 00:00:00.000000000 Z
11
+ date: 2019-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema