mysql-slaver 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mysql_slaver/cli.rb +21 -0
  2. metadata +4 -3
@@ -0,0 +1,21 @@
1
+ module MysqlSlaver
2
+ class CLI < ::Thor
3
+ option :master_host, :required => true, :desc => "The server which will be the replication master, for this slave"
4
+ option :database, :required => true, :desc => "The database to copy from the master"
5
+ option :replication_user, :required => true, :desc => "DB user (on the master host), with replication permissions"
6
+ option :replication_password, :required => true, :desc => "DB password for the replication user"
7
+ option :root_password, :desc => "Password for the mysql root user (on both master and slave)"
8
+ desc "enslave", "start mysql replication to this host from a master"
9
+ long_desc <<-LONGDESC
10
+ LONGDESC
11
+ def enslave
12
+ MysqlSlaver::Slaver.new(
13
+ :master_host => options[:master_host],
14
+ :mysql_root_password => options[:root_password],
15
+ :database => options[:database],
16
+ :replication_user => options[:replication_user],
17
+ :replication_password => options[:replication_password]
18
+ ).enslave!
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql-slaver
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Salgado
@@ -66,6 +66,7 @@ files:
66
66
  - spec/mysql_slaver/slaver_spec.rb
67
67
  - spec/mysql_slaver/status_fetcher_spec.rb
68
68
  - spec/spec_helper.rb
69
+ - lib/mysql_slaver/cli.rb
69
70
  - lib/mysql_slaver/db_copier.rb
70
71
  - lib/mysql_slaver/executor.rb
71
72
  - lib/mysql_slaver/logger.rb