Permalink
Browse files

* lib/hpricot/elements.rb: use `contents` to get all of the innards …

…for the selected elements. also, contents can take an array, to replace several innards.

 * extras/mingw-rbconfig.rb: use MINGW32_PREFIX.


git-svn-id: https://code.whytheluckystiff.net/svn/hpricot/trunk@33 9e82565c-fa0a-db11-9fa0-00132028b6dc
  • Loading branch information...
1 parent 2ff00ef commit ea90340b3220777e64cbd41e5811299276a03436 why committed Aug 11, 2006
Showing with 9 additions and 7 deletions.
  1. +1 −1 extras/mingw-rbconfig.rb
  2. +8 −6 lib/hpricot/elements.rb
View
@@ -17,7 +17,7 @@ module Config
CONFIG = {}
CONFIG["DESTDIR"] = DESTDIR
CONFIG["INSTALL"] = "/usr/bin/install -c"
- CONFIG["prefix"] = (TOPDIR || DESTDIR + ENV['MINGW32'])
+ CONFIG["prefix"] = (TOPDIR || DESTDIR + mingw32)
CONFIG["EXEEXT"] = ".exe"
CONFIG["ruby_install_name"] = "ruby"
CONFIG["RUBY_INSTALL_NAME"] = "ruby"
View
@@ -10,18 +10,20 @@ def to_html
end
alias_method :to_s, :to_html
- def html(str = nil)
- if str
- self.html = str
- else
+ def contents(*str)
+ if str.empty?
map { |x| x.innerHTML }.join
+ else
+ x = self.contents = str.pop || x
end
end
- alias_method :text, :html
+ alias_method :text, :contents
+ alias_method :html, :contents
- def html=(str)
+ def contents=(str)
each { |x| x.innerHTML = str }
end
+ alias_method :html=, :contents=
def filter(expr)
nodes, = Elements.filter(self, expr)

0 comments on commit ea90340

Please sign in to comment.