RubyGems Navigation menu

nokogiri-styles 0.1.0

NokgiriStyles lets you decompose inline CSS styling (the style attribute) in HTML elements so you don’t have to bother with regexes and such. Usage: require 'nokogiri' require 'nokogiri-styles' # ... # Get styles node['style'] # => 'width: 400px; color: blue' node.styles['width'] # => '400px' node.styles['color'] # => 'blue' # Update styles style = node.styles style['width'] = '500px' style['height'] = '300px' style['color'] = nil node.styles = style node['style'] # => 'width: 500xp; height: 300px' # Modify classes node['class'] # => 'foo bar' node.classes # => ['foo', 'bar'] node.classes = ['foo'] node['class'] # => 'foo' Note that the `style` attribute is only updated when assigning `.styles`, simply doing `node.styles['color'] = 'red'` does not work. Patches welcome.

Gemfile:
=

インストール:
=

バージョン履歴:

  1. 0.1.2 July 19, 2012 (6.5KB)
  2. 0.1.1 July 19, 2012 (6.5KB)
  3. 0.1.0 July 19, 2012 (7KB)

Runtime依存関係 (1):

nokogiri >= 0

Development依存関係 (1):

test-unit = 2.4.8

所有者:

作者:

  • Sijmen Mulder

SHA 256チェックサム:

=

累計ダウンロード数 1,409,416

このバージョンのみ 3,086

このバージョンがリリースされたのは:

ライセンス:

N/A

必要なRubyのバージョン: なし

リンク: