madeleine 0.8.0.pre → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -1,9 +1,13 @@
1
+ Madeleine 0.8.0 (December 17, 2012):
2
+
1
3
  * Ruby 1.9 compatible (requires at least 1.8.7)
2
4
  * Dropped the 'automatic' feature (Madeleine::Automatic etc)
3
5
  * Dropped support for SOAP marshalling
4
6
  * Removed deprecated classes:
5
7
  - ClockedSnapshotMadeleine
6
8
  - TimeOptimizingLogger
9
+ * Detects broken custom Marshalling
10
+ * Prevent Marshalling errors from writing bad log entries
7
11
 
8
12
  Madeleine 0.7.3 (June 11, 2006):
9
13
 
data/COPYING CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2003-2004, Anders Bengtsson
2
+ Copyright (c) 2003-2012, Anders Bengtsson
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
5
5
  modification, are permitted provided that the following conditions
data/lib/madeleine.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # Madeleine - Ruby Object Prevalence
3
3
  #
4
4
  # Author:: Anders Bengtsson <ndrsbngtssn@yahoo.se>
5
- # Copyright:: Copyright (c) 2003-2006
5
+ # Copyright:: Copyright (c) 2003-2012
6
6
  #
7
7
  # Usage:
8
8
  #
@@ -148,6 +148,11 @@ module Madeleine
148
148
  unless command.respond_to?(:execute)
149
149
  raise InvalidCommandException.new("Commands must have an 'execute' method")
150
150
  end
151
+ if command.respond_to?(:marshal_dump)
152
+ unless command.respond_to?(:marshal_load)
153
+ raise InvalidCommandException.new("A Command with custom marshalling (mashal_dump()) must also define marshal_load()")
154
+ end
155
+ end
151
156
  end
152
157
  end
153
158
 
@@ -282,7 +287,10 @@ module Madeleine
282
287
  end
283
288
 
284
289
  def store(command)
285
- Marshal.dump(command, @file)
290
+ # Dumping to intermediate String instead of to IO directly, to make sure
291
+ # all of the marshalling worked before we write anything to the log.
292
+ data = Marshal.dump(command)
293
+ @file.write(data)
286
294
  @file.flush
287
295
  @file.fsync
288
296
  end
@@ -1,3 +1,3 @@
1
1
  module Madeleine
2
- VERSION = "0.8.0.pre"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -53,7 +53,7 @@ module Madeleine
53
53
 
54
54
  private
55
55
 
56
- class WorkaroundGzipReader < Zlib::GzipReader
56
+ class WorkaroundGzipReader < Zlib::GzipReader #:nodoc:
57
57
  # The 'psych' YAML parser, default since Ruby 1.9.3,
58
58
  # assumes that its input IO has an external_encoding()
59
59
  # method.
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: madeleine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.pre
5
- prerelease: 6
4
+ version: 0.8.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Anders Bengtsson
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-11 00:00:00.000000000 Z
12
+ date: 2012-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -87,7 +87,13 @@ files:
87
87
  homepage: http://github.com/ghostganz/madeleine
88
88
  licenses: []
89
89
  post_install_message:
90
- rdoc_options: []
90
+ rdoc_options:
91
+ - --exclude
92
+ - test
93
+ - --exclude
94
+ - sample
95
+ - --exclude
96
+ - contrib
91
97
  require_paths:
92
98
  - lib
93
99
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -99,9 +105,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
105
  required_rubygems_version: !ruby/object:Gem::Requirement
100
106
  none: false
101
107
  requirements:
102
- - - ! '>'
108
+ - - ! '>='
103
109
  - !ruby/object:Gem::Version
104
- version: 1.3.1
110
+ version: '0'
105
111
  requirements: []
106
112
  rubyforge_project:
107
113
  rubygems_version: 1.8.24