Changeset 2168c40635a237e84a69b74bb34c24f230052ae9
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r9474da
|
r2168c4
|
|
| 49 | 49 | s.description = "A simple ruby interface to libxml (with hpricot-like syntax)" |
| 50 | 50 | 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" ] |
| 52 | 53 | s.autorequire = short_name |
| 53 | 54 | s.test_files = FileList["{specs}/**/*spec.rb"].to_a |
-
|
r7d973e
|
r2168c4
|
|
| 59 | 59 | |
| 60 | 60 | /* 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 |
| 63 | 63 | } |
| 64 | 64 | |
-
|
r7d973e
|
r2168c4
|
|
| 217 | 217 | } |
| 218 | 218 | |
| | 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 | */ |
| | 225 | VALUE 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 | |
| 219 | 249 | /* Parse an input string/array/stringio object into a FastXml::Doc object. |
| 220 | 250 | * |
-
|
r7945e3
|
r2168c4
|
|
| 1 | 1 | # encoding: utf-8 |
| 2 | | $: << '../ext' |
| 3 | | $: << './ext' |
| | 2 | %w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } |
| 4 | 3 | |
| 5 | 4 | require 'fastxml' |
-
|
rbf5fc0
|
r2168c4
|
|
| 1 | 1 | # encoding: utf-8 |
| 2 | | $: << '../ext' |
| 3 | | $: << './ext' |
| | 2 | %w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } |
| 4 | 3 | |
| 5 | 4 | require 'fastxml' |
-
|
r7d973e
|
r2168c4
|
|
| 1 | 1 | # encoding: utf-8 |
| 2 | | $: << '../ext' |
| 3 | | $: << './ext' |
| | 2 | %w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } |
| 4 | 3 | |
| 5 | 4 | require 'fastxml' |
-
|
r7d973e
|
r2168c4
|
|
| 1 | | $: << '../ext' |
| 2 | | $: << './ext' |
| 3 | 1 | # encoding: utf-8 # :nodoc: |
| | 2 | %w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } |
| 4 | 3 | require 'fastxml' |
| 5 | 4 | |
-
|
r7945e3
|
r2168c4
|
|
| 1 | 1 | # encoding: utf-8 |
| 2 | | $: << '../ext' |
| 3 | | $: << './ext' |
| | 2 | %w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } |
| 4 | 3 | |
| 5 | 4 | require 'fastxml' |
-
|
r7945e3
|
r2168c4
|
|
| 1 | 1 | # encoding: utf-8 |
| 2 | | $: << '../ext' |
| 3 | | $: << './ext' |
| | 2 | %w[ ../ext ./ext ../lib ./lib ].each { |lp| $: << lp } |
| 4 | 3 | |
| 5 | 4 | require 'fastxml' |