dumptruck 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/dumptruck.gemspec +2 -3
- data/lib/dumptruck/load.rb +3 -5
- data/lib/dumptruck/truck.rb +1 -1
- data/lib/dumptruck/version.rb +1 -1
- data/spec/load_spec.rb +7 -5
- data/spec/truck_spec.rb +3 -3
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02ff36e085d700745fc06ef42e4ccb44f2ce618b
|
4
|
+
data.tar.gz: d405b3b38062c5af154db52dd834aead4e92b75d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ac4fd7b1f3380e2b70a8ddbe87900ad8e581d1d885d71033e9e83eb558abc9409ced7a87d7eb62ce4b8f4ad23a3beaf09502cd7afdcdb7d7c365efb9cc72c6c
|
7
|
+
data.tar.gz: 8575be71aebdc5275b91270aa0f9d8569326cd606ce2ea3bf390d8d64cdf5e6574a18f6a5dd7ebd96826fda29fe6d66033b543fd742e8c98cbfc3431ead51e47
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
DumpTruck
|
2
2
|
=========
|
3
|
-
[![Gem Version](
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/dumptruck.svg)](http://badge.fury.io/rb/dumptruck)
|
4
4
|
[![Build Status](https://travis-ci.org/delianides/dumptruck.svg?branch=master)](https://travis-ci.org/delianides/dumptruck)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/delianides/dumptruck/badge.png?branch=master)](https://coveralls.io/r/delianides/dumptruck?branch=master)
|
6
6
|
|
@@ -13,7 +13,7 @@ Requirements
|
|
13
13
|
- mysqldump executable
|
14
14
|
|
15
15
|
Installation
|
16
|
-
|
16
|
+
-----------
|
17
17
|
|
18
18
|
gem 'dumptruck'
|
19
19
|
|
@@ -34,7 +34,7 @@ truck = Dumptruck::Truck.new({
|
|
34
34
|
port: 3306, #default
|
35
35
|
output_dir: "/tmp", #where the dump files go
|
36
36
|
filename: "output", #default, can be changed
|
37
|
-
|
37
|
+
mysqldump_bin: "/path/to/bin/",
|
38
38
|
})
|
39
39
|
```
|
40
40
|
|
data/dumptruck.gemspec
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
4
3
|
require 'dumptruck/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
@@ -20,8 +19,8 @@ Gem::Specification.new do |spec|
|
|
20
19
|
|
21
20
|
spec.required_ruby_version = '>= 1.9.3'
|
22
21
|
|
22
|
+
spec.add_dependency "cocaine", "~> 0.5.4"
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.5"
|
24
|
-
spec.add_development_dependency "cocaine", "~> 0.5.4"
|
25
24
|
spec.add_development_dependency "rake", "~> 0"
|
26
25
|
spec.add_development_dependency "rspec", "~> 2.14"
|
27
26
|
spec.add_development_dependency "guard", "~> 2.6"
|
data/lib/dumptruck/load.rb
CHANGED
@@ -3,16 +3,14 @@ module Dumptruck
|
|
3
3
|
#Specify a Database [TODO] if database isn't specified then --all-databases is used
|
4
4
|
attr_accessor :database
|
5
5
|
|
6
|
-
def initialize(params)
|
6
|
+
def initialize(params = {})
|
7
7
|
defaults = {
|
8
|
-
options: ["--single-transaction", "--
|
8
|
+
options: ["--single-transaction", "--opt", "--skip-comments"],
|
9
9
|
}.merge!(params)
|
10
10
|
|
11
11
|
@options = defaults[:options]
|
12
12
|
|
13
|
-
|
14
|
-
raise ArgumentError.new("Database not defined!") if params[:database].nil?
|
15
|
-
@database = params[:database]
|
13
|
+
@database = params[:database] || '--all-databases'
|
16
14
|
|
17
15
|
unless params[:options].nil?
|
18
16
|
params[:options].each do |o|
|
data/lib/dumptruck/truck.rb
CHANGED
data/lib/dumptruck/version.rb
CHANGED
data/spec/load_spec.rb
CHANGED
@@ -2,25 +2,27 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Dumptruck::Load do
|
4
4
|
describe '.new' do
|
5
|
-
let(:dump) { Dumptruck::Load.new(
|
5
|
+
let(:dump) { Dumptruck::Load.new() }
|
6
6
|
it "has a database" do
|
7
|
+
dump.database = "test"
|
7
8
|
expect(dump.database).to eq("test")
|
8
9
|
end
|
9
10
|
|
10
11
|
it "can add tables to ignore" do
|
12
|
+
dump.database = 'test'
|
11
13
|
dump.add_ignored_table("fake_table")
|
12
14
|
expect(dump.ignored_tables).to eq("--ignore-table=test.fake_table")
|
13
15
|
end
|
14
16
|
|
15
17
|
it "adds option to array" do
|
16
|
-
expect(dump.options).to eq("--single-transaction --
|
18
|
+
expect(dump.options).to eq("--single-transaction --opt --skip-comments")
|
17
19
|
|
18
20
|
dump.add_option("--lock-tables")
|
19
|
-
expect(dump.options).to eq("--single-transaction --
|
21
|
+
expect(dump.options).to eq("--single-transaction --opt --skip-comments --lock-tables")
|
20
22
|
end
|
21
23
|
|
22
|
-
it "
|
23
|
-
expect
|
24
|
+
it "sets the --all-databases option if no db given" do
|
25
|
+
expect(dump.database).to eq("--all-databases")
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
data/spec/truck_spec.rb
CHANGED
@@ -47,8 +47,8 @@ describe Dumptruck::Truck do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'generates the mysqldump command' do
|
50
|
-
|
51
|
-
expect(dump.command).to eq(["mysqldump -u #{dump.username} --password=#{dump.password} -h localhost -P 3306 --single-transaction --
|
52
|
-
|
50
|
+
dump.load({database: "test"})
|
51
|
+
expect(dump.command).to eq(["mysqldump -u #{dump.username} --password=#{dump.password} -h localhost -P 3306 --single-transaction --opt --skip-comments test"])
|
52
|
+
end
|
53
53
|
end
|
54
54
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dumptruck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- delianides
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05
|
11
|
+
date: 2014-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: cocaine
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
19
|
+
version: 0.5.4
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.5.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '1.5'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '1.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|