mrd 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +1 -1
  4. data/bin/mrd +16 -3
  5. data/lib/mrd/version.rb +1 -1
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d0f6dd8e58e13078e4d3b0340a3f7aa89ed0f77
4
- data.tar.gz: 5ab27fd5bdce85d33091177bd957e8de65610a21
3
+ metadata.gz: a85fe439b91ca1806126a922e387d1660e6f36f6
4
+ data.tar.gz: 1a59b7a533dc5df2c6d006e52d0628d71a896de2
5
5
  SHA512:
6
- metadata.gz: 25554049e6122363ae66e376a01f376097d36885e85a6ba2ffb54e8700e7a52e67e10d166bb2abca3c8637d1a961c84bc77b3fe8ff42bc7198410c2249f88679
7
- data.tar.gz: 7f58eb0d60e1902301ca860fb0fade06311bf5631fadaac48ba4b6423cd295bc666888889251084e4221641b172a7d3b810eca7ed35c312df6ec5fefe0d7493f
6
+ metadata.gz: ce8721449dea7d66a1720dcb231a32f2fc3db9436e8f1440e3dc884a5d878078178a84381c2a56dcdcaa89aa7e6271fae36b461239a6d6d4a7775a0ac0aa74a4
7
+ data.tar.gz: 84a9f5f563ac2408bb744c5347b24e089a678ece9b8d00e4738fd46d97012746565c9eab68daab366b1d991c18c00954e312f47f7040abff5efca85b2db82d9b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mrd (0.0.4)
4
+ mrd (0.0.5)
5
5
  term-ansicolor
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -37,7 +37,7 @@ Then, if using Rails, point your `database.yml` to the temporary SQL server:
37
37
  Usage: [options]
38
38
  -v, --verbose Run verbosely
39
39
  -s, --size SIZE Size of RAM disk in MB (default 1024)
40
-
40
+ -l, --log Create mysql.log
41
41
 
42
42
  ## Contributing
43
43
 
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
 
@@ -1,3 +1,3 @@
1
1
  module Mrd
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-07-22 00:00:00.000000000 Z
11
+ date: 2013-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake