dbmanager 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dbmanager.rb +1 -0
- data/lib/dbmanager/adapters/mysql.rb +4 -2
- data/lib/dbmanager/version.rb +1 -1
- data/spec/lib/adapters/mysql_spec.rb +11 -2
- metadata +2 -2
data/lib/dbmanager.rb
CHANGED
@@ -35,6 +35,7 @@ require 'active_support/deprecation'
|
|
35
35
|
require 'active_support/core_ext/module'
|
36
36
|
require 'active_support/ordered_hash'
|
37
37
|
require 'active_support/core_ext/enumerable'
|
38
|
+
require 'active_support/core_ext/object/blank'
|
38
39
|
|
39
40
|
%w[yml_parser adapters/mysql runner importer dumper].each do |string|
|
40
41
|
require File.expand_path "../dbmanager/#{string}", __FILE__
|
@@ -24,8 +24,10 @@ module Dbmanager
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def ignore_tables
|
27
|
-
ignoretables.
|
28
|
-
|
27
|
+
if ignoretables.present?
|
28
|
+
ignoretables.inject('') do |s, view|
|
29
|
+
s << " --ignore-table=#{database}.#{view}"
|
30
|
+
end
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
data/lib/dbmanager/version.rb
CHANGED
@@ -20,8 +20,17 @@ module Dbmanager
|
|
20
20
|
end
|
21
21
|
|
22
22
|
describe '#ignore_tables' do
|
23
|
-
|
24
|
-
|
23
|
+
context 'when there are tables to be skipped' do
|
24
|
+
it 'returns expected string' do
|
25
|
+
subject.ignore_tables.should == ' --ignore-table=demo_test.view0 --ignore-table=demo_test.view1'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'when there are no tables to be skipped' do
|
30
|
+
it 'returns nil' do
|
31
|
+
subject.stub!(:ignoretables => nil)
|
32
|
+
subject.ignore_tables.should be_nil
|
33
|
+
end
|
25
34
|
end
|
26
35
|
end
|
27
36
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dbmanager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- andrea longhi
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-04-
|
13
|
+
date: 2012-04-05 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|