rubyrep 1.0.0 → 1.0.1

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.
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ == 1.0.1 2009-03-25
2
+
3
+ * 3 minor enhancements:
4
+ * Verified compatibility with active_record 2.3.2 and jruby 1.2.0
5
+ * Released jruby bunde with the updated activerecord and jruby
6
+ * Catch ctrl+c and execute graceful shutdown
7
+
1
8
  == 1.0.0 2009-03-07
2
9
 
3
10
  * 1 major enhancement:
@@ -89,7 +89,9 @@ EOS
89
89
  @termination_mutex = Mutex.new
90
90
  @termination_mutex.lock
91
91
  @waiter_thread ||= Thread.new {@termination_mutex.lock; self.termination_requested = true}
92
- Signal.trap('TERM') {@termination_mutex.unlock}
92
+ %w(TERM INT).each do |signal|
93
+ Signal.trap(signal) {puts "\nCaught '#{signal}': Initiating graceful shutdown"; @termination_mutex.unlock}
94
+ end
93
95
  end
94
96
 
95
97
  # Prepares the replication
@@ -2,7 +2,7 @@ module RR #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -90,20 +90,30 @@ describe ReplicationRunner do
90
90
 
91
91
  runner.pause_replication
92
92
  end
93
-
94
- it "init_waiter should setup correct TERM signal processing" do
95
- runner = ReplicationRunner.new
96
- runner.stub!(:session).and_return(Session.new(standard_config))
93
+
94
+ it "init_waiter should setup correct signal processing" do
95
+ org_stdout = $stdout
96
+ $stdout = StringIO.new
97
+ begin
98
+ runner = ReplicationRunner.new
99
+ runner.stub!(:session).and_return(Session.new(standard_config))
97
100
 
98
- # simulate sending the TERM signal
99
- Signal.should_receive(:trap).with('TERM').and_yield
101
+ # simulate sending the TERM signal
102
+ Signal.should_receive(:trap).with('TERM').and_yield
103
+
104
+ # also verify that the INT signal is trapped
105
+ Signal.should_receive(:trap).with('INT')
100
106
 
101
- runner.init_waiter
107
+ runner.init_waiter
102
108
 
103
- # verify the that any pause would have been prematurely finished and
104
- # termination signal been set
105
- runner.termination_requested.should be_true
106
- runner.instance_variable_get(:@waiter_thread).should_not be_alive
109
+ # verify the that any pause would have been prematurely finished and
110
+ # termination signal been set
111
+ runner.termination_requested.should be_true
112
+ runner.instance_variable_get(:@waiter_thread).should_not be_alive
113
+ $stdout.string.should =~ /TERM.*shutdown/
114
+ ensure
115
+ $stdout = org_stdout
116
+ end
107
117
  end
108
118
 
109
119
  it "prepare_replication should call ReplicationInitializer#prepare_replication" do
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyrep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arndt Lehmann
@@ -30,7 +30,7 @@ cert_chain:
30
30
  NwT26VZnE2nr8g==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-03-08 00:00:00 +09:00
33
+ date: 2009-03-25 00:00:00 +09:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file