head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.4 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.2 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.1.0.12 pkgsrc-2011Q4-base:1.1 pkgsrc-2011Q3:1.1.0.10 pkgsrc-2011Q3-base:1.1 pkgsrc-2011Q2:1.1.0.8 pkgsrc-2011Q2-base:1.1 pkgsrc-2011Q1:1.1.0.6 pkgsrc-2011Q1-base:1.1 pkgsrc-2010Q4:1.1.0.4 pkgsrc-2010Q4-base:1.1 pkgsrc-2010Q3:1.1.0.2 pkgsrc-2010Q3-base:1.1; locks; strict; comment @# @; 1.2 date 2012.03.17.14.18.49; author taca; state dead; branches; next 1.1; 1.1 date 2010.09.10.04.42.58; author taca; state Exp; branches; next ; desc @@ 1.2 log @Remove ruby-postgresql. There is postgresql.gem named 0.8.1 and its README.txt says: This is an old, deprecated version of the Ruby PostgreSQL driver that hasn't been maintained or supported since early 2008. You should install/require 'pg' instead. So, say good-by to databases/ruby-postgresql and use databases/ruby-pg. @ text @$NetBSD: patch-ab,v 1.1 2010/09/10 04:42:58 taca Exp $ Use modern Ruby's API. --- ext/postgres.c.orig 2010-08-28 00:00:42.000000000 +0000 +++ ext/postgres.c @@@@ -192,7 +192,7 @@@@ pgconn_connect(argc, argv, self) PGconn *conn = NULL; rb_scan_args(argc, argv, "0*", &args); - if (RARRAY(args)->len == 1) { + if (RARRAY_LEN(args) == 1) { conn = try_connectdb(rb_ary_entry(args, 0)); } if (conn == NULL) { @@@@ -720,14 +720,14 @@@@ pgconn_exec(argc, argv, obj) Check_Type(command, T_STRING); - if (RARRAY(params)->len <= 0) { + if (RARRAY_LEN(params) <= 0) { result = PQexec(conn, StringValuePtr(command)); } else { - int len = RARRAY(params)->len; + int len = RARRAY_LEN(params); int i; #ifdef HAVE_PQEXECPARAMS - VALUE* ptr = RARRAY(params)->ptr; + VALUE* ptr = RARRAY_PTR(params); char const** values = ALLOCA_N(char const*, len); int* lengths = ALLOCA_N(int, len); int* formats = ALLOCA_N(int, len); @@@@ -947,9 +947,9 @@@@ pgconn_insert_table(obj, table, values) Check_Type(table, T_STRING); Check_Type(values, T_ARRAY); - i = RARRAY(values)->len; + i = RARRAY_LEN(values); while (i--) { - if (TYPE(RARRAY(RARRAY(values)->ptr[i])) != T_ARRAY) { + if (TYPE(RARRAY(RARRAY_PTR(values)[i])) != T_ARRAY) { rb_raise(rb_ePGError, "second arg must contain some kind of arrays."); } } @@@@ -964,15 +964,15 @@@@ pgconn_insert_table(obj, table, values) } PQclear(result); - for (i = 0; i < RARRAY(values)->len; i++) { - struct RArray *row = RARRAY(RARRAY(values)->ptr[i]); + for (i = 0; i < RARRAY_LEN(values); i++) { + struct RArray *row = RARRAY(RARRAY_PTR(values)[i]); buffer = rb_tainted_str_new(0,0); - for (j = 0; j < row->len; j++) { + for (j = 0; j < RARRAY_LEN(row); j++) { if (j > 0) rb_str_cat(buffer, "\t", 1); - if (NIL_P(row->ptr[j])) { + if (NIL_P(RARRAY_PTR(row)[j])) { rb_str_cat(buffer, "\\N",2); } else { - s = rb_obj_as_string(row->ptr[j]); + s = rb_obj_as_string(RARRAY_PTR(row)[j]); rb_funcall(s,pg_gsub_bang_id,2, rb_str_new("([\\t\\n\\\\])", 10),pg_escape_str); rb_str_cat(buffer, StringValuePtr(s), RSTRING_LEN(s)); @@@@ -1482,7 +1482,7 @@@@ fetch_pgrow(self, fields, row_num) PGresult *result = get_pgresult(self); VALUE row = rb_funcall(rb_cPGrow, rb_intern("new"), 1, fields); int field_num; - for (field_num = 0; field_num < RARRAY(fields)->len; field_num++) { + for (field_num = 0; field_num < RARRAY_LEN(fields); field_num++) { /* don't use push, PGrow is sized with nils in #new */ rb_ary_store(row, field_num, fetch_pgresult(result, row_num, field_num)); } @@@@ -2417,7 +2417,7 @@@@ static VALUE pgrow_init(self, keys) VALUE self, keys; { - VALUE args[1] = { LONG2NUM(RARRAY(keys)->len) }; + VALUE args[1] = { LONG2NUM(RARRAY_LEN(keys)) }; rb_call_super(1, args); rb_iv_set(self, "@@keys", keys); return self; @@@@ -2501,7 +2501,7 @@@@ pgrow_each_pair(self) { VALUE keys = pgrow_keys(self); int i; - for (i = 0; i < RARRAY(keys)->len; ++i) { + for (i = 0; i < RARRAY_LEN(keys); ++i) { rb_yield(rb_assoc_new(rb_ary_entry(keys, i), rb_ary_entry(self, i))); } return self; @@@@ -2556,7 +2556,7 @@@@ pgrow_to_hash(self) VALUE result = rb_hash_new(); VALUE keys = pgrow_keys(self); int i; - for (i = 0; i < RARRAY(self)->len; ++i) { + for (i = 0; i < RARRAY_LEN(self); ++i) { rb_hash_aset(result, rb_ary_entry(keys, i), rb_ary_entry(self, i)); } return result; @ 1.1 log @* Use lang/ruby/gem.mk instead of misc/rubygems/rubygem.mk. * Update HOMEPAGE. * Add LICENSE. * Remove default value of GEM_BUILD. * Add patches for supporting ruby19. @ text @d1 1 a1 1 $NetBSD$ @