dohdata 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/bin/datagen +4 -9
  2. metadata +5 -5
data/bin/datagen CHANGED
@@ -5,11 +5,13 @@ require 'doh/config'
5
5
  require 'doh/data/catalog'
6
6
  require 'doh/data/require_datagen'
7
7
  require 'doh/mysql/connector_util'
8
+ require 'doh/log'
8
9
  DohData::require_datagen
9
10
 
10
11
  opts = Doh::Options.new(
11
12
  {'target' => [Doh::config['primary_database'], "-g", "--target <database>", "name of the target database -- defaults to config['primary_database'], currently '#{Doh::config['primary_database']}'"] \
12
13
  ,'count' => [1, "-c", "--count <amount>", "how many to create"] \
14
+ ,'logging' => [false, "-l", "--logging", "enable logging (off by default)"] \
13
15
  }, true, 'list of catalog entries to create')
14
16
 
15
17
  if opts.varargs.size == 0
@@ -26,14 +28,7 @@ opts.varargs.each do |entry|
26
28
  if klass.nil?
27
29
  puts "unable to find data object matching: #{entry}"
28
30
  else
29
- # Doh::disable_logging
30
- opts.count.to_i.times do
31
- begin
32
- klass.new.save_to_database
33
- # rescue Exception => excpt
34
- # puts "ignoring exception: #{excpt.inspect}"
35
- end
36
- end
31
+ DohLog::disable unless opts.logging
32
+ opts.count.to_i.times { klass.new.save_to_database }
37
33
  end
38
34
  end
39
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohdata
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:
@@ -10,19 +10,19 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-03-14 00:00:00.000000000Z
13
+ date: 2012-04-03 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dohutil
17
- requirement: &70121759788000 !ruby/object:Gem::Requirement
17
+ requirement: &70219500405640 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.1.7
22
+ version: 0.1.9
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70121759788000
25
+ version_requirements: *70219500405640
26
26
  description: utilities for generating random names, phone numbers, emails, etc.
27
27
  email:
28
28
  - devinfo@atpsoft.com