[ruby-oci8-commit] [520] trunk/ruby-oci8: delete private methods OCI8#server_handle and OCI8#session_handle.

nobody at rubyforge.org nobody at rubyforge.org
Sat May 5 09:02:56 UTC 2012


Revision: 520
Author:   kubo
Date:     2012-05-05 09:02:56 +0000 (Sat, 05 May 2012)
Log Message:
-----------
delete private methods OCI8#server_handle and OCI8#session_handle.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/oci8.c
    trunk/ruby-oci8/lib/oci8/oci8.rb

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2012-04-28 07:16:47 UTC (rev 519)
+++ trunk/ruby-oci8/ChangeLog	2012-05-05 09:02:56 UTC (rev 520)
@@ -1,3 +1,7 @@
+2012-05-05  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/oci8.c, lib/oci8/oci8.rb: delete private methods OCI8#server_handle
+	    and OCI8#session_handle and use @server_handle and @session_handle instead.
+
 2012-04-28  KUBO Takehiro  <kubo at jiubao.org>
 	* NEWS: add changes between 2.1.2 and 2.1.1
 	* VERSION: change the version to 2.1.2.

Modified: trunk/ruby-oci8/ext/oci8/oci8.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/oci8.c	2012-04-28 07:16:47 UTC (rev 519)
+++ trunk/ruby-oci8/ext/oci8/oci8.c	2012-05-05 09:02:56 UTC (rev 520)
@@ -421,32 +421,6 @@
 
 /*
  * call-seq:
- *   session_handle -> a session handle
- *
- * <b>internal use only</b>
- *
- * Returns a session handle associated with the service context handle.
- */
-static VALUE oci8_get_session_handle(VALUE self)
-{
-    return rb_ivar_get(self, id_at_session_handle);
-}
-
-/*
- * call-seq:
- *   server_handle -> a server handle
- *
- * <b>internal use only</b>
- *
- * Returns a server handle associated with the service context handle.
- */
-static VALUE oci8_get_server_handle(VALUE self)
-{
-    return rb_ivar_get(self, id_at_server_handle);
-}
-
-/*
- * call-seq:
  *   server_attach(dbname, mode)
  *
  * <b>internal use only</b>
@@ -1107,8 +1081,6 @@
     rb_define_private_method(cOCI8, "parse_connect_string", oci8_parse_connect_string, 1);
     rb_define_private_method(cOCI8, "logon2", oci8_logon2, 4);
     rb_define_private_method(cOCI8, "allocate_handles", oci8_allocate_handles, 0);
-    rb_define_private_method(cOCI8, "session_handle", oci8_get_session_handle, 0);
-    rb_define_private_method(cOCI8, "server_handle", oci8_get_server_handle, 0);
     rb_define_private_method(cOCI8, "server_attach", oci8_server_attach, 2);
     rb_define_private_method(cOCI8, "session_begin", oci8_session_begin, 2);
     rb_define_method(cOCI8, "logoff", oci8_svcctx_logoff, 0);

Modified: trunk/ruby-oci8/lib/oci8/oci8.rb
===================================================================
--- trunk/ruby-oci8/lib/oci8/oci8.rb	2012-04-28 07:16:47 UTC (rev 519)
+++ trunk/ruby-oci8/lib/oci8/oci8.rb	2012-05-05 09:02:56 UTC (rev 520)
@@ -154,8 +154,8 @@
       end
 
       allocate_handles()
-      session_handle.send(:attr_set_string, OCI_ATTR_USERNAME, username) if username
-      session_handle.send(:attr_set_string, OCI_ATTR_PASSWORD, password) if password
+      @session_handle.send(:attr_set_string, OCI_ATTR_USERNAME, username) if username
+      @session_handle.send(:attr_set_string, OCI_ATTR_PASSWORD, password) if password
       server_attach(dbname, attach_mode)
       session_begin(cred ? cred : OCI_CRED_RDBMS, mode ? mode : OCI_DEFAULT)
 
@@ -367,7 +367,7 @@
   #
   # Returns the database character set name.
   def database_charset_name
-    charset_id2name(server_handle.send(:attr_get_ub2, OCI_ATTR_CHARSET_ID))
+    charset_id2name(@server_handle.send(:attr_get_ub2, OCI_ATTR_CHARSET_ID))
   end
 
   # :call-seq:



More information about the ruby-oci8-commit mailing list