dohruby 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/doh/app/init.rb +1 -0
- data/lib/doh/boot/app_no_stdio.rb +2 -0
- data/lib/doh/core/bigdecimal.rb +1 -0
- data/lib/doh/core/date.rb +1 -0
- data/lib/doh/core/fixnum.rb +5 -0
- data/lib/doh/core/string.rb +2 -2
- data/lib/doh/core.rb +1 -0
- data/lib/doh/mysql/connector_instance.rb +2 -2
- data/lib/doh/mysql/handle.rb +1 -1
- data/test/core/tc_fixnum.rb +14 -0
- data/test/core/tc_string.rb +6 -0
- data/test/mysql/connector.yml +4 -0
- metadata +14 -4
data/lib/doh/app/init.rb
CHANGED
@@ -12,6 +12,7 @@ def self.init(file_or_directory)
|
|
12
12
|
find_home(File.dirname(file_or_directory))
|
13
13
|
end
|
14
14
|
$LOAD_PATH.push(File.join(DohApp::home, 'lib'))
|
15
|
+
$LOAD_PATH.push(DohApp::home)
|
15
16
|
require 'doh'
|
16
17
|
DohApp::load_config_file('system')
|
17
18
|
DohApp::load_config_file('development_environment') unless DohApp::load_config_file('active_environment')
|
data/lib/doh/core/bigdecimal.rb
CHANGED
data/lib/doh/core/date.rb
CHANGED
data/lib/doh/core/string.rb
CHANGED
@@ -70,8 +70,8 @@ class String
|
|
70
70
|
#this method strips the string, then combines all whitespace > 1 character into a single space
|
71
71
|
def normalize_all_whitespace
|
72
72
|
result = self.strip.gsub("\n", ' ').gsub("\t", ' ')
|
73
|
-
while
|
74
|
-
result =
|
73
|
+
while match = result.match(/\s\s/)
|
74
|
+
result = match.pre_match + ' ' + match.post_match
|
75
75
|
end
|
76
76
|
result
|
77
77
|
end
|
data/lib/doh/core.rb
CHANGED
@@ -32,8 +32,8 @@ def self.insert(statement)
|
|
32
32
|
request_handle.insert(statement)
|
33
33
|
end
|
34
34
|
|
35
|
-
def self.insert_hash(hash, table, ignore =
|
36
|
-
request_handle.insert_hash(hash, table)
|
35
|
+
def self.insert_hash(hash, table, ignore = nil)
|
36
|
+
request_handle.insert_hash(hash, table, ignore)
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.replace_hash(hash, table)
|
data/lib/doh/mysql/handle.rb
CHANGED
data/test/core/tc_string.rb
CHANGED
@@ -100,6 +100,12 @@ class TC_core_string < Test::Unit::TestCase
|
|
100
100
|
assert_equal(true, " sm\n\noe ".equals_ignore_whitespace(" sm oe "))
|
101
101
|
assert_equal(true, " s\tm\n\no e ".equals_ignore_whitespace("s m o e"))
|
102
102
|
end
|
103
|
+
|
104
|
+
def test_normalize_all_whitespace
|
105
|
+
assert_equal("foo blah", " foo blah ".normalize_all_whitespace)
|
106
|
+
assert_equal("foo blah", " foo\t\t\t\tblah ".normalize_all_whitespace)
|
107
|
+
assert_equal("foo blah", "\r\n\t\t\tfoo\t\r\n \r\n\r\n\r\nblah\t\t\t\t".normalize_all_whitespace)
|
108
|
+
end
|
103
109
|
end
|
104
110
|
|
105
111
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
9
|
+
- 4
|
10
|
+
version: 0.3.4
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Makani & Kem Mason
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-10-26 00:00:00 +13:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -59,6 +60,7 @@ files:
|
|
59
60
|
- lib/doh/app_pwd.rb
|
60
61
|
- lib/doh/app_util.rb
|
61
62
|
- lib/doh/boot/app.rb
|
63
|
+
- lib/doh/boot/app_no_stdio.rb
|
62
64
|
- lib/doh/boot/app_pwd.rb
|
63
65
|
- lib/doh/boot/find_dohruby.rb
|
64
66
|
- lib/doh/boot/find_dohruby_18.rb
|
@@ -70,6 +72,7 @@ files:
|
|
70
72
|
- lib/doh/core/date.rb
|
71
73
|
- lib/doh/core/deep_dup.rb
|
72
74
|
- lib/doh/core/dir.rb
|
75
|
+
- lib/doh/core/fixnum.rb
|
73
76
|
- lib/doh/core/hash.rb
|
74
77
|
- lib/doh/core/object.rb
|
75
78
|
- lib/doh/core/require_local.rb
|
@@ -171,6 +174,7 @@ files:
|
|
171
174
|
- test/core/tc_bigdecimal.rb
|
172
175
|
- test/core/tc_date.rb
|
173
176
|
- test/core/tc_deep_dup.rb
|
177
|
+
- test/core/tc_fixnum.rb
|
174
178
|
- test/core/tc_hash.rb
|
175
179
|
- test/core/tc_socket.rb
|
176
180
|
- test/core/tc_string.rb
|
@@ -186,6 +190,7 @@ files:
|
|
186
190
|
- test/mysql/001_up.sql
|
187
191
|
- test/mysql/002_down.sql
|
188
192
|
- test/mysql/002_up.sql
|
193
|
+
- test/mysql/connector.yml
|
189
194
|
- test/mysql/connector.yml.tmpl
|
190
195
|
- test/mysql/db_unit_test.rb
|
191
196
|
- test/mysql/tc_cache_connector.rb
|
@@ -224,23 +229,27 @@ rdoc_options: []
|
|
224
229
|
require_paths:
|
225
230
|
- lib
|
226
231
|
required_ruby_version: !ruby/object:Gem::Requirement
|
232
|
+
none: false
|
227
233
|
requirements:
|
228
234
|
- - ">="
|
229
235
|
- !ruby/object:Gem::Version
|
236
|
+
hash: 3
|
230
237
|
segments:
|
231
238
|
- 0
|
232
239
|
version: "0"
|
233
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
241
|
+
none: false
|
234
242
|
requirements:
|
235
243
|
- - ">="
|
236
244
|
- !ruby/object:Gem::Version
|
245
|
+
hash: 3
|
237
246
|
segments:
|
238
247
|
- 0
|
239
248
|
version: "0"
|
240
249
|
requirements: []
|
241
250
|
|
242
251
|
rubyforge_project: dohruby
|
243
|
-
rubygems_version: 1.3.
|
252
|
+
rubygems_version: 1.3.7
|
244
253
|
signing_key:
|
245
254
|
specification_version: 3
|
246
255
|
summary: DohRuby's purpose is to make your life as a developer easier & make you more efficient in your programming.
|
@@ -249,6 +258,7 @@ test_files:
|
|
249
258
|
- test/core/tc_bigdecimal.rb
|
250
259
|
- test/core/tc_date.rb
|
251
260
|
- test/core/tc_deep_dup.rb
|
261
|
+
- test/core/tc_fixnum.rb
|
252
262
|
- test/core/tc_hash.rb
|
253
263
|
- test/core/tc_socket.rb
|
254
264
|
- test/core/tc_string.rb
|