[ruby-oci8-commit] [572] trunk/ruby-oci8: Add OCI8::Metadata::Type#package_name and OCI8:: Metadata::ArgBase#has_default?.

nobody at rubyforge.org nobody at rubyforge.org
Wed Jul 24 14:55:53 UTC 2013


Revision: 572
Author:   kubo
Date:     2013-07-24 14:55:52 +0000 (Wed, 24 Jul 2013)
Log Message:
-----------
Add OCI8::Metadata::Type#package_name and OCI8::Metadata::ArgBase#has_default?.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/lib/oci8/metadata.rb
    trunk/ruby-oci8/test/test_package_type.rb

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2013-07-22 12:52:52 UTC (rev 571)
+++ trunk/ruby-oci8/ChangeLog	2013-07-24 14:55:52 UTC (rev 572)
@@ -1,6 +1,12 @@
+2013-07-24  KUBO Takehiro  <kubo at jiubao.org>
+	* lib/oci8/metadata.rb, test/test_package_type.rb:
+	    Add OCI8::Metadata::Type#package_name and
+	    OCI8::Metadata::ArgBase#has_default?.
+
 2013-07-22  KUBO Takehiro  <kubo at jiubao.org>
-	* ext/oci8/oci8lib.c, lib/oci8.rb.in, lib/oci8/metadata.rb: Support
-	    package type description. It is a new feature of Oracle 12c.
+	* ext/oci8/oci8lib.c, lib/oci8.rb.in, lib/oci8/metadata.rb: Add
+	    OCI8::Metadata::Package:types to support package type
+	    description. It is a new feature of Oracle 12c.
 	* test/setup_test_package.sql, test/test_all.rb,
 	  test/test_package_type.rb: Add tests for package type description.
 

Modified: trunk/ruby-oci8/lib/oci8/metadata.rb
===================================================================
--- trunk/ruby-oci8/lib/oci8/metadata.rb	2013-07-22 12:52:52 UTC (rev 571)
+++ trunk/ruby-oci8/lib/oci8/metadata.rb	2013-07-24 14:55:52 UTC (rev 572)
@@ -882,6 +882,15 @@
         attr_get_string(OCI_ATTR_SUPERTYPE_NAME) if is_subtype?
       end
 
+      # Returns the package name if the type is a package type.
+      # Otherwise, +nil+.
+      #
+      # @return [String or nil]
+      # @since 2.1.6
+      def package_name
+        attr_get_string(12, false) # OCI_ATTR_PACKAGE_NAME
+      end
+
       # Returns attribute information of the type.
       #
       # @return [array of OCI8::Metadata::TypeAttr]
@@ -1518,10 +1527,21 @@
       end
 
       # Indicates whether an argument has a default
+      #
+      # @return [1 or 0]
+      # @deprecated
       def has_default
         attr_get_ub1(OCI_ATTR_HAS_DEFAULT)
       end
 
+      # Indicates whether an argument has a default
+      #
+      # @return [true or false]
+      # @since 2.1.6
+      def has_default?
+        __boolean(OCI_ATTR_HAS_DEFAULT)
+      end
+
       # The list of arguments at the next level (when the argument is
       # of a record or table type).
       def list_arguments

Modified: trunk/ruby-oci8/test/test_package_type.rb
===================================================================
--- trunk/ruby-oci8/test/test_package_type.rb	2013-07-22 12:52:52 UTC (rev 571)
+++ trunk/ruby-oci8/test/test_package_type.rb	2013-07-24 14:55:52 UTC (rev 572)
@@ -68,6 +68,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => nil,
       :type_attrs => [],
       #:type_methods => [],
     }
@@ -95,6 +96,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => nil,
       :type_attrs => [],
       #:type_methods => [],
     }
@@ -122,6 +124,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => nil,
       :type_attrs => [],
       #:type_methods => [],
     }
@@ -149,6 +152,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => nil,
       :type_attrs => [],
       #:type_methods => #[],
     }
@@ -187,6 +191,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => 'RB_TEST_PKG',
       :type_attrs => [],
       :type_methods => [],
     }
@@ -225,6 +230,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => 'RB_TEST_PKG',
       :type_attrs => [],
       :type_methods => [],
     }
@@ -263,6 +269,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => 'RB_TEST_PKG',
       :type_attrs => [],
       :type_methods => [],
     }
@@ -301,6 +308,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => 'RB_TEST_PKG',
       :type_attrs => [],
       :type_methods => [],
     }
@@ -328,6 +336,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => 'RB_TEST_PKG',
       :type_attrs => {
         :class => Array,
         :size => 2,
@@ -386,6 +395,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => 'RB_TEST_PKG',
       :type_attrs => {
         :class => Array,
         :size => 3,
@@ -469,6 +479,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => 'RB_TEST_PKG',
       :type_attrs => [],
       :type_methods => [],
     }
@@ -507,6 +518,7 @@
       :is_final_type? => true,
       :is_instantiable_type? => true,
       :is_subtype? => false,
+      :package_name => 'RB_TEST_PKG',
       :type_attrs => [],
       :type_methods => [],
     }
@@ -545,6 +557,7 @@
           :scale => 0,
           :level => 0,
           :has_default => 0,
+          :has_default? => false,
           :iomode => :out,
           :radix => 0,
           :type_name => "",
@@ -567,6 +580,7 @@
           :scale => 0,
           :level => 0,
           :has_default => 0,
+          :has_default? => false,
           :iomode => :in,
           :radix => 0,
           :type_name => "RB_TEST_PKG",
@@ -590,6 +604,7 @@
               :scale => 0,
               :level => 1,
               :has_default => 0,
+              :has_default? => false,
               :iomode => :in,
               :radix => 0,
               :type_name => "",
@@ -628,6 +643,7 @@
           :scale => 0,
           :level => 0,
           :has_default => 0,
+          :has_default? => false,
           :iomode => :out,
           :radix => 0,
           :type_name => "",
@@ -650,6 +666,7 @@
           :scale => 0,
           :level => 0,
           :has_default => 0,
+          :has_default? => false,
           :iomode => :in,
           :radix => 0,
           :type_name => "RB_TEST_PKG",
@@ -673,6 +690,7 @@
               :scale => 0,
               :level => 1,
               :has_default => 0,
+              :has_default? => false,
               :iomode => :in,
               :radix => 0,
               :type_name => "RB_TEST_PKG",
@@ -696,6 +714,7 @@
                   :scale => 0,
                   :level => 2,
                   :has_default => 0,
+                  :has_default? => false,
                   :iomode => :in,
                   :radix => 0,
                   :type_name => "",
@@ -718,6 +737,7 @@
                   :scale => 0,
                   :level => 2,
                   :has_default => 0,
+                  :has_default? => false,
                   :iomode => :in,
                   :radix => 10,
                   :type_name => "",
@@ -758,6 +778,7 @@
           :scale => 0,
           :level => 0,
           :has_default => 0,
+          :has_default? => false,
           :iomode => :out,
           :radix => 0,
           :type_name => "RB_TEST_PKG",
@@ -781,6 +802,7 @@
               :scale => 0,
               :level => 1,
               :has_default => 0,
+              :has_default? => false,
               :iomode => :out,
               :radix => 0,
               :type_name => "RB_TEST_PKG",
@@ -804,6 +826,7 @@
                   :scale => 0,
                   :level => 2,
                   :has_default => 0,
+                  :has_default? => false,
                   :iomode => :out,
                   :radix => 0,
                   :type_name => "",
@@ -826,6 +849,7 @@
                   :scale => 0,
                   :level => 2,
                   :has_default => 0,
+                  :has_default? => false,
                   :iomode => :out,
                   :radix => 10,
                   :type_name => "",



More information about the ruby-oci8-commit mailing list