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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb4fec54c12368bee28a53a524a7b2025b7c0638
4
- data.tar.gz: 3e7f8675276a5b7b76afdee9a91386d7135dea1c
3
+ metadata.gz: 02ff36e085d700745fc06ef42e4ccb44f2ce618b
4
+ data.tar.gz: d405b3b38062c5af154db52dd834aead4e92b75d
5
5
  SHA512:
6
- metadata.gz: 14f9af784da8e192a9f675e3f16f1db4e0ec10a9c97b10139336040f40620702de98d0be6dceef9da05d1ed802b88fb98943e9244c7839d7c59f6fee6819adcd
7
- data.tar.gz: 6fa25af7048e332ce70bf660aece7a9e94d9398a749a3097a78bd1b7c4112ce65c379232d79c2a190e62bf0635ecd35c80a31efaabecc2f4f2b9bdd1a63c601a
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](http://img.shields.io/gem/v/dumptruck.svg)](https://rubygems.org/gems/dumptruck)
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
- mysqldump_cmd: "/path/to/bin/mysqldump",
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
- lib = File.expand_path('../lib', __FILE__)
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"
@@ -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", "--quick"],
8
+ options: ["--single-transaction", "--opt", "--skip-comments"],
9
9
  }.merge!(params)
10
10
 
11
11
  @options = defaults[:options]
12
12
 
13
- #database needs to be defined
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|
@@ -84,7 +84,7 @@ module Dumptruck
84
84
  end
85
85
  end
86
86
 
87
- def dump(run = true)
87
+ def dump
88
88
  raise Dumptruck::NothingLoaded, "You haven't loaded anything!" unless @loads
89
89
  filename = self.output
90
90
 
@@ -1,3 +1,3 @@
1
1
  module Dumptruck
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.6"
3
3
  end
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({ database: "test" }) }
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 --quick")
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 --quick --lock-tables")
21
+ expect(dump.options).to eq("--single-transaction --opt --skip-comments --lock-tables")
20
22
  end
21
23
 
22
- it "raises an error if no database is defined" do
23
- expect{Dumptruck::Load.new({})}.to raise_error("Database not defined!")
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
- dump.load({database: "test"})
51
- expect(dump.command).to eq(["mysqldump -u #{dump.username} --password=#{dump.password} -h localhost -P 3306 --single-transaction --quick test"])
52
- end
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
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-14 00:00:00.000000000 Z
11
+ date: 2014-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: cocaine
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
20
- type: :development
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: '1.5'
26
+ version: 0.5.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: cocaine
28
+ name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.4
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: 0.5.4
40
+ version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement