- fix ruby 2.0

This commit is contained in:
Dirk Meyer 2014-10-17 13:59:46 +00:00
parent 3b1244bbaf
commit c9b9b57c2e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=371055
3 changed files with 54 additions and 0 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= dbi
PORTVERSION= 0.4.5
PORTREVISION= 1
CATEGORIES= databases rubygems
MASTER_SITES= RG

View File

@ -0,0 +1,39 @@
--- lib/dbi/row.rb.orig 2014-10-17 15:50:24.000000000 +0200
+++ lib/dbi/row.rb 2014-10-17 15:54:47.000000000 +0200
@@ -209,7 +209,6 @@
end
- if RUBY_VERSION =~ /^1\.9/
def __getobj__
@arr
end
@@ -217,28 +216,6 @@
def __setobj__(obj)
@delegate_dc_obj = @arr = obj
end
- else
- #
- # See Object#clone.
- #
- # #clone and #dup here, however, are both deep copies via Marshal.
- #
- def clone
- Marshal.load(Marshal.dump(self))
- end
-
- def dup
- row = self.class.allocate
- row.instance_variable_set :@column_types, @column_types
- row.instance_variable_set :@convert_types, @convert_types
- row.instance_variable_set :@column_map, @column_map
- row.instance_variable_set :@column_names, @column_names
- # this is the only one we actually dup...
- row.instance_variable_set :@arr, arr = @arr.dup
- row.instance_variable_set :@_dc_obj, arr
- row
- end
- end
private

View File

@ -0,0 +1,14 @@
--- test/dbi/tc_types.rb.orig 2014-10-17 15:44:22.000000000 +0200
+++ test/dbi/tc_types.rb 2014-10-17 15:48:58.000000000 +0200
@@ -114,11 +114,7 @@
d = Date.today
assert_equal(DateTime.parse(d.to_s).to_s, klass.parse(d).to_s)
- md = "10-11"
-
- if RUBY_VERSION =~ /^1\.9/
md = "11-10"
- end
# be sure we're actually getting the right data back
assert_equal(