Skip to content

Commit

Permalink
* lib/hpricot/elements.rb: use contents to get all of the innards …
Browse files Browse the repository at this point in the history
…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
why committed Aug 11, 2006
1 parent 2ff00ef commit ea90340
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extras/mingw-rbconfig.rb
Expand Up @@ -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"
Expand Down
14 changes: 8 additions & 6 deletions lib/hpricot/elements.rb
Expand Up @@ -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)
Expand Down

0 comments on commit ea90340

Please sign in to comment.