fb 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/extconf.rb +14 -9
  2. data/test/TransactionTestCases.rb +18 -0
  3. metadata +12 -5
data/extconf.rb CHANGED
@@ -1,20 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
2
  # = Windows
3
3
  # === Sample of Makefile creation:
4
- # <tt>ruby extconf.rb --with-opt-dir=c:/Firebird --with-dotnet-dir=C:\PROGRA~1\MICROS~2.NET\Vc7 --with-win32-dir=C:\PROGRA~1\MI9547~1</tt>
4
+ # <tt>ruby extconf.rb --with-opt-dir=C:/Progra~1/Firebird/Firebird_2_1</tt>
5
5
  # === Notes
6
- # * Windows build currently only compiles using VC7 (Visual Studio .NET 2003).
6
+ # * Windows is known to build with Ruby 1.8.7 from rubyinstaller.org.
7
+ # * New in this release is automatically finding your Firebird install under Program Files.
8
+ # * If your install is some place non-standard (or on a non-English version of Windows), you'll need to run extconf.rb manually as above.
7
9
  # * mkmf doesn't like directories with spaces, hence the 8.3 notation in the example above.
8
- # = Linux (Intel)
10
+ # = Linux
9
11
  # === Notes
10
12
  # * Build seems to "just work."
11
13
  # * Unit tests take about 10 times as long to complete using Firebird Classic. Default xinetd.conf settings may not allow the tests to complete due to the frequency with which new attachments are made.
12
- # = Linux (Other)
13
- # * Volunteers?
14
- # = Mac OS X (PowerPC)
15
- # * Not currently tested.
16
14
  # = Mac OS X (Intel)
17
15
  # * Works
16
+
17
+ if RUBY_PLATFORM =~ /(mingw32|mswin32)/ and ARGV.grep(/^--with-opt-dir=/).empty?
18
+ if opt = Dir["C:/Progra~1/Firebird/Firebird_*"].sort.last
19
+ ARGV << "--with-opt-dir=#{opt}"
20
+ end
21
+ end
22
+
18
23
  require 'mkmf'
19
24
 
20
25
  libs = %w/ fbclient gds /
@@ -22,7 +27,7 @@ libs = %w/ fbclient gds /
22
27
  case RUBY_PLATFORM
23
28
  when /bccwin32/
24
29
  libs.push "fbclient_bor"
25
- when /mswin32/
30
+ when /mswin32/, /mingw32/
26
31
  $CFLAGS = $CFLAGS + " -DOS_WIN32"
27
32
  libs.push "fbclient_ms"
28
33
  when /darwin/
@@ -42,7 +47,7 @@ dir_config("firebird")
42
47
  test_func = "isc_attach_database"
43
48
 
44
49
  case RUBY_PLATFORM
45
- when /mswin32/
50
+ when /mswin32/, /mingw32/
46
51
  libs.find {|lib| have_library(lib) } and
47
52
  have_func(test_func, ["ibase.h"])
48
53
  else
@@ -256,4 +256,22 @@ class TransactionTestCases < Test::Unit::TestCase
256
256
  end
257
257
  end
258
258
  end
259
+
260
+ def test_auto_and_explicit_transactions
261
+ sql_schema = "CREATE TABLE TEST (ID INT, NAME VARCHAR(20))"
262
+ sql_insert = "INSERT INTO TEST (ID, NAME) VALUES (?, ?)"
263
+ sql_select = "SELECT * FROM TEST ORDER BY ID"
264
+ sql_update = "UPDATE TEST SET NAME = 'NAME 0' WHERE ID = 10"
265
+ Database.create(@parms) do |conn|
266
+ conn.execute(sql_schema)
267
+ conn.transaction { 10.times { |i| conn.execute(sql_insert, i, "NAME#{i}") } }
268
+ result = conn.query(sql_select)
269
+ assert !conn.transaction_started
270
+ conn.transaction("READ COMMITTED") do
271
+ assert conn.transaction_started
272
+ conn.execute(sql_update)
273
+ end
274
+ assert !conn.transaction_started
275
+ end
276
+ end
259
277
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 6
9
+ version: 0.6.6
5
10
  platform: ruby
6
11
  authors:
7
12
  - Brent Rowland
@@ -9,7 +14,7 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-09-26 00:00:00 -07:00
17
+ date: 2010-03-25 00:00:00 -07:00
13
18
  default_executable:
14
19
  dependencies: []
15
20
 
@@ -51,18 +56,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
56
  requirements:
52
57
  - - ">="
53
58
  - !ruby/object:Gem::Version
59
+ segments:
60
+ - 0
54
61
  version: "0"
55
- version:
56
62
  required_rubygems_version: !ruby/object:Gem::Requirement
57
63
  requirements:
58
64
  - - ">="
59
65
  - !ruby/object:Gem::Version
66
+ segments:
67
+ - 0
60
68
  version: "0"
61
- version:
62
69
  requirements:
63
70
  - Firebird client library fbclient.dll, libfbclient.so or Firebird.framework.
64
71
  rubyforge_project: fblib
65
- rubygems_version: 1.3.5
72
+ rubygems_version: 1.3.6
66
73
  signing_key:
67
74
  specification_version: 3
68
75
  summary: Firebird and Interbase driver