isolated_server 0.4.10 → 0.4.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0ceedebc8690cbb19a2f5b81fc359200a3f2fc0
4
- data.tar.gz: a6f2110ecae501e098897a39a573d73324f75413
3
+ metadata.gz: 0e4c2cbe1e48b3e767d9be526f2d63ba973f1773
4
+ data.tar.gz: 724b3f8962866941f24d087310dadf5f75054a9d
5
5
  SHA512:
6
- metadata.gz: 8ca8590fde71ff80ec7420b092aebfe828e7a2374473b74ff70c74843689f0fbfffd176b12a72b097bb592156daf144340f923150dcbb61c3a73744edf3531b8
7
- data.tar.gz: cdb3306372163032ae63bc2c3b2ab42b83efda95e59b4d6aae5f8be7b4a3c00e032ae04656e6909b6829f14a2f96708676a25816166aaecae6adaf74ee08a63a
6
+ metadata.gz: a1ec4968bd1679e6a679ba35285377e699d015156a9d981954464c96bebae4f7ed7af41b06fee84477bcb97013fb204b9b3b3815a68b43056db1a0e258efa9f5
7
+ data.tar.gz: 616b1f9d58e04ae7d4e0bdea2952fc68f8c494b9856f1ff569d5ee948f5f19f568f5c43fb4373f90e3f27f8101e63e5176b22ac5fb96a6fae31ec9cbcb48da23
@@ -77,6 +77,7 @@ module IsolatedServer
77
77
  "--pid-file=#{@base}/mysqld.pid",
78
78
  "--port=#{@port}",
79
79
  "--socket=#{@mysql_data_dir}/mysql.sock",
80
+ "--server-id=#{@port}",
80
81
  @log_bin,
81
82
  '--log-slave-updates',
82
83
  *@params
@@ -90,7 +91,7 @@ module IsolatedServer
90
91
  end
91
92
 
92
93
  def console
93
- system("mysql -uroot --port #{@port.to_s.shellescape} mysql --host 127.0.0.1")
94
+ system!("mysql -uroot --port #{@port.to_s.shellescape} mysql --host 127.0.0.1")
94
95
  end
95
96
 
96
97
  def reconnect!
@@ -121,12 +122,16 @@ module IsolatedServer
121
122
 
122
123
  private
123
124
 
125
+ def system!(cmd)
126
+ system(cmd) or raise Exception, "Error executing #{cmd}"
127
+ end
128
+
124
129
  def setup_data_dir
125
- system("rm -Rf #{@mysql_data_dir.shellescape}")
126
- system("mkdir #{@mysql_data_dir.shellescape}")
130
+ system!("rm -Rf #{@mysql_data_dir.shellescape}")
131
+ system!("mkdir -p #{@mysql_data_dir.shellescape}")
127
132
  if @load_data_path
128
- system("cp -a #{@load_data_path.shellescape}/* #{@mysql_data_dir.shellescape}")
129
- system("rm -f #{@mysql_data_dir.shellescape}/relay-log.info")
133
+ system!("cp -a #{@load_data_path.shellescape}/* #{@mysql_data_dir.shellescape}")
134
+ system!("rm -f #{@mysql_data_dir.shellescape}/relay-log.info")
130
135
  else
131
136
  mysqld = locate_executable("mysqld")
132
137
  `#{mysqld} --version` =~ /mysqld\s+Ver (5\.\d)\.\d+/
@@ -138,8 +143,8 @@ module IsolatedServer
138
143
  mysql_install_db = locate_executable("mysql_install_db")
139
144
 
140
145
  idb_path = File.dirname(mysql_install_db)
141
- system("(cd #{idb_path.shellescape}/..; mysql_install_db --datadir=#{@mysql_data_dir.shellescape} --basedir=#{basedir.shellescape} --user=`whoami`) >/dev/null 2>&1")
142
- system("cp #{File.expand_path(File.dirname(__FILE__)).shellescape}/mysql/tables/#{major_version}/user.* #{@mysql_data_dir.shellescape}/mysql")
146
+ system!("(cd #{idb_path.shellescape}/..; mysql_install_db --datadir=#{@mysql_data_dir.shellescape} --basedir=#{basedir.shellescape} --user=`whoami`) >/dev/null 2>&1")
147
+ system!("cp #{File.expand_path(File.dirname(__FILE__)).shellescape}/mysql/tables/#{major_version}/user.* #{@mysql_data_dir.shellescape}/mysql")
143
148
  end
144
149
  end
145
150
 
@@ -153,15 +158,15 @@ module IsolatedServer
153
158
  binlog_dir = @log_bin
154
159
  end
155
160
 
156
- system("mkdir -p #{binlog_dir.shellescape}")
161
+ system!("mkdir -p #{binlog_dir.shellescape}")
157
162
  @log_bin = "--log-bin=#{binlog_dir}"
158
163
  end
159
164
  end
160
165
 
161
166
  # http://dev.mysql.com/doc/refman/5.0/en/temporary-files.html
162
167
  def setup_tmp_dir
163
- system("mkdir -p #{base.shellescape}/tmp")
164
- system("chmod 0777 #{base.shellescape}/tmp")
168
+ system!("mkdir -p #{base.shellescape}/tmp")
169
+ system!("chmod 0777 #{base.shellescape}/tmp")
165
170
  ENV["TMPDIR"] = "#{base.shellescape}/tmp"
166
171
  end
167
172
 
@@ -169,7 +174,7 @@ module IsolatedServer
169
174
  def setup_time_zone
170
175
  tzinfo_to_sql = locate_executable("mysql_tzinfo_to_sql5", "mysql_tzinfo_to_sql")
171
176
  raise "could not find mysql_tzinfo_to_sql" unless tzinfo_to_sql
172
- system("#{tzinfo_to_sql.shellescape} /usr/share/zoneinfo 2>/dev/null | mysql -h127.0.0.1 --database=mysql --port=#{@port.to_s.shellescape} -u root mysql")
177
+ system!("#{tzinfo_to_sql.shellescape} /usr/share/zoneinfo 2>/dev/null | mysql -h127.0.0.1 --database=mysql --port=#{@port.to_s.shellescape} -u root mysql")
173
178
 
174
179
  begin
175
180
  connection.query("SET GLOBAL time_zone='UTC'")
@@ -1,3 +1,3 @@
1
1
  module IsolatedServer
2
- VERSION = "0.4.10"
2
+ VERSION = "0.4.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isolated_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Osheroff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-12 00:00:00.000000000 Z
12
+ date: 2016-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -98,6 +98,9 @@ files:
98
98
  - lib/isolated_server/mysql/tables/5.6/user.MYD
99
99
  - lib/isolated_server/mysql/tables/5.6/user.MYI
100
100
  - lib/isolated_server/mysql/tables/5.6/user.frm
101
+ - lib/isolated_server/mysql/tables/5.7/user.MYD
102
+ - lib/isolated_server/mysql/tables/5.7/user.MYI
103
+ - lib/isolated_server/mysql/tables/5.7/user.frm
101
104
  - lib/isolated_server/version.rb
102
105
  - spec/lib/isolated_server/mongodb_spec.rb
103
106
  - spec/lib/isolated_server/mysql_spec.rb
@@ -122,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
125
  version: '0'
123
126
  requirements: []
124
127
  rubyforge_project:
125
- rubygems_version: 2.5.0
128
+ rubygems_version: 2.4.5.1
126
129
  signing_key:
127
130
  specification_version: 4
128
131
  summary: A small library that allows you to easily spin up new local mysql servers