dbi-dbrc 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.1.0 - 19-Oct-2005
2
+ * Bug fix for MS Windows (there's no Win32 namespace for win32/file).
3
+ * Changed platform detection mechanism.
4
+
1
5
  == 1.0.1 - 7-Oct-2005
2
6
  * Improved the error message when an entry isn't found.
3
7
 
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 File::ALT_SEPARATOR
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.1"
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 File::ALT_SEPARATOR
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 File::ALT_SEPARATOR && File.encrypted?(@dbrc_file)
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 File::ALT_SEPARATOR && encrypted
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 File::ALT_SEPARATOR
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
@@ -36,7 +36,7 @@ class TC_DBRC < Test::Unit::TestCase
36
36
  end
37
37
 
38
38
  def test_version
39
- assert_equal("1.0.1", DBRC::VERSION)
39
+ assert_equal("1.1.0", DBRC::VERSION)
40
40
  end
41
41
 
42
42
  def test_bad_dbrc_properties
data/test/tc_dbrc_xml.rb CHANGED
@@ -33,7 +33,7 @@ class TC_DBRC_XML < Test::Unit::TestCase
33
33
  end
34
34
 
35
35
  def test_version
36
- assert_equal("1.0.1", DBRC::XML::VERSION)
36
+ assert_equal("1.1.0", DBRC::XML::VERSION)
37
37
  end
38
38
 
39
39
  def test_constructor
data/test/tc_dbrc_yml.rb CHANGED
@@ -36,7 +36,7 @@ class TC_DBRC_YML < Test::Unit::TestCase
36
36
  end
37
37
 
38
38
  def test_version
39
- assert_equal("1.0.1", DBRC::YML::VERSION)
39
+ assert_equal("1.1.0", DBRC::YML::VERSION)
40
40
  end
41
41
 
42
42
  def test_constructor
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.1
7
- date: 2005-10-07 00:00:00 -06:00
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