mrd 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/mrd +16 -3
- data/lib/mrd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a85fe439b91ca1806126a922e387d1660e6f36f6
|
4
|
+
data.tar.gz: 1a59b7a533dc5df2c6d006e52d0628d71a896de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce8721449dea7d66a1720dcb231a32f2fc3db9436e8f1440e3dc884a5d878078178a84381c2a56dcdcaa89aa7e6271fae36b461239a6d6d4a7775a0ac0aa74a4
|
7
|
+
data.tar.gz: 84a9f5f563ac2408bb744c5347b24e089a678ece9b8d00e4738fd46d97012746565c9eab68daab366b1d991c18c00954e312f47f7040abff5efca85b2db82d9b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/bin/mrd
CHANGED
@@ -108,10 +108,11 @@ class App
|
|
108
108
|
|
109
109
|
attr :socket
|
110
110
|
|
111
|
-
def initialize(ramdisk)
|
111
|
+
def initialize(ramdisk, log = false)
|
112
112
|
@ramdisk = ramdisk
|
113
113
|
@install_db = find_command! %w(mysql_install_db5 mysql_install_db)
|
114
114
|
@mysqld = find_command! %w(mysqld_safe5 mysqld_safe)
|
115
|
+
@log = log
|
115
116
|
end
|
116
117
|
|
117
118
|
def start
|
@@ -127,6 +128,13 @@ class App
|
|
127
128
|
innodb_file_per_table
|
128
129
|
ft_min_word_len = 3
|
129
130
|
}.gsub(/^\s+/,'')
|
131
|
+
if @log
|
132
|
+
fd.write %Q{
|
133
|
+
log_output = FILE
|
134
|
+
general_log = 1
|
135
|
+
general_log_file = "#{@ramdisk.mountpoint}/mysql.log"
|
136
|
+
}
|
137
|
+
end
|
130
138
|
end
|
131
139
|
|
132
140
|
# Switch to the MySQL install directory (on some platforms the install script uses relative paths)
|
@@ -194,7 +202,7 @@ class App
|
|
194
202
|
|
195
203
|
|
196
204
|
def initialize(argv)
|
197
|
-
@options = OpenStruct.new(:verbose => false, :size => 1024)
|
205
|
+
@options = OpenStruct.new(:verbose => false, :size => 1024, :log => false)
|
198
206
|
option_parser.parse(argv)
|
199
207
|
|
200
208
|
Logger.level = options.verbose ?
|
@@ -205,7 +213,7 @@ class App
|
|
205
213
|
|
206
214
|
def main
|
207
215
|
@ramdisk = Ramdisk.new(options.size)
|
208
|
-
@server = MySQLServer.new(@ramdisk)
|
216
|
+
@server = MySQLServer.new(@ramdisk, options.log)
|
209
217
|
rd,wr = IO.pipe
|
210
218
|
|
211
219
|
if pid = Process.fork
|
@@ -240,6 +248,7 @@ class App
|
|
240
248
|
|
241
249
|
# Log and wait for user input
|
242
250
|
Logger.info "MySQL is now running."
|
251
|
+
Logger.info "A query log can be found at '#{@ramdisk.mountpoint}/mysql.log'" if options.log
|
243
252
|
Logger.info "Configure you client to use the root user, no password, and the socket at '#{@server.socket}'."
|
244
253
|
Logger.info "Just close this terminal or press ^C when you no longer need it."
|
245
254
|
wait_forever
|
@@ -272,6 +281,10 @@ class App
|
|
272
281
|
opts.on("-s", "--size SIZE", Integer, "Size of RAM disk in MB (default 1024)") do |v|
|
273
282
|
options.size = v
|
274
283
|
end
|
284
|
+
|
285
|
+
opts.on("-l", "--log", "Create mysql.log") do |v|
|
286
|
+
options.log = v
|
287
|
+
end
|
275
288
|
end
|
276
289
|
end
|
277
290
|
|
data/lib/mrd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mrd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|