Changeset 2168c40635a237e84a69b74bb34c24f230052ae9

Show
Ignore:
Timestamp:
08/30/08 00:14:25 (4 months ago)
Author:
Mark Guzman <segfault@…>
Parents:
9474da7584bfc0373ae26f41223d824bbcce3baa
Children:
5f7de15c00f6f991e77caf8bd30ac9eda203035a
git-committer:
Mark Guzman <segfault@hasno.info> / 2008-08-30T00:14:25Z-0400
Message:

finally loading properly as a gem

Files:
9 modified
2 moved

Legend:

Unmodified
Added
Removed
  • Rakefile

    r9474da r2168c4  
    4949  s.description = "A simple ruby interface to libxml (with hpricot-like syntax)" 
    5050  s.files = FileList["{bin,lib,ext,test_data}/**/*"].to_a 
    51   s.require_path = %w[ ext lib ] 
     51  s.require_paths = %w[ ext lib ] 
     52  s.extensions = [ "ext/extconf.rb" ] 
    5253  s.autorequire = short_name 
    5354  s.test_files = FileList["{specs}/**/*spec.rb"].to_a 
  • ext/fastxml.c

    r7d973e r2168c4  
    5959         
    6060        /* pull in the ruby side of things */ 
    61         rb_require( "lib/fastxml_lib" );      // ruby-side methods for the FastXml classes 
    62         rb_require( "lib/fastxml_helpers" );  // FastXml and FastHtml methods 
     61        rb_require( "fastxml/fastxml_lib" );      // ruby-side methods for the FastXml classes 
     62        rb_require( "fastxml/fastxml_helpers" );  // FastXml and FastHtml methods 
    6363} 
    6464 
  • ext/fastxml_doc.c

    r7d973e r2168c4  
    217217} 
    218218 
     219/* Returns the FastXml::Node object representing the root element of 
     220 * the target document 
     221 * 
     222 * call-seq: 
     223 *   puts doc.root.name 
     224 */ 
     225VALUE fastxml_doc_root_set(VALUE self, VALUE newroot) 
     226{ 
     227    VALUE dv, odv; 
     228    fxml_data_t *data, *node_data; 
     229    xmlNodePtr root, new_root; 
     230 
     231    dv = rb_iv_get( self, "@lxml_doc" ); 
     232    Data_Get_Struct( dv, fxml_data_t, data ); 
     233 
     234        odv = rb_iv_get( self, "@lxml_doc" ); 
     235        Data_Get_Struct( odv, fxml_data_t, node_data ); 
     236 
     237    root = xmlDocGetRootElement( data->doc ); 
     238         
     239        if (rb_obj_is_kind_of(newroot, rb_cFastXmlNode) == Qfalse && rb_obj_is_kind_of(newroot, rb_cString) == Qfalse) 
     240          rb_raise(rb_eTypeError, "must pass a FastXml::Node or String type object"); 
     241 
     242        new_root = xmlDocSetRootElement( data->doc, node_data->node ); 
     243        if (new_root == NULL) 
     244          return Qnil; 
     245         
     246        return newroot; 
     247} 
     248 
    219249/* Parse an input string/array/stringio object into a FastXml::Doc object. 
    220250 *  
  • specs/basic_html_spec.rb

    r7945e3 r2168c4  
    11# encoding: utf-8 
    2 $: << '../ext' 
    3 $: << './ext' 
     2%w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } 
    43 
    54require 'fastxml' 
  • specs/basic_parsing_spec.rb

    rbf5fc0 r2168c4  
    11# encoding: utf-8 
    2 $: << '../ext' 
    3 $: << './ext' 
     2%w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } 
    43 
    54require 'fastxml' 
  • specs/fastxml_doc_spec.rb

    r7d973e r2168c4  
    11# encoding: utf-8 
    2 $: << '../ext' 
    3 $: << './ext' 
     2%w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } 
    43 
    54require 'fastxml' 
  • specs/fastxml_node_attribute_spec.rb

    r7d973e r2168c4  
    1 $: << '../ext' 
    2 $: << './ext' 
    31# encoding: utf-8 # :nodoc: 
     2%w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } 
    43require 'fastxml' 
    54 
  • specs/fastxml_node_spec.rb

    r7945e3 r2168c4  
    11# encoding: utf-8 
    2 $: << '../ext' 
    3 $: << './ext' 
     2%w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } 
    43 
    54require 'fastxml' 
  • specs/fastxml_nodelist_spec.rb

    r7945e3 r2168c4  
    11# encoding: utf-8 
    2 $: << '../ext' 
    3 $: << './ext' 
     2%w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } 
    43 
    54require 'fastxml'