active-dump 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  File : README.md
4
4
  Maintainer : Felix C. Stegerman <flx@obfusk.net>
5
- Date : 2013-11-19
5
+ Date : 2013-12-19
6
6
 
7
7
  Copyright : Copyright (C) 2013 Felix C. Stegerman
8
- Version : v0.2.0
8
+ Version : v0.2.1
9
9
 
10
10
  []: }}}1
11
11
 
data/lib/active-dump.rb CHANGED
@@ -10,6 +10,7 @@
10
10
  # -- ; }}}1
11
11
 
12
12
  require 'active_record'
13
+ require 'erb'
13
14
  require 'yaml'
14
15
 
15
16
  # namespace
@@ -107,8 +108,8 @@ module ActiveDump
107
108
  # @todo use model?!
108
109
  def self.connection # {{{1
109
110
  return @connection if @connection
110
- unless ActiveRecord::Base.connected?
111
- c = YAML.load File.read(CFG_DB)
111
+ unless (ActiveRecord::Base.connection rescue nil)
112
+ c = YAML.load ERB.new(File.read(CFG_DB)).result
112
113
  ActiveRecord::Base.establish_connection c[env]
113
114
  end
114
115
  @connection = ActiveRecord::Base.connection
@@ -1,4 +1,4 @@
1
1
  module ActiveDump
2
- VERSION = '0.2.0'
3
- DATE = '2013-11-19'
2
+ VERSION = '0.2.1'
3
+ DATE = '2013-12-19'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-dump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
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: 2013-11-19 00:00:00.000000000 Z
12
+ date: 2013-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord