dbmanager 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +12 -0
- data/README.md +5 -2
- data/lib/dbmanager/version.rb +1 -1
- data/lib/dbmanager/yml_parser.rb +1 -1
- data/spec/lib/yml_parser_spec.rb +17 -8
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -30,6 +30,7 @@ that will copy the gem rake tasks file into the lib/tasks directory.
|
|
30
30
|
```ruby
|
31
31
|
rake db:dump
|
32
32
|
```
|
33
|
+
This rake task will dump the requested db to a file on the local machine.
|
33
34
|
|
34
35
|
You will be prompted to choose the target dir (defaults to tmp) and the sql file
|
35
36
|
name (sql extension will be added automatically). If the file already exists, it
|
@@ -42,6 +43,9 @@ will be overwritten.
|
|
42
43
|
rake db:import
|
43
44
|
```
|
44
45
|
|
46
|
+
This task will import a source db to a destination db. Tipical use is to import
|
47
|
+
the production db into your development one.
|
48
|
+
|
45
49
|
You will be prompted to choose the source and the target environment db, and the
|
46
50
|
source db will be imported into the target db. All environments containing the
|
47
51
|
string 'production' in their name are protected by default, which means you cannot
|
@@ -64,7 +68,7 @@ You can also use this file to tell the dumper to ignore certain tables with
|
|
64
68
|
the ignoretables directive:
|
65
69
|
|
66
70
|
```yaml
|
67
|
-
beta
|
71
|
+
beta:
|
68
72
|
ignoretables:
|
69
73
|
- users
|
70
74
|
- prods_view
|
@@ -98,4 +102,3 @@ production:
|
|
98
102
|
### TODO
|
99
103
|
|
100
104
|
* Add more db adapters
|
101
|
-
* remove views from mysql dumps so they don't interfere in the import process
|
data/lib/dbmanager/version.rb
CHANGED
data/lib/dbmanager/yml_parser.rb
CHANGED
data/spec/lib/yml_parser_spec.rb
CHANGED
@@ -39,17 +39,26 @@ module Dbmanager
|
|
39
39
|
end
|
40
40
|
|
41
41
|
context 'when there is a dbmanager_override file' do
|
42
|
-
|
43
|
-
|
42
|
+
context 'whe the file is empty' do
|
43
|
+
it 'doesnt raise any error' do
|
44
|
+
YAML.stub!(:load => nil)
|
45
|
+
expect { YmlParser.config }.to_not raise_error
|
46
|
+
end
|
44
47
|
end
|
45
48
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
context 'when the file is populated' do
|
50
|
+
it 'overrides regular settings' do
|
51
|
+
YmlParser.config['beta']['host'].should == '345.345.345.345'
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'removes old unchanged settings' do
|
55
|
+
YmlParser.config['beta']['username'].should == 'beta_username'
|
56
|
+
end
|
49
57
|
|
50
|
-
|
51
|
-
|
52
|
-
|
58
|
+
context 'when the environment has a ignoretables directive' do
|
59
|
+
it 'should populate ignoretables with the expected array' do
|
60
|
+
YmlParser.config['beta']['ignoretables'].should == ['view0']
|
61
|
+
end
|
53
62
|
end
|
54
63
|
end
|
55
64
|
end
|
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.5
|
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-07 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|