dumper 0.4.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,11 +9,10 @@ Dumper is a backup management system that offers a whole new way to take daily b
9
9
  * Ruby 1.8.7 , Ruby 1.9.2 or later
10
10
  * Rails 3.0 or later
11
11
  * MySQL with ActiveRecord
12
+ * PostgreSQL with ActiveRecord
12
13
  * MongoDB with the mongo gem (including Mongoid 2.x)
13
- * Redis with the redis gem **To take backups from Redis, you must run agent on the Redis host**
14
- * Runs inside [thin](http://code.macournoyer.com/thin/), [unicorn](http://unicorn.bogomips.org/), [passenger](http://www.modrails.com/) or [resque](https://github.com/defunkt/resque) (mongrel and webrick are also supported for development)
15
-
16
- Support for PostgreSQL is coming soon.
14
+ * Redis with the redis gem - **limitation: you must run agent on the Redis host**
15
+ * Agent runs inside [thin](http://code.macournoyer.com/thin/), [unicorn](http://unicorn.bogomips.org/), [passenger](http://www.modrails.com/) or [resque](https://github.com/defunkt/resque) (mongrel and webrick are also supported for development)
17
16
 
18
17
  ## Installation
19
18
 
@@ -11,7 +11,15 @@ module Dumper
11
11
 
12
12
  class << self
13
13
  def start(options = {})
14
- new(options).start
14
+ if defined?(Rails::Railtie)
15
+ ActiveSupport.on_load :after_initialize do
16
+ # Since the first Redis object could be instantiated after our initializer gets run,
17
+ # we start the agent after all initializers are loaded.
18
+ Dumper::Agent.new(options).start
19
+ end
20
+ else
21
+ new(options).start
22
+ end
15
23
  end
16
24
 
17
25
  def start_if(options = {})
@@ -23,7 +31,7 @@ module Dumper
23
31
  log 'app_key is missing' if options[:app_key].blank?
24
32
 
25
33
  @stack = Dumper::Stack.new(options)
26
- @api_base = options[:api_base] || 'http://dumper.io'
34
+ @api_base = options[:api_base] || 'https://dumper.io'
27
35
  @app_key = options[:app_key]
28
36
  @app_env = @stack.rails_env
29
37
  @app_name = ObjectSpace.each_object(Rails::Application).first.class.name.split("::").first
@@ -40,11 +48,13 @@ module Dumper
40
48
 
41
49
  def start_loop
42
50
  sec = 1
51
+ register_body = MultiJson.dump(register_hash)
52
+ log "message body for agent/register: #{register_body}", :debug
43
53
  begin
44
54
  sec *= 2
45
55
  log "sleeping #{sec} seconds for agent/register", :debug
46
56
  sleep sec
47
- json = api_request('agent/register', :json => MultiJson.dump(register_hash))
57
+ json = api_request('agent/register', :json => register_body)
48
58
  end until json[:status]
49
59
 
50
60
  return log("agent stopped: #{json.to_s}") if json[:status] == 'error'
@@ -1,3 +1,3 @@
1
1
  module Dumper
2
- VERSION = '0.4.0'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-07 00:00:00.000000000 Z
12
+ date: 2012-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json