Browse files

fixing indentation

  • Loading branch information...
1 parent d554726 commit 7f2b9cf9c121819755c07e33cb771bfe9129484b @tenderlove tenderlove committed Feb 7, 2010
Showing with 64 additions and 64 deletions.
  1. +64 −64 lib/mechanize/page.rb
View
128 lib/mechanize/page.rb
@@ -125,86 +125,86 @@ def #{type}_with(criteria)
end
alias :#{type} :#{type}_with
eomethod
- end
-
- def links
- @links ||= %w{ a area }.map do |tag|
- search(tag).map do |node|
- Link.new(node, @mech, self)
- end
- end.flatten
- end
+ end
- def forms
- @forms ||= search('form').map do |html_form|
- form = Form.new(html_form, @mech, self)
- form.action ||= @uri.to_s
- form
+ def links
+ @links ||= %w{ a area }.map do |tag|
+ search(tag).map do |node|
+ Link.new(node, @mech, self)
end
+ end.flatten
+ end
+
+ def forms
+ @forms ||= search('form').map do |html_form|
+ form = Form.new(html_form, @mech, self)
+ form.action ||= @uri.to_s
+ form
end
+ end
- def meta
- @meta ||= search('head > meta').map do |node|
- next unless node['http-equiv'] && node['content']
- (equiv, content) = node['http-equiv'], node['content']
- if equiv && equiv.downcase == 'refresh'
- Meta.parse(content, uri) do |delay, href|
- node['delay'] = delay
- node['href'] = href
- Meta.new(node, @mech, self)
- end
+ def meta
+ @meta ||= search('head > meta').map do |node|
+ next unless node['http-equiv'] && node['content']
+ (equiv, content) = node['http-equiv'], node['content']
+ if equiv && equiv.downcase == 'refresh'
+ Meta.parse(content, uri) do |delay, href|
+ node['delay'] = delay
+ node['href'] = href
+ Meta.new(node, @mech, self)
end
- end.compact
- end
+ end
+ end.compact
+ end
- def bases
- @bases ||=
- search('base').map { |node| Base.new(node, @mech, self) }
- end
+ def bases
+ @bases ||=
+ search('base').map { |node| Base.new(node, @mech, self) }
+ end
- def frames
- @frames ||=
- search('frame').map { |node| Frame.new(node, @mech, self) }
- end
+ def frames
+ @frames ||=
+ search('frame').map { |node| Frame.new(node, @mech, self) }
+ end
- def iframes
- @iframes ||=
- search('iframe').map { |node| Frame.new(node, @mech, self) }
- end
+ def iframes
+ @iframes ||=
+ search('iframe').map { |node| Frame.new(node, @mech, self) }
+ end
- def images
- @images ||=
- search('img').map { |node| Image.new(node, self) }
- end
+ def images
+ @images ||=
+ search('img').map { |node| Image.new(node, self) }
+ end
- def image_urls
- @image_urls ||= images.map(&:url).uniq
- end
+ def image_urls
+ @image_urls ||= images.map(&:url).uniq
+ end
- def labels
- @labels ||=
- search('label').map { |node| Label.new(node, self) }
- end
+ def labels
+ @labels ||=
+ search('label').map { |node| Label.new(node, self) }
+ end
- def labels_hash
- unless @labels_hash
- hash = {}
- labels.each do |label|
- hash[label.node['for']] = label if label.for
- end
- @labels_hash = hash
+ def labels_hash
+ unless @labels_hash
+ hash = {}
+ labels.each do |label|
+ hash[label.node['for']] = label if label.for
end
- return @labels_hash
+ @labels_hash = hash
end
+ return @labels_hash
+ end
- private
+ private
- def html_body
- if body
- body.length > 0 ? body : '<html></html>'
- else
- ''
- end
+ def html_body
+ if body
+ body.length > 0 ? body : '<html></html>'
+ else
+ ''
end
end
end
+end

0 comments on commit 7f2b9cf

Please sign in to comment.