rubyfb 0.5.3-x86-mswin32-60 → 0.5.4-x86-mswin32-60

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/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ v0.5.4 ==
2
+ add configurable boolen domain and boolean name match patterns
3
+ fix scale handling for view columns
4
+ extconf.rb - replace PLATFORM with RUBY_PLATFORM
5
+
1
6
  v0.5.3 ==
2
7
  rename top module to Rubyfb
3
8
  !!!WARNING!!!
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- e = Echoe.new('rubyfb', '0.5.3') do |p|
2
+ e = Echoe.new('rubyfb', '0.5.4') do |p|
3
3
  p.description = "Firebird SQL access library"
4
4
  p.url = "http://rubyforge.org/projects/rubyfb"
5
5
  p.author = "George Georgiev"
data/ext/extconf.rb CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- ENV['ARCHFLAGS']='-arch '+`arch`.strip if PLATFORM.include?("darwin")
3
+ ENV['ARCHFLAGS']='-arch '+`arch`.strip if RUBY_PLATFORM.include?("darwin")
4
4
 
5
5
  require 'mkmf'
6
6
 
7
7
  # Add the framework link for Mac OS X.
8
- if PLATFORM.include?("darwin")
8
+ if RUBY_PLATFORM.include?("darwin")
9
9
  $LDFLAGS = $LDFLAGS + " -framework Firebird"
10
10
  $CFLAGS = $CFLAGS + " -DOS_UNIX"
11
11
  firebird_include="/Library/Frameworks/Firebird.framework/Headers"
12
12
  firebird_lib="/Library/Frameworks/Firebird.framework/Libraries"
13
- elsif PLATFORM.include?("win32")
13
+ elsif RUBY_PLATFORM.include?("win32")
14
14
  $LDFLAGS = $LDFLAGS + " fbclient_ms.lib"
15
15
  $CFLAGS = "-MT #{$CFLAGS}".gsub!(/-MD\s*/, '') + " -DOS_WIN32"
16
16
  dir_config("win32")
@@ -18,7 +18,7 @@ elsif PLATFORM.include?("win32")
18
18
  dir_config("dotnet")
19
19
  firebird_include="../mswin32fb"
20
20
  firebird_lib="../mswin32fb"
21
- elsif PLATFORM.include?("linux")
21
+ elsif RUBY_PLATFORM.include?("linux")
22
22
  $LDFLAGS = $LDFLAGS + " -lfbclient -lpthread"
23
23
  $CFLAGS = $CFLAGS + " -DOS_UNIX"
24
24
  end
@@ -66,7 +66,7 @@ module ActiveRecord
66
66
  super(name.downcase, nil, @firebird_type, !null_flag)
67
67
 
68
68
  @limit = decide_limit(length)
69
- @domain, @sub_type, @precision, @scale = domain, sub_type, precision, scale.abs
69
+ @domain, @sub_type, @precision, @scale = domain, sub_type, precision, (scale.nil? ? 0 : scale.abs)
70
70
  @type = simplified_type(@firebird_type)
71
71
  @default = parse_default(default_source) if default_source
72
72
  @default = type_cast(decide_default(connection)) if @default
@@ -124,7 +124,7 @@ module ActiveRecord
124
124
  when /blob/i
125
125
  @subtype == 1 ? :text : :binary
126
126
  else
127
- if @domain =~ /boolean/i
127
+ if @domain =~ RubyfbAdapter.boolean_domain[:domain_pattern] || name =~ RubyfbAdapter.boolean_domain[:name_pattern]
128
128
  :boolean
129
129
  else
130
130
  super
@@ -164,9 +164,15 @@ module ActiveRecord
164
164
  #
165
165
  # CREATE DOMAIN BOOLEAN AS CHAR(1) CHECK (VALUE IN ('T', 'F'));
166
166
  #
167
- # ...you can add the following line to your <tt>environment.rb</tt> file:
167
+ # ...you can add the following lines to your <tt>environment.rb</tt> file:
168
168
  #
169
- # ActiveRecord::ConnectionAdapters::RubyfbAdapter.boolean_domain = { :true => 'T', :false => 'F' }
169
+ # ActiveRecord::ConnectionAdapters::RubyfbAdapter.boolean_domain[:true] = 'T'
170
+ # ActiveRecord::ConnectionAdapters::RubyfbAdapter.boolean_domain[:false] = 'F'
171
+ #
172
+ # Boolean columns are detected by name and domain name patterns configurable by:
173
+ #
174
+ # ActiveRecord::ConnectionAdapters::RubyfbAdapter.boolean_domain[:domain_pattern], default = /boolean/i
175
+ # ActiveRecord::ConnectionAdapters::RubyfbAdapter.boolean_domain[:name_pattern], default = /^is_/i
170
176
  #
171
177
  # === BLOB Elements
172
178
  # The Firebird adapter currently provides only limited support for +BLOB+
@@ -276,7 +282,7 @@ module ActiveRecord
276
282
  class RubyfbAdapter < AbstractAdapter
277
283
  TEMP_COLUMN_NAME = 'AR$TEMP_COLUMN'
278
284
 
279
- @@boolean_domain = { :name => "d_boolean", :type => "smallint", :true => 1, :false => 0 }
285
+ @@boolean_domain = { :name => "d_boolean", :type => "smallint", :true => 1, :false => 0, :domain_pattern=>/boolean/i, :name_pattern=>/^is_/i }
280
286
  cattr_accessor :boolean_domain
281
287
 
282
288
  def initialize(connection, logger, connection_params = nil)
data/lib/rubyfb_lib.so CHANGED
Binary file
data/rubyfb.gemspec CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rubyfb}
5
- s.version = "0.5.3"
5
+ s.version = "0.5.4"
6
6
  s.platform = %q{x86-mswin32-60}
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["George Georgiev"]
10
- s.date = %q{2010-08-18}
10
+ s.date = %q{2010-10-15}
11
11
  s.description = %q{Firebird SQL access library}
12
12
  s.email = %q{georgiev@heatbs.com}
13
13
  s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "examples/example01.rb", "ext/extconf.rb", "lib/Connection.rb", "lib/ProcedureCall.rb", "lib/SQLType.rb", "lib/rubyfb.rb", "lib/src.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyfb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: x86-mswin32-60
6
6
  authors:
7
7
  - George Georgiev
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-08-18 00:00:00 +03:00
12
+ date: 2010-10-15 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies: []
15
15