lib/tkxml.rb in tkxml-0.3.0 vs lib/tkxml.rb in tkxml-0.3.1

- old
+ new

@@ -1,37 +1,19 @@ -# TkXML (2.04a) -# Copyright 2002 Thomas Sawyer (transami@runbox.com) -# April 2002 Alpha - require 'tk' -# A combination of Ruby/Tk + REXML to allow for fast and easy creation of Tk -# interfaces using standard XML +# A combination of Ruby, Tcl/Tk and Nokogiri or REXML to allow for fast and +# easy creation of Tk interfaces using standard XML. # -# xml_file = File.open("ui.xml") -# tkxml_instance = TkXML.new(xml_file) +# xml = File.open("ui.xml") +# tkxml_instance = TkXML.new(xml) # tkxml_instance.build # class TkXML - # Access to project metadata. - def self.metadata - @metadata ||= ( - require 'yaml' - YAML.load(File.new(File.dirname(__FILE__) + '/tkxml.yml')) - ) - end + # Current version of TkXML. + VERSION = '0.3.1' # :erb: VERSION = '<%= version %>' - # Access metadata as constants. - def self.const_missing(name) - key = name.to_s.downcase - metadata[key] || super(name) - end - - # TODO: here only b/c Ruby 1.8.x is broke - VERSION = metadata['version'] - # def initialize(source, type=:nokogiri) @widget = {} @widget_stack = [] @parent = nil @@ -146,11 +128,11 @@ # def end_method(name) puts "End Method: #{name}" end - private +private # Looks like the attributes object given is nothing more then # a array in an array. how lame! This wll turn it into a hash. def assoc_to_hash(array) return array if Hash === array @@ -161,5 +143,6 @@ hash end end +# Copyright 2002 Rubyworks