dohruby 0.1.12 → 0.1.13

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.
data/CHANGELOG CHANGED
@@ -37,3 +37,5 @@
37
37
  * added doh/time_util -- adds time_block for timing a block of code
38
38
  *0.1.12* (April 19th, 2008)
39
39
  * patch accidental instance level module method to class level (time_block)
40
+ *0.1.13* (April 19th, 2008)
41
+ * add new random_array_element for nested array cases
@@ -22,10 +22,15 @@ def self.random_range(min, max, multiplier = 1)
22
22
  (rand(max + 1 - min) + min) * multiplier
23
23
  end
24
24
 
25
- def self.random_element(array)
25
+ def self.random_array_element(array)
26
26
  array[rand(array.size)]
27
27
  end
28
28
 
29
+ def self.random_element(*args)
30
+ flat = args.flatten
31
+ flat[rand(flat.size)]
32
+ end
33
+
29
34
  def self.random_bool
30
35
  random_element(true, false)
31
36
  end
@@ -29,7 +29,7 @@ def self.random_email(first_name = nil, last_name = nil)
29
29
  end
30
30
 
31
31
  def self.random_ssn
32
- random_row = random_element(@@ssn_highgroups)
32
+ random_row = random_array_element(@@ssn_highgroups)
33
33
  highgroup = random_row[0]
34
34
  area = random_element(random_row[1])
35
35
  highgroup_index = @@ssn_group_order.index(highgroup)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makani & Kem Mason
@@ -33,77 +33,77 @@ extra_rdoc_files:
33
33
  - MIT-LICENSE
34
34
  - CHANGELOG
35
35
  files:
36
- - bin/run_tests.rb
37
36
  - bin/rcov-preprocess-files.rb
38
- - lib/doh.rb
37
+ - bin/run_tests.rb
39
38
  - lib/doh
40
- - lib/doh/logger
41
- - lib/doh/logger/standard_interface.rb
42
- - lib/doh/logger/event.rb
43
- - lib/doh/logger/severity.rb
44
- - lib/doh/logger/formatter.rb
45
- - lib/doh/logger/interface.rb
46
- - lib/doh/logger/memory_acceptor.rb
47
- - lib/doh/logger/direct_scheduler.rb
48
- - lib/doh/logger/iostream_acceptor.rb
49
- - lib/doh/logger/null_interface.rb
50
- - lib/doh/logger/util.rb
51
- - lib/doh/logger/notify_acceptor.rb
52
- - lib/doh/unit_test.rb
53
39
  - lib/doh/core
54
40
  - lib/doh/core/bigdecimal.rb
55
- - lib/doh/core/dir.rb
56
41
  - lib/doh/core/date.rb
42
+ - lib/doh/core/dir.rb
57
43
  - lib/doh/core/string.rb
58
- - lib/doh/logger_app.rb
59
44
  - lib/doh/core.rb
60
45
  - lib/doh/data
61
- - lib/doh/data/human.rb
62
46
  - lib/doh/data/basic.rb
63
47
  - lib/doh/data/bulk.rb
48
+ - lib/doh/data/human.rb
49
+ - lib/doh/data.rb
50
+ - lib/doh/logger
51
+ - lib/doh/logger/direct_scheduler.rb
52
+ - lib/doh/logger/event.rb
53
+ - lib/doh/logger/formatter.rb
54
+ - lib/doh/logger/interface.rb
55
+ - lib/doh/logger/iostream_acceptor.rb
56
+ - lib/doh/logger/memory_acceptor.rb
57
+ - lib/doh/logger/notify_acceptor.rb
58
+ - lib/doh/logger/null_interface.rb
59
+ - lib/doh/logger/severity.rb
60
+ - lib/doh/logger/standard_interface.rb
61
+ - lib/doh/logger/util.rb
64
62
  - lib/doh/logger.rb
63
+ - lib/doh/logger_app.rb
64
+ - lib/doh/mysql
65
+ - lib/doh/mysql/cache_connector.rb
66
+ - lib/doh/mysql/connector_instance.rb
67
+ - lib/doh/mysql/connector_util.rb
68
+ - lib/doh/mysql/database_creator.rb
69
+ - lib/doh/mysql/default_type_guesser.rb
70
+ - lib/doh/mysql/error.rb
71
+ - lib/doh/mysql/handle.rb
72
+ - lib/doh/mysql/hash_util.rb
73
+ - lib/doh/mysql/parse.rb
74
+ - lib/doh/mysql/raw_row_builder.rb
75
+ - lib/doh/mysql/readonly_row.rb
76
+ - lib/doh/mysql/to_sql.rb
77
+ - lib/doh/mysql/typed_row_builder.rb
78
+ - lib/doh/mysql/unquoted.rb
79
+ - lib/doh/mysql.rb
80
+ - lib/doh/unit_test.rb
65
81
  - lib/doh/util
82
+ - lib/doh/util/blank_slate.rb
66
83
  - lib/doh/util/current_date.rb
67
84
  - lib/doh/util/num_or_self.rb
68
- - lib/doh/util/run_tests.rb
69
85
  - lib/doh/util/options.rb
86
+ - lib/doh/util/run_tests.rb
70
87
  - lib/doh/util/source_ip.rb
71
88
  - lib/doh/util/time_util.rb
72
89
  - lib/doh/util/unit_test_logging.rb
73
- - lib/doh/util/blank_slate.rb
74
- - lib/doh/data.rb
75
- - lib/doh/mysql
76
- - lib/doh/mysql/hash_util.rb
77
- - lib/doh/mysql/to_sql.rb
78
- - lib/doh/mysql/typed_row_builder.rb
79
- - lib/doh/mysql/default_type_guesser.rb
80
- - lib/doh/mysql/database_creator.rb
81
- - lib/doh/mysql/raw_row_builder.rb
82
- - lib/doh/mysql/parse.rb
83
- - lib/doh/mysql/connector_util.rb
84
- - lib/doh/mysql/handle.rb
85
- - lib/doh/mysql/readonly_row.rb
86
- - lib/doh/mysql/cache_connector.rb
87
- - lib/doh/mysql/connector_instance.rb
88
- - lib/doh/mysql/unquoted.rb
89
- - lib/doh/mysql/error.rb
90
- - lib/doh/mysql.rb
90
+ - lib/doh.rb
91
+ - test/core
92
+ - test/core/tc_string.rb
91
93
  - test/logger
92
- - test/logger/tc_acceptor.rb
93
94
  - test/logger/sample.rb
95
+ - test/logger/tc_acceptor.rb
94
96
  - test/logger/tc_event.rb
95
97
  - test/logger/tc_formatter.rb
96
98
  - test/logger/tc_interface.rb
97
- - test/core
98
- - test/core/tc_string.rb
99
99
  - test/mysql
100
100
  - test/mysql/connector.yml.tmpl
101
- - test/mysql/tc_parse.rb
102
- - test/mysql/tc_handle.rb
103
101
  - test/mysql/db_unit_test.rb
104
- - test/mysql/tc_readonly_row.rb
105
102
  - test/mysql/tc_cache_connector.rb
106
103
  - test/mysql/tc_connector_instance.rb
104
+ - test/mysql/tc_handle.rb
105
+ - test/mysql/tc_parse.rb
106
+ - test/mysql/tc_readonly_row.rb
107
107
  - README
108
108
  - MIT-LICENSE
109
109
  - CHANGELOG
@@ -134,15 +134,15 @@ signing_key:
134
134
  specification_version: 2
135
135
  summary: DohRuby's purpose is to make your life as a developer easier & make you more efficient in your programming.
136
136
  test_files:
137
- - test/logger/tc_acceptor.rb
137
+ - test/core/tc_string.rb
138
138
  - test/logger/sample.rb
139
+ - test/logger/tc_acceptor.rb
139
140
  - test/logger/tc_event.rb
140
141
  - test/logger/tc_formatter.rb
141
142
  - test/logger/tc_interface.rb
142
- - test/core/tc_string.rb
143
- - test/mysql/tc_parse.rb
144
- - test/mysql/tc_handle.rb
145
143
  - test/mysql/db_unit_test.rb
146
- - test/mysql/tc_readonly_row.rb
147
144
  - test/mysql/tc_cache_connector.rb
148
145
  - test/mysql/tc_connector_instance.rb
146
+ - test/mysql/tc_handle.rb
147
+ - test/mysql/tc_parse.rb
148
+ - test/mysql/tc_readonly_row.rb