linterbot 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2f26a60af3c2daf0fd41d3de2bba31227e106c9
4
- data.tar.gz: dd5127dee945ad434f69d3a1d8be4568b6fe6f3c
3
+ metadata.gz: 4c2e9bd02e15964967d9c7006c8069ece73e5e67
4
+ data.tar.gz: 2034fbd20f8876edd421ecca00a001f96ba99a65
5
5
  SHA512:
6
- metadata.gz: fc79ca148abf04b7e64aef79bee6f13799c6636adc58112358d04cab86ce51e433f6d2ad69bb89ded7ed9d4ad68e94cfc37e4fed3b9b6d46e2444b4c0f44e1d7
7
- data.tar.gz: 2789de7abf885410d298011b490af03ea10dce24d1034e81af058b6f9d53acea3c8704e9a11b5338c97f452dec5277de68fadf811b0c7199e2d134e47d7c9a66
6
+ metadata.gz: c776bac236b0e9954ae61411fb3fcff3682dcc208c350a69cf2ac9925efb6de0110136d527fbfe164a777ebb928b451d91be5c319cf136dd3f10f350299b8dd7
7
+ data.tar.gz: 502c31793d29772ede43f838cf0673f5059633aa56e9075469a6d25560726db5edcf8aa8b7d2d1fa79ebfecb9cb1296e98e286d419fcc1bd3c8c609e437d678b
data/exe/linterbot CHANGED
@@ -41,7 +41,9 @@ command :run do |c|
41
41
  begin
42
42
  configuration = Linterbot::RunnerConfiguration.configuration!(options)
43
43
  runner = Linterbot::Runner.new(configuration)
44
+ puts "Running linterbot for '#{repository}##{pull_request_number}' ..."
44
45
  runner.run(repository, pull_request_number)
46
+ puts "Linterbot has successfully reviewed your PR ;-)"
45
47
  rescue Linterbot::RunnerConfiguration::MissingAttribute => exception
46
48
  STDERR.puts "Missing configuration attribute '#{exception.attribute_name}'"
47
49
  STDERR.puts "#{exception.fix_description}"
@@ -39,11 +39,17 @@ module Linterbot
39
39
  end
40
40
 
41
41
  def load_config_file(config_file_path)
42
- if File.exist?(config_file_path)
43
- config = YAML.load(File.read(config_file_path))
42
+ return {} unless File.exist?(config_file_path)
43
+ file_content = File.read(config_file_path)
44
+ config = YAML.load(file_content)
45
+ # YAML.load retunrs false if file could not be parsed
46
+ # for example in the case of an empty file.
47
+ if config
44
48
  Hash[config.each.map { |key, value| [key.to_sym, value] }]
45
49
  else
46
- {}
50
+ STDERR.puts "WARNING: Linterbot configuration file '#{config_file_path}' " \
51
+ "has been ignored because is not a valid YAML file."
52
+ return {}
47
53
  end
48
54
  end
49
55
 
@@ -1,3 +1,3 @@
1
1
  module Linterbot
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linterbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guido Marucci Blas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-25 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler