dohruby 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -33,3 +33,5 @@
33
33
  * remove useless exception handling in mysql/database_creator
34
34
  *0.1.10* (April 18th, 2008)
35
35
  * added new library: DohData - for random human (name, email, address) data generation
36
+ *0.1.11* (April 19th, 2008)
37
+ * added doh/time_util -- adds time_block for timing a block of code
@@ -22,15 +22,10 @@ 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_array_element(array)
25
+ def self.random_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
-
34
29
  def self.random_bool
35
30
  random_element(true, false)
36
31
  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_array_element(@@ssn_highgroups)
32
+ random_row = random_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)
@@ -0,0 +1,9 @@
1
+ module Doh
2
+
3
+ def time_block
4
+ start_time = Time.now
5
+ yield
6
+ return Time.now - start_time
7
+ end
8
+
9
+ end
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.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makani & Kem Mason
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-18 00:00:00 -06:00
12
+ date: 2008-04-19 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -33,76 +33,77 @@ extra_rdoc_files:
33
33
  - MIT-LICENSE
34
34
  - CHANGELOG
35
35
  files:
36
- - bin/rcov-preprocess-files.rb
37
36
  - bin/run_tests.rb
37
+ - bin/rcov-preprocess-files.rb
38
+ - lib/doh.rb
38
39
  - 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
39
53
  - lib/doh/core
40
54
  - lib/doh/core/bigdecimal.rb
41
- - lib/doh/core/date.rb
42
55
  - lib/doh/core/dir.rb
56
+ - lib/doh/core/date.rb
43
57
  - lib/doh/core/string.rb
58
+ - lib/doh/logger_app.rb
44
59
  - lib/doh/core.rb
45
60
  - lib/doh/data
61
+ - lib/doh/data/human.rb
46
62
  - lib/doh/data/basic.rb
47
63
  - 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
62
64
  - 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
81
65
  - lib/doh/util
82
- - lib/doh/util/blank_slate.rb
83
66
  - lib/doh/util/current_date.rb
84
67
  - lib/doh/util/num_or_self.rb
85
- - lib/doh/util/options.rb
86
68
  - lib/doh/util/run_tests.rb
69
+ - lib/doh/util/options.rb
87
70
  - lib/doh/util/source_ip.rb
71
+ - lib/doh/util/time_util.rb
88
72
  - lib/doh/util/unit_test_logging.rb
89
- - lib/doh.rb
90
- - test/core
91
- - test/core/tc_string.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
92
91
  - test/logger
93
- - test/logger/sample.rb
94
92
  - test/logger/tc_acceptor.rb
93
+ - test/logger/sample.rb
95
94
  - test/logger/tc_event.rb
96
95
  - test/logger/tc_formatter.rb
97
96
  - test/logger/tc_interface.rb
97
+ - test/core
98
+ - test/core/tc_string.rb
98
99
  - test/mysql
99
100
  - test/mysql/connector.yml.tmpl
101
+ - test/mysql/tc_parse.rb
102
+ - test/mysql/tc_handle.rb
100
103
  - test/mysql/db_unit_test.rb
104
+ - test/mysql/tc_readonly_row.rb
101
105
  - test/mysql/tc_cache_connector.rb
102
106
  - test/mysql/tc_connector_instance.rb
103
- - test/mysql/tc_handle.rb
104
- - test/mysql/tc_parse.rb
105
- - test/mysql/tc_readonly_row.rb
106
107
  - README
107
108
  - MIT-LICENSE
108
109
  - CHANGELOG
@@ -133,15 +134,15 @@ signing_key:
133
134
  specification_version: 2
134
135
  summary: DohRuby's purpose is to make your life as a developer easier & make you more efficient in your programming.
135
136
  test_files:
136
- - test/core/tc_string.rb
137
- - test/logger/sample.rb
138
137
  - test/logger/tc_acceptor.rb
138
+ - test/logger/sample.rb
139
139
  - test/logger/tc_event.rb
140
140
  - test/logger/tc_formatter.rb
141
141
  - test/logger/tc_interface.rb
142
+ - test/core/tc_string.rb
143
+ - test/mysql/tc_parse.rb
144
+ - test/mysql/tc_handle.rb
142
145
  - test/mysql/db_unit_test.rb
146
+ - test/mysql/tc_readonly_row.rb
143
147
  - test/mysql/tc_cache_connector.rb
144
148
  - test/mysql/tc_connector_instance.rb
145
- - test/mysql/tc_handle.rb
146
- - test/mysql/tc_parse.rb
147
- - test/mysql/tc_readonly_row.rb