scout 5.2.1 → 5.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGELOG +4 -0
  2. data/lib/scout/server.rb +12 -1
  3. data/lib/scout.rb +1 -1
  4. metadata +4 -4
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 5.2.2
2
+
3
+ * More graceful handling of *rare* client_history.yaml corruption
4
+
1
5
  == 5.2.1
2
6
 
3
7
  * Added private-key based code signing
data/lib/scout/server.rb CHANGED
@@ -394,7 +394,18 @@ module Scout
394
394
  create_blank_history
395
395
  end
396
396
  debug "Loading history file..."
397
- @history = File.open(@history_file) { |file| YAML.load(file) }
397
+ contents=File.read(@history_file)
398
+ begin
399
+ @history = YAML.load(contents)
400
+ rescue => e
401
+ backup_path=File.join(File.dirname(@history_file), "history.corrupt")
402
+ info "Couldn't parse the history file. Deleting it and resetting to an empty history file. Keeping a backup at #{backup_path}"
403
+ File.open(backup_path,"w"){|f|f.write contents}
404
+ File.delete(@history_file)
405
+ create_blank_history
406
+ @history = File.open(@history_file) { |file| YAML.load(file) }
407
+ end
408
+
398
409
  info "History file loaded."
399
410
  end
400
411
 
data/lib/scout.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby -wKU
2
2
 
3
3
  module Scout
4
- VERSION = "5.2.1".freeze
4
+ VERSION = "5.2.2".freeze
5
5
  end
6
6
 
7
7
  require "scout/command"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease: false
6
6
  segments:
7
7
  - 5
8
8
  - 2
9
- - 1
10
- version: 5.2.1
9
+ - 2
10
+ version: 5.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Scout Monitoring
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-28 00:00:00 -08:00
18
+ date: 2011-03-01 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency