mysqlnoio 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f57be33b8f4bf3b5d09926854dda217618296bfc
4
- data.tar.gz: d5c90baadcf1fe3720fc821214f3dfdc18367610
3
+ metadata.gz: 3c4fed9513c96b2048bbee86f1d16c94a92e24fc
4
+ data.tar.gz: 25bc6a6d50f78c862d9e25c5a8cd62a1bc2cc13c
5
5
  SHA512:
6
- metadata.gz: 7046e638a21114fdfb9f0b2bf0c159ea7543abc138aa7b481984603af98cddd86487420c5077c10cd89dbaa7a38d0d9deea3dadf247ff81f047868cbf36baf20
7
- data.tar.gz: b7bf3ddb5e2c33ec62a584c395c42f224b3a96a6f1d48f3daf6b0b1355d59ad0559732f72765f634315e6c7bf3aace76a79555770b11d0db3147eb5cee76f653
6
+ metadata.gz: 7eea546f20b7443101413fb6a23e1f9085bd7057a75730ace22814f1e1fc33f559b2863f1dbe1185cc7a4d62ff3ba6c45fb7204c586af6510fd9edc4f8073e47
7
+ data.tar.gz: c6a91b69bf9d33d3ac2c814b6d69098ed5cb733ec4435f07788c993f1938c56ebd64493da70ee532ee99bb424f1e80f4e0f557b7deb06a67ad8ac6a597289781
data/.travis.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
3
  - 1.9.3
5
4
  - 2.0.0
6
5
 
@@ -12,5 +11,5 @@ before_script:
12
11
  - mysql -uroot -e "change master to master_host='127.99.99.99', master_user='root', master_password='root', master_log_file='fizzle', master_log_pos=123;"
13
12
  - mysql -uroot -e "start slave;"
14
13
 
15
- script: bundle exec rake test
14
+ script: rake test
16
15
 
data/Gemfile.lock CHANGED
@@ -1,20 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mysqlnoio (0.1.0)
4
+ mysqlnoio (0.1.1)
5
5
  mysql2
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  coderay (1.0.9)
11
- columnize (0.3.6)
12
- debugger (1.5.0)
13
- columnize (>= 0.3.1)
14
- debugger-linecache (~> 1.2.0)
15
- debugger-ruby_core_source (~> 1.2.0)
16
- debugger-linecache (1.2.0)
17
- debugger-ruby_core_source (1.2.0)
18
11
  diff-lcs (1.2.4)
19
12
  ffi (1.7.0)
20
13
  formatador (0.2.4)
@@ -65,7 +58,6 @@ PLATFORMS
65
58
  ruby
66
59
 
67
60
  DEPENDENCIES
68
- debugger
69
61
  guard
70
62
  guard-rspec
71
63
  guard-shell
data/README.md CHANGED
@@ -5,6 +5,15 @@ to MySQL. The best use case example is running `FLUSH TABLES WITH READ LOCK`
5
5
  in one terminal while running an lvm snapshot in another.
6
6
 
7
7
  ## Project State
8
+
9
+ Master Unit Tests: [![Build Status](https://travis-ci.org/zippykid/mysqlnoio.png?branch=master)](https://travis-ci.org/zippykid/mysqlnoio)
10
+
11
+ Master Code Quality: [![Code Climate](https://codeclimate.com/github/zippykid/mysqlnoio.png)](https://codeclimate.com/github/zippykid/mysqlnoio)
12
+
13
+ Develop Unit Tests: [![Build Status](https://travis-ci.org/zippykid/mysqlnoio.png?branch=develop)](https://travis-ci.org/zippykid/mysqlnoio)
14
+
15
+
16
+
8
17
  Beta, Basic functionality exists and it is being used in production for
9
18
  providing database dumps and backups.
10
19
 
@@ -25,6 +34,26 @@ mysql -uroot -pfoobar -e "show slave status\G"
25
34
  lvcreate -L20G -s -n mysqlsnap /dev/VG_MySQL/LV_MySQL
26
35
  ```
27
36
 
37
+ ## Dependencies
38
+
39
+ - Ruby 1.9.3 (Ubuntu 12.04 installs this with the ruby1.9.1 package) or 2.0.0
40
+ - The mysql2 gem, which also requires local mysql client libraries, and headers.
41
+
42
+ ## Installation
43
+
44
+ ```bash
45
+ gem install mysqlnoio
46
+ ```
47
+
48
+ ## Changelog
49
+
50
+ - 2013-04-23 - First release (0.1.0).
51
+ - 2013-04-23 - Fixed an issue where calling it with no parameters caused a
52
+ stack trace.
53
+ - 2013-04-23 - Created more extensive integration tests asserting the slave
54
+ stop feature works as intended.
55
+ - 2013-04-23 - Release: 0.1.1
56
+
28
57
  ## Copyright
29
58
 
30
59
  mysqlnoio - For executing commands with a stopped slave.
data/bin/mysql-noio CHANGED
@@ -6,7 +6,9 @@ require 'mysqlnoio'
6
6
  credentials = {}
7
7
  wraps = []
8
8
 
9
- OptionParser.new do |opts|
9
+ opts = OptionParser.new do |opts|
10
+ opts.version = MySQLNoIo::VERSION
11
+
10
12
  opts.banner = "Usage: mysql-noio [options] <command>"
11
13
 
12
14
  # Determine the MySQL connection parameters
@@ -31,8 +33,9 @@ OptionParser.new do |opts|
31
33
  wraps << :stop
32
34
  end
33
35
 
34
- opts.on
35
- end.parse!
36
+ end
37
+
38
+ opts.parse!
36
39
 
37
40
  client = Mysql2::Client.new(credentials)
38
41
 
@@ -40,10 +43,15 @@ stack = MySQLNoIo::WrapStack.new
40
43
  stack.add_wrap MySQLNoIo::Wraps::DeactivatedSlave.new client if wraps.include? :stop
41
44
  stack.add_wrap MySQLNoIo::Wraps::GlobalLock.new client if wraps.include? :lock
42
45
 
43
- stack.execute do
44
- spawn *ARGV
45
- Process.wait
46
- end
46
+ if ARGV.size == 0
47
+ puts opts
48
+ else
47
49
 
48
- exit $?.to_i
50
+ stack.execute do
51
+ spawn *ARGV
52
+ Process.wait
53
+ end
54
+
55
+ exit $?.to_i
56
+ end
49
57
 
@@ -4,7 +4,7 @@ module MySQLNoIo
4
4
  NAME = 'mysqlnoio'
5
5
 
6
6
  # Used in Gemspec and Commander
7
- VERSION = '0.1.0'
7
+ VERSION = '0.1.1'
8
8
 
9
9
  # Used in Gemspec and Commander
10
10
  DESCRIPTION = 'mysqlnoio allows you to execute commands while MySQL is locked.'
data/mysqlnoio.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.homepage = 'https://zippykid.com'
13
13
  gem.authors = ["ZippyKid", "Graham Christensen"]
14
14
  gem.email = ["info@zippykid.com"]
15
- gem.licenses = ["MIT"]
15
+ gem.licenses = ["GPLv3"]
16
16
 
17
17
  gem.files = `git ls-files`.split($/)
18
18
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -22,7 +22,6 @@ Gem::Specification.new do |gem|
22
22
  gem.add_dependency('mysql2')
23
23
 
24
24
  gem.add_development_dependency('rspec')
25
- gem.add_development_dependency('debugger')
26
25
 
27
26
  # Guard:
28
27
  gem.add_development_dependency('guard')
@@ -13,5 +13,19 @@ describe "mysql-noio", :integration => true do
13
13
  output.should_not =~ /syntax error/
14
14
  end
15
15
  end
16
+
17
+ context "called with --stop-slave" do
18
+ it "stops the slave" do
19
+ out = `bundle exec #{project_root}/bin/mysql-noio -uroot --stop-slave -- mysql -uroot -e "show slave status\\G" | grep -i Slave_IO_State`
20
+ out.should_not =~ /Connecting to master/
21
+ end
22
+ end
23
+
24
+ context "called without --stop-slave" do
25
+ it "does not stop the slave" do
26
+ out = `bundle exec #{project_root}/bin/mysql-noio -uroot -- mysql -uroot -e "show slave status\\G" | grep -i Slave_IO_State`
27
+ out.should =~ /Connecting to master/
28
+ end
29
+ end
16
30
  end
17
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysqlnoio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZippyKid
@@ -39,20 +39,6 @@ dependencies:
39
39
  - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
- - !ruby/object:Gem::Dependency
43
- name: debugger
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - '>='
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - '>='
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
42
  - !ruby/object:Gem::Dependency
57
43
  name: guard
58
44
  requirement: !ruby/object:Gem::Requirement
@@ -203,7 +189,7 @@ files:
203
189
  - vagrant/provision.sh
204
190
  homepage: https://zippykid.com
205
191
  licenses:
206
- - MIT
192
+ - GPLv3
207
193
  metadata: {}
208
194
  post_install_message:
209
195
  rdoc_options: []