dumpdb 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,11 +1,10 @@
1
1
  *.gem
2
2
  *.log
3
3
  *.rbc
4
+ .rbx/
4
5
  .bundle
5
6
  .config
6
7
  .yardoc
7
- .rvmrc
8
- .rbenv-version
9
8
  Gemfile.lock
10
9
  InstalledFiles
11
10
  _yardoc
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'bundler', '~>1.1'
6
- gem 'rake', '~>0.9.2'
5
+ gem 'rake'
6
+ gem 'pry'
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-Present Kelly Redding
1
+ Copyright (c) 2012-Present Kelly Redding and Collin Redding
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -2,20 +2,6 @@
2
2
 
3
3
  Dump and restore your databases.
4
4
 
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'dumpdb'
10
-
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- Or install it yourself as:
16
-
17
- $ gem install dumpdb
18
-
19
5
  ## Usage
20
6
 
21
7
  ```ruby
@@ -254,6 +240,20 @@ end
254
240
 
255
241
  See `examples/` dir. (TODO)
256
242
 
243
+ ## Installation
244
+
245
+ Add this line to your application's Gemfile:
246
+
247
+ gem 'dumpdb'
248
+
249
+ And then execute:
250
+
251
+ $ bundle
252
+
253
+ Or install it yourself as:
254
+
255
+ $ gem install dumpdb
256
+
257
257
  ## Contributing
258
258
 
259
259
  1. Fork it
data/Rakefile CHANGED
@@ -1,8 +1 @@
1
- #!/usr/bin/env rake
2
-
3
- require 'assert/rake_tasks'
4
- Assert::RakeTasks.install
5
-
6
- require 'bundler/gem_tasks'
7
-
8
- task :default => :build
1
+ require "bundler/gem_tasks"
data/dumpdb.gemspec CHANGED
@@ -1,22 +1,24 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/dumpdb/version', __FILE__)
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "dumpdb/version"
3
5
 
4
6
  Gem::Specification.new do |gem|
5
7
  gem.name = "dumpdb"
6
8
  gem.version = Dumpdb::VERSION
7
- gem.description = %q{Dump and restore your databases.}
8
- gem.summary = %q{Dump and restore your databases.}
9
-
10
9
  gem.authors = ["Kelly Redding", "Collin Redding"]
11
10
  gem.email = ["kelly@kellyredding.com", "collin.redding@me.com"]
11
+ gem.description = %q{Dump and restore your databases.}
12
+ gem.summary = %q{Dump and restore your databases.}
12
13
  gem.homepage = "http://github.com/redding/dumpdb"
13
14
 
14
- gem.files = `git ls-files`.split("\n")
15
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
18
  gem.require_paths = ["lib"]
18
19
 
19
- gem.add_development_dependency("assert")
20
+ gem.add_dependency("assert", ["~> 2.0"])
21
+
20
22
  gem.add_dependency("scmd", ["~> 2.0"])
21
23
  gem.add_dependency("ns-options", ["~> 1.1", ">= 1.1.1"])
22
24
  end
data/lib/dumpdb/db.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'ostruct'
2
-
3
1
  module Dumpdb
4
2
 
5
3
  class Db
@@ -1,3 +1,4 @@
1
+ require 'yaml'
1
2
  require 'dumpdb/db'
2
3
 
3
4
  module Dumpdb::Settings
@@ -1,3 +1,3 @@
1
1
  module Dumpdb
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/lib/dumpdb.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'ns-options'
2
-
2
+ require 'dumpdb/version'
3
3
  require 'dumpdb/settings'
4
4
  require 'dumpdb/db'
5
5
  require 'dumpdb/runner'
data/log/.gitkeep ADDED
File without changes
data/test/helper.rb CHANGED
@@ -1,7 +1,10 @@
1
- # this file is automatically required in when you require 'assert' in your tests
2
- # put test helpers here
1
+ # this file is automatically required when you run `assert`
2
+ # put any test helpers here
3
3
 
4
- # add root dir to the load path
5
- $LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
4
+ # add the root dir to the load path
5
+ ROOT_PATH = File.expand_path("../..", __FILE__)
6
+ $LOAD_PATH.unshift(ROOT_PATH)
7
+
8
+ # require pry for debugging (`binding.pry`)
9
+ require 'pry'
6
10
 
7
- require 'test/support/test_scripts'
@@ -3,7 +3,7 @@ require 'dumpdb'
3
3
  class LocalScript
4
4
  include Dumpdb
5
5
 
6
- databases { 'test/support/database.yaml' }
6
+ databases { File.join(ROOT_PATH, 'test/support/database.yaml') }
7
7
  dump_file { "dump.#{type}" }
8
8
  source { db('development', :another => 'value') }
9
9
  target { db('test') }
@@ -15,7 +15,7 @@ class RemoteScript
15
15
  include Dumpdb
16
16
 
17
17
  ssh { 'user@example.com' }
18
- databases { 'test/support/database.yaml' }
18
+ databases { File.join(ROOT_PATH, 'test/support/database.yaml') }
19
19
  dump_file { "dump.#{type}" }
20
20
  source { db('development') }
21
21
  target { db('test') }
@@ -1,12 +1,12 @@
1
1
  require 'assert'
2
- require 'ostruct'
2
+ require 'dumpdb/db'
3
3
 
4
4
  module Dumpdb
5
5
 
6
6
  class DbTests < Assert::Context
7
7
  desc "the Db helper class"
8
8
  setup do
9
- @db = Db.new(nil)#(:host => 'h', :user => 'u', :pw => 'p', :db => 'd')
9
+ @db = Db.new(nil)
10
10
  end
11
11
  subject { @db }
12
12
 
@@ -1,6 +1,6 @@
1
1
  require 'assert'
2
2
  require 'test/support/fake_cmd_runner'
3
-
3
+ require 'test/support/test_scripts'
4
4
  require 'dumpdb/runner'
5
5
 
6
6
  module Dumpdb
@@ -1,4 +1,6 @@
1
1
  require 'assert'
2
+ require 'test/support/fake_cmd_runner'
3
+ require 'test/support/test_scripts'
2
4
 
3
5
  module Dumpdb
4
6
 
@@ -1,5 +1,5 @@
1
1
  require 'assert'
2
-
2
+ require 'test/support/test_scripts'
3
3
  require 'dumpdb/settings'
4
4
 
5
5
  module Dumpdb
@@ -57,7 +57,7 @@ module Dumpdb
57
57
  end
58
58
 
59
59
  should "come from a yaml file" do
60
- databases = Settings::Databases.new('test/support/test.yaml')
60
+ databases = Settings::Databases.new(File.join(ROOT_PATH, 'test/support/test.yaml'))
61
61
  assert_equal({
62
62
  'db-one' => {'db' => 1},
63
63
  'db-two' => {'db' => 2},
data/tmp/.gitkeep ADDED
File without changes
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumpdb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kelly Redding
@@ -16,25 +16,27 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-12-20 00:00:00 Z
19
+ date: 2013-03-25 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: assert
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
26
- - - ">="
27
+ - - ~>
27
28
  - !ruby/object:Gem::Version
28
29
  hash: 3
29
30
  segments:
31
+ - 2
30
32
  - 0
31
- version: "0"
32
- type: :development
33
- requirement: *id001
34
- prerelease: false
33
+ version: "2.0"
34
+ type: :runtime
35
+ version_requirements: *id001
35
36
  - !ruby/object:Gem::Dependency
36
37
  name: scmd
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
38
40
  none: false
39
41
  requirements:
40
42
  - - ~>
@@ -45,11 +47,11 @@ dependencies:
45
47
  - 0
46
48
  version: "2.0"
47
49
  type: :runtime
48
- requirement: *id002
49
- prerelease: false
50
+ version_requirements: *id002
50
51
  - !ruby/object:Gem::Dependency
51
52
  name: ns-options
52
- version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
53
55
  none: false
54
56
  requirements:
55
57
  - - ~>
@@ -68,8 +70,7 @@ dependencies:
68
70
  - 1
69
71
  version: 1.1.1
70
72
  type: :runtime
71
- requirement: *id003
72
- prerelease: false
73
+ version_requirements: *id003
73
74
  description: Dump and restore your databases.
74
75
  email:
75
76
  - kelly@kellyredding.com
@@ -83,7 +84,7 @@ extra_rdoc_files: []
83
84
  files:
84
85
  - .gitignore
85
86
  - Gemfile
86
- - LICENSE
87
+ - LICENSE.txt
87
88
  - README.md
88
89
  - Rakefile
89
90
  - dumpdb.gemspec
@@ -92,16 +93,17 @@ files:
92
93
  - lib/dumpdb/runner.rb
93
94
  - lib/dumpdb/settings.rb
94
95
  - lib/dumpdb/version.rb
95
- - test/db_tests.rb
96
+ - log/.gitkeep
96
97
  - test/helper.rb
97
- - test/irb.rb
98
- - test/runner_tests.rb
99
- - test/script_tests.rb
100
- - test/settings_tests.rb
101
98
  - test/support/database.yaml
102
99
  - test/support/fake_cmd_runner.rb
103
100
  - test/support/test.yaml
104
101
  - test/support/test_scripts.rb
102
+ - test/unit/db_tests.rb
103
+ - test/unit/runner_tests.rb
104
+ - test/unit/script_tests.rb
105
+ - test/unit/settings_tests.rb
106
+ - tmp/.gitkeep
105
107
  homepage: http://github.com/redding/dumpdb
106
108
  licenses: []
107
109
 
@@ -136,13 +138,12 @@ signing_key:
136
138
  specification_version: 3
137
139
  summary: Dump and restore your databases.
138
140
  test_files:
139
- - test/db_tests.rb
140
141
  - test/helper.rb
141
- - test/irb.rb
142
- - test/runner_tests.rb
143
- - test/script_tests.rb
144
- - test/settings_tests.rb
145
142
  - test/support/database.yaml
146
143
  - test/support/fake_cmd_runner.rb
147
144
  - test/support/test.yaml
148
145
  - test/support/test_scripts.rb
146
+ - test/unit/db_tests.rb
147
+ - test/unit/runner_tests.rb
148
+ - test/unit/script_tests.rb
149
+ - test/unit/settings_tests.rb
data/test/irb.rb DELETED
@@ -1,9 +0,0 @@
1
- require 'assert/setup'
2
-
3
- # this file is required in when the 'irb' rake test is run.
4
- # b/c 'assert/setup' is required above, the test helper will be
5
- # required in as well.
6
-
7
- # put any IRB setup code here
8
-
9
- require 'dumpdb'