dbmanager 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTA4NzU3YWVlMjAzYmIxNDUxZmRlM2QzMzRkM2Y0MDM3ODM5NzFiNg==
5
+ data.tar.gz: !binary |-
6
+ NTgxYmExNWYxZmE5ZGE5MDU0MmQxYjliOGU5NDQxMzkwOGQwNmFkZA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZDFhYTlkZDQzZDMzNTY3NmM3NDQ2NTVmZTU0OTcyYTg0ZjcyMmRkODE1YjFm
10
+ YjNmNjljY2RkYWY1MmNhN2NlYTU4ZjdmNWJmMTBjYjA1NzY0ZTUzMmQxNzk2
11
+ NWNhNzIwMGI3Njc2YWVlYTViMTVmNTk0ZGUwYTUxMzE2NTc2ZTA=
12
+ data.tar.gz: !binary |-
13
+ M2ZiOWI1Y2YxNGNkNDJhMzc5MmQ0NDYwNGNmMGJjNGFlZmRiNjY1OGE1MDE5
14
+ NWE3YjZkM2NkNDMwMTRiYmQ1MTJhYTZiMGI0NjJlZDQwNzMzZWUzODRlZjg5
15
+ NDAwMmFhNDEyY2RhNDRlN2Y3YmI5YjZjNWU1MjA5ZjlmZmM1YTk=
@@ -4,5 +4,4 @@ rvm:
4
4
  - 1.8.7
5
5
  branches:
6
6
  only:
7
- - master
8
- - elia/loadable
7
+ - master
@@ -1,3 +1,8 @@
1
+ ## v0.4.0
2
+
3
+ * add capistrano integration via db:import task
4
+ * minor changes to support capistrano integration
5
+
1
6
  ## v0.3.0
2
7
 
3
8
  * add support for --set-gtid-purged=OFF flag when using mysqldump with version number >= 5.6
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in db-manager.gemspec
4
4
  gemspec
5
+
6
+ gem 'coveralls', :require => false
@@ -17,6 +17,7 @@ module Dbmanager
17
17
  class Dumper
18
18
  include Connectable
19
19
  attr_reader :source, :filename
20
+ attr_writer :mysqldump_version
20
21
 
21
22
  def initialize(source, filename)
22
23
  @source = source
@@ -28,7 +29,11 @@ module Dbmanager
28
29
  end
29
30
 
30
31
  def mysqldump_version
31
- Dbmanager.execute('mysqldump --version') =~ /Distrib\s+(\d+\.\d+)/
32
+ @mysqldump_version ||= extract_version Dbmanager.execute('mysqldump --version')
33
+ end
34
+
35
+ def extract_version(version)
36
+ version =~ /Distrib\s+(\d+\.\d+)/
32
37
  $1.to_f
33
38
  end
34
39
 
@@ -0,0 +1,34 @@
1
+ _cset :dbmanager_remote_env, lambda {
2
+ Dbmanager::YmlParser.environments[rails_env.to_s]
3
+ }
4
+
5
+
6
+ _cset :dbmanager_local_env, lambda {
7
+ Dbmanager::YmlParser.environments[Rails.env]
8
+ }
9
+
10
+
11
+ namespace :db do
12
+ task :import do
13
+ require File.expand_path('../environment', __FILE__)
14
+ require 'dbmanager'
15
+ require 'open3'
16
+
17
+ dumper = Dbmanager::Adapters::Mysql::Dumper.new(dbmanager_remote_env, '/dev/stdout')
18
+ loader = Dbmanager::Adapters::Mysql::Loader.new(dbmanager_local_env, '/dev/stdin')
19
+ dumper.mysqldump_version = dumper.extract_version capture('mysqldump --version')
20
+
21
+ Open3.popen3 loader.load_command do |input, output, error|
22
+ begin
23
+ run dumper.dump_command do |channel, stream, data|
24
+ input << data if stream == :out
25
+ raise data if stream == :err
26
+ end
27
+ input.close
28
+ ensure
29
+ output.read.tap { |s| puts "OUT: #{s}" unless s.empty? }
30
+ error.read.tap { |s| puts "ERR: #{s}" unless s.empty? }
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,3 +1,3 @@
1
1
  module Dbmanager
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -1,6 +1,9 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
2
  require 'dbmanager'
3
3
 
4
+ require 'coveralls'
5
+ Coveralls.wear!
6
+
4
7
  RSpec.configure do |config|
5
8
  config.order = :random
6
9
  config.color_enabled = true
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbmanager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - andrea longhi
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-30 00:00:00.000000000 Z
11
+ date: 2014-06-12 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: mysql2
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: cucumber
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: guard-rspec
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ! '>='
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ! '>='
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: guard-cucumber
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ! '>='
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ! '>='
124
109
  - !ruby/object:Gem::Version
@@ -153,6 +138,7 @@ files:
153
138
  - lib/dbmanager/adapters.rb
154
139
  - lib/dbmanager/adapters/mysql.rb
155
140
  - lib/dbmanager/adapters/mysql2.rb
141
+ - lib/dbmanager/capistrano.rb
156
142
  - lib/dbmanager/dumper.rb
157
143
  - lib/dbmanager/environment.rb
158
144
  - lib/dbmanager/importer.rb
@@ -229,33 +215,26 @@ files:
229
215
  - spec/spec_helper.rb
230
216
  homepage: https://github.com/spaghetticode/dbmanager
231
217
  licenses: []
218
+ metadata: {}
232
219
  post_install_message:
233
220
  rdoc_options: []
234
221
  require_paths:
235
222
  - lib
236
223
  required_ruby_version: !ruby/object:Gem::Requirement
237
- none: false
238
224
  requirements:
239
225
  - - ! '>='
240
226
  - !ruby/object:Gem::Version
241
227
  version: '0'
242
- segments:
243
- - 0
244
- hash: 3317854909553547235
245
228
  required_rubygems_version: !ruby/object:Gem::Requirement
246
- none: false
247
229
  requirements:
248
230
  - - ! '>='
249
231
  - !ruby/object:Gem::Version
250
232
  version: '0'
251
- segments:
252
- - 0
253
- hash: 3317854909553547235
254
233
  requirements: []
255
234
  rubyforge_project: dbmanager
256
- rubygems_version: 1.8.25
235
+ rubygems_version: 2.1.11
257
236
  signing_key:
258
- specification_version: 3
237
+ specification_version: 4
259
238
  summary: database manager
260
239
  test_files:
261
240
  - features/dump.feature