poolboy 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -12,21 +12,51 @@ TODO: Write a gem description
12
12
 
13
13
  ## Installation
14
14
 
15
- Add this line to your application's Gemfile:
15
+ $ gem install poolboy
16
16
 
17
- gem 'poolboy'
18
17
 
19
- And then execute:
18
+ ## Usage
20
19
 
21
- $ bundle
20
+ Command line options are in the style of the Mysql Client:
22
21
 
23
- Or install it yourself as:
22
+ $ poolboy -h localhost -u root -p password
23
+ Help can be found with --help:
24
24
 
25
- $ gem install poolboy
25
+ $ poolboy --help
26
+ Poolboy helps you inspect your buffer pool
26
27
 
27
- ## Usage
28
+ Usage: poolboy [options]
29
+ -h HOST MySQL hostname
30
+ -u USER MySQL username
31
+ -p PASSWORD MySQL password
32
+ -r REFRESH Refresh interval
33
+ -f Force skipping of Percona Server check
34
+ --help Show this message
35
+ --version Show version
36
+
37
+ All options are optional (obviously) and can be defined in a configuration file for convenience.
38
+
39
+ ## Configuration
40
+ If you wish to store connection options in a file you can place .poolboy.yaml in your home directory and it will be automatically loaded.
41
+
42
+ The configuration file needs to be in YAML format like so:
43
+
44
+ $ cat ~/.poolboy.yaml
45
+ :host: 127.0.0.1
46
+ :username: root
47
+ :password: kraken123
48
+ :refresh: 5
49
+ :force: false
50
+
51
+ ## TODO
52
+
53
+ Add more stats
54
+
55
+ Add tests!
56
+
57
+ Move option parsing into a class
28
58
 
29
- TODO: Write usage instructions here
59
+ ## Quirks/Bugs
30
60
 
31
61
  ## Contributing
32
62
 
@@ -1,3 +1,3 @@
1
1
  module Poolboy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/poolboy.rb CHANGED
@@ -51,7 +51,7 @@ module Poolboy
51
51
  connection = MysqlConnection.new(options)
52
52
  if not options[:force]
53
53
  connection.percona
54
- percona = connection.percona ? connection.percona : version_exit
54
+ percona = connection.percona ? connection.percona : version_exit(connection)
55
55
  end
56
56
  version = connection.version
57
57
  case version[0,3]
@@ -73,12 +73,12 @@ module Poolboy
73
73
  sleep(options[:refresh])
74
74
  end
75
75
  rescue SystemExit, Interrupt
76
- connection.disconnect
76
+ connection.disconnect(connection)
77
77
  exit
78
78
  end
79
79
  end
80
80
 
81
- def Poolboy.version_exit
81
+ def Poolboy.version_exit(connection)
82
82
  puts "Incompatible MySQL version! Poolboy is only compatible with Percona Server 5.1 and 5.5"
83
83
  connection.disconnect
84
84
  exit 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poolboy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: