dbi-dbrc 1.0.1 → 1.1.0
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/CHANGES +4 -0
- data/README +9 -0
- data/lib/dbi/dbrc.rb +6 -7
- data/test/tc_dbrc.rb +1 -1
- data/test/tc_dbrc_xml.rb +1 -1
- data/test/tc_dbrc_yml.rb +1 -1
- metadata +2 -2
data/CHANGES
CHANGED
data/README
CHANGED
@@ -218,6 +218,15 @@ DBRC#dsn=(dsn)
|
|
218
218
|
party, which is a bit much to expect. However, if the file is encrypted,
|
219
219
|
DBRC will attempt to decrypt it, parse it, and encrypt it again when done
|
220
220
|
parsing.
|
221
|
+
|
222
|
+
== Notes on running the test suite
|
223
|
+
I cannot guarantee that the .dbrc files under the +examples+
|
224
|
+
subdirectories maintain the appropriate properties. This can cause
|
225
|
+
failures for the test suite (which uses these files).
|
226
|
+
|
227
|
+
The only solution is to perform a 'chmod 600 .dbrc' (on Unix) or set
|
228
|
+
the properties to 'hidden' (on MS Windows) manually, for the file in
|
229
|
+
question.
|
221
230
|
|
222
231
|
== Summary
|
223
232
|
These "methods" don't really do anything. They're simply meant as a
|
data/lib/dbi/dbrc.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
if
|
1
|
+
if PLATFORM.match("mswin")
|
2
2
|
require "win32/file"
|
3
|
-
include Win32
|
4
3
|
end
|
5
4
|
|
6
5
|
require "sys/admin"
|
@@ -14,7 +13,7 @@ module DBI
|
|
14
13
|
|
15
14
|
# The main class.
|
16
15
|
class DBRC
|
17
|
-
VERSION = "1.0
|
16
|
+
VERSION = "1.1.0"
|
18
17
|
attr_accessor :database, :user, :password, :driver, :dsn
|
19
18
|
attr_accessor :maximum_reconnects, :timeout, :interval, :dbrc_dir
|
20
19
|
|
@@ -34,7 +33,7 @@ module DBI
|
|
34
33
|
# properties, a DBRCError is raised.
|
35
34
|
def initialize(database,user=nil,dbrc_dir=nil)
|
36
35
|
if dbrc_dir.nil?
|
37
|
-
if
|
36
|
+
if PLATFORM.match("mswin")
|
38
37
|
home = ENV["USERPROFILE"] || ENV["HOME"]
|
39
38
|
file = nil
|
40
39
|
|
@@ -60,7 +59,7 @@ module DBI
|
|
60
59
|
check_file()
|
61
60
|
|
62
61
|
# If on Win32 and the file is encrypted, decrypt it.
|
63
|
-
if
|
62
|
+
if PLATFORM.match("mswin") && File.encrypted?(@dbrc_file)
|
64
63
|
encrypted = true
|
65
64
|
File.decrypt(@dbrc_file)
|
66
65
|
end
|
@@ -71,7 +70,7 @@ module DBI
|
|
71
70
|
create_dsn_string()
|
72
71
|
|
73
72
|
# If on Win32 and the file was encrypted, re-encrypt it
|
74
|
-
if
|
73
|
+
if PLATFORM.match("mswin") && encrypted
|
75
74
|
File.encrypt(@dbrc_file)
|
76
75
|
end
|
77
76
|
end
|
@@ -107,7 +106,7 @@ module DBI
|
|
107
106
|
|
108
107
|
# Permissions must be set to 600 or better on Unix systems.
|
109
108
|
# Must be hidden on Win32 systems.
|
110
|
-
if
|
109
|
+
if PLATFORM.match("mswin")
|
111
110
|
unless File.hidden?(file)
|
112
111
|
raise DBRCError, "The .dbrc file must be hidden"
|
113
112
|
end
|
data/test/tc_dbrc.rb
CHANGED
data/test/tc_dbrc_xml.rb
CHANGED
data/test/tc_dbrc_yml.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: dbi-dbrc
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0
|
7
|
-
date: 2005-10-
|
6
|
+
version: 1.1.0
|
7
|
+
date: 2005-10-19 00:00:00 -06:00
|
8
8
|
summary: A simple way to avoid hard-coding passwords with DBI
|
9
9
|
require_paths:
|
10
10
|
- lib
|