hmachine 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/.gitignore +2 -2
  2. data/Gemfile +6 -4
  3. data/Gemfile.lock +51 -0
  4. data/README.md +123 -9
  5. data/Rakefile +12 -3
  6. data/bin/hmachine +99 -0
  7. data/hmachine.gemspec +132 -0
  8. data/lib/hmachine.rb +121 -12
  9. data/lib/hmachine/microformat.rb +39 -20
  10. data/lib/hmachine/microformat/adr.rb +22 -0
  11. data/lib/hmachine/microformat/geo.rb +48 -0
  12. data/lib/hmachine/microformat/hcard.rb +169 -11
  13. data/lib/hmachine/microformat/rellicense.rb +20 -0
  14. data/lib/hmachine/microformat/reltag.rb +38 -0
  15. data/lib/hmachine/microformat/votelinks.rb +42 -0
  16. data/lib/hmachine/microformat/xfn.rb +54 -0
  17. data/lib/hmachine/microformat/xmdp.rb +14 -0
  18. data/lib/hmachine/microformat/xoxo.rb +69 -0
  19. data/lib/hmachine/pattern.rb +26 -0
  20. data/lib/hmachine/pattern/abbr.rb +21 -0
  21. data/lib/hmachine/pattern/datetime.rb +75 -0
  22. data/lib/hmachine/pattern/typevalue.rb +32 -0
  23. data/lib/hmachine/pattern/url.rb +32 -0
  24. data/lib/hmachine/pattern/valueclass.rb +51 -0
  25. data/lib/hmachine/posh.rb +3 -0
  26. data/lib/hmachine/posh/anchor.rb +40 -0
  27. data/lib/hmachine/posh/base.rb +204 -0
  28. data/lib/hmachine/posh/definition_list.rb +41 -0
  29. data/test/fixtures/huffduffer.html +466 -0
  30. data/test/fixtures/likeorhate.html +48 -0
  31. data/test/fixtures/rel_license.html +4 -0
  32. data/test/fixtures/test-fixture/hcard/hcard1.html +147 -0
  33. data/test/fixtures/test-fixture/hcard/hcard11.html +123 -0
  34. data/test/fixtures/test-fixture/hcard/hcard12.html +178 -0
  35. data/test/fixtures/test-fixture/hcard/hcard17.html +165 -0
  36. data/test/fixtures/test-fixture/hcard/hcard2.html +264 -0
  37. data/test/fixtures/test-fixture/hcard/hcard3.html +144 -0
  38. data/test/fixtures/test-fixture/hcard/hcard4.html +117 -0
  39. data/test/fixtures/test-fixture/hcard/hcard5.html +119 -0
  40. data/test/fixtures/test-fixture/hcard/hcard6.html +188 -0
  41. data/test/fixtures/test-fixture/hcard/hcard7.html +188 -0
  42. data/test/fixtures/test-fixture/hcard/hcard8.html +130 -0
  43. data/test/fixtures/test-fixture/hcard/hcard9.html +111 -0
  44. data/test/fixtures/test-fixture/hcard/hcard99.html +215 -0
  45. data/test/fixtures/test-fixture/value-class-date-time/value-dt-test-YYYY-MM-DD--HH-MM.html +9 -0
  46. data/test/fixtures/test-fixture/value-class-date-time/value-dt-test-abbr-YYYY-MM-DD--HH-MM.html +4 -0
  47. data/test/fixtures/xfn.html +198 -0
  48. data/test/fixtures/xmdp.html +32 -0
  49. data/test/fixtures/xoxo.html +51 -0
  50. data/test/hmachine_test.rb +122 -6
  51. data/test/microformat/adr_test.rb +47 -0
  52. data/test/microformat/geo_test.rb +66 -0
  53. data/test/microformat/hcard_test.rb +487 -20
  54. data/test/microformat/rellicense_test.rb +36 -0
  55. data/test/microformat/reltag_test.rb +61 -0
  56. data/test/microformat/votelinks_test.rb +44 -0
  57. data/test/microformat/xfn_test.rb +28 -0
  58. data/test/microformat/xmdp_test.rb +16 -0
  59. data/test/microformat/xoxo_test.rb +51 -0
  60. data/test/microformat_test.rb +12 -34
  61. data/test/pattern/date_time_test.rb +55 -0
  62. data/test/pattern/value_class_test.rb +33 -0
  63. data/test/pattern_test.rb +132 -0
  64. data/test/posh/anchor_test.rb +41 -0
  65. data/test/posh/base_test.rb +150 -0
  66. data/test/posh/definition_list_test.rb +38 -0
  67. data/test/test_helper.rb +24 -6
  68. metadata +93 -15
  69. data/lib/hmachine/microformat/base.rb +0 -17
data/.gitignore CHANGED
@@ -1,3 +1,3 @@
1
- vendor/
2
1
  pkg/
3
- doc/
2
+ doc/
3
+ .bundle/
data/Gemfile CHANGED
@@ -1,9 +1,11 @@
1
+ source :gemcutter
2
+
1
3
  gem 'nokogiri'
2
4
 
3
- only :test do
5
+ group :test do
4
6
  gem 'rake'
5
7
  gem 'contest'
6
8
  gem 'redgreen'
7
- end
8
-
9
- bin_path 'vendor/bin'
9
+ gem 'fakeweb'
10
+ gem 'jeweler'
11
+ end
@@ -0,0 +1,51 @@
1
+ ---
2
+ dependencies:
3
+ fakeweb:
4
+ group:
5
+ - :test
6
+ version: ">= 0"
7
+ rake:
8
+ group:
9
+ - :test
10
+ version: ">= 0"
11
+ contest:
12
+ group:
13
+ - :test
14
+ version: ">= 0"
15
+ jeweler:
16
+ group:
17
+ - :test
18
+ version: ">= 0"
19
+ redgreen:
20
+ group:
21
+ - :test
22
+ version: ">= 0"
23
+ nokogiri:
24
+ group:
25
+ - :default
26
+ version: ">= 0"
27
+ specs:
28
+ - nokogiri:
29
+ version: 1.4.1
30
+ - json_pure:
31
+ version: 1.2.0
32
+ - git:
33
+ version: 1.2.5
34
+ - redgreen:
35
+ version: 1.2.2
36
+ - rubyforge:
37
+ version: 2.0.3
38
+ - rake:
39
+ version: 0.8.7
40
+ - gemcutter:
41
+ version: 0.3.0
42
+ - jeweler:
43
+ version: 1.4.0
44
+ - contest:
45
+ version: 0.1.2
46
+ - fakeweb:
47
+ version: 1.2.8
48
+ hash: a411a98d29121a4b1d05b9fbe457c6e068325a09
49
+ sources:
50
+ - Rubygems:
51
+ uri: http://gemcutter.org
data/README.md CHANGED
@@ -1,20 +1,134 @@
1
1
  # hMachine
2
2
 
3
- **Ruby microformat parser**
3
+ **Ruby microformat parser and HTML toolkit**
4
4
 
5
- ## Warning
5
+ [RDoc](http://rdoc.info/projects/mwunsch/hmachine) | [Gem](http://rubygems.org/gems/hmachine) | [Metrics](http://getcaliper.com/caliper/project?repo=git%3A%2F%2Fgithub.com%2Fmwunsch%2Fhmachine.git)
6
6
 
7
- This is so little right now. It's not even close to being done. Don't touch it until it has at least a minor version number (Right now it is v0.0.1). You've been warned.
7
+ ## What hMachine is:
8
8
 
9
- It should be:
9
+ + A robust microformat parser
10
+ + A command-line tool for parsing microformats from a url or a string of markup
11
+ + A DSL for defining semantic markup patterns
12
+ + Export microformats to other standards:
13
+ + hCard => vCard
10
14
 
11
- + A fully featured microformat parser, with support for every microformat
12
- + A CLI for fetching microformats from a url or a string of html
15
+ It is your [lowercase semantic web](http://tantek.com/presentations/2004etech/realworldsemanticspres.html) friend.
16
+
17
+ >Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards. Instead of throwing away what works today, microformats intend to solve simpler problems first by adapting to current behaviors and usage patterns (e.g. XHTML, blogging).
18
+
19
+ Learn more about Microformats at http://microformats.org.
20
+
21
+ ## Usage
22
+
23
+ The command line tool takes a SOURCE from the Standard Input or as an argument:
24
+
25
+ $: curl http://markwunsch.com | hmachine --hcard > ~/Desktop/me.vcf
26
+
27
+ OR
28
+
29
+ $: hmachine --hcard http://markwunsch.com > ~/Desktop/me.vcf
30
+
31
+ ## Installation
32
+
33
+ With Ruby and Rubygems:
34
+
35
+ gem install hmachine
36
+
37
+ Or clone the repository and run `bundle install` to get the development dependencies.
38
+
39
+ #### Requirements:
40
+
41
+ + [Nokogiri](http://github.com/tenderlove/nokogiri)
42
+
43
+ ## Microformats supported (right now, as of this very moment)
44
+
45
+ + [rel-tag](http://microformats.org/wiki/rel-tag)
46
+ + [rel-license](http://microformats.org/wiki/rel-license)
47
+ + [VoteLinks](http://microformats.org/wiki/vote-links)
48
+ + [XFN](http://microformats.org/wiki/XFN)
49
+ + [XOXO](http://microformats.org/wiki/xoxo)
50
+ + [XMDP](http://microformats.org/wiki/XMDP)
51
+ + [geo](http://microformats.org/wiki/geo)
52
+ + [adr](http://microformats.org/wiki/adr)
53
+ + [hCard](http://microformats.org/wiki/hcard)
54
+
55
+ More on the way.
56
+
57
+ ## Finding Microformats:
58
+
59
+ # All microformats
60
+ HMachine.find 'http://foobar.com'
61
+
62
+ # A specific microformat
63
+ HMachine.find 'http://foobar.com', :hcard
64
+
65
+ # Search HTML too
66
+ HMachine.find big_string_of_html
67
+
68
+ ### Parsing Microformats:
69
+
70
+ twitter_contacts = HMachine.find 'http://twitter.com/markwunsch', :hcard
71
+ me = twitter_contacts.first
72
+ me.fn
73
+ #=> "Mark Wunsch"
74
+ me.n.family_name
75
+ #=> "Wunsch"
76
+ me.url
77
+ #=> "http://markwunsch.com/"
78
+ File.open('mark.vcf','w') {|f| f.write me.to_vcard }
79
+ ## Add me to your address book!
80
+
81
+ ## POSH DSL
82
+
83
+ The `HMachine` module defines a group of methods to search, validate, and extract nodes out of a Nokogiri document.
84
+
85
+ All microformats inherit from `HMachine::POSH::Base`, because all microformats begin as [POSH formats](http://microformats.org/wiki/posh). If you wanted to create your own POSH format, you'd do something like this:
86
+
87
+ class Navigation < HMachine::POSH::Base
88
+ search {|document| document.css('ul#navigation') }
89
+ # Search a Nokogiri document for nodes of a certain type
90
+
91
+ validate {|node| node.matches?('ul#navigation') }
92
+ # Validate that a node is the right element we want
93
+
94
+ has_many :items do
95
+ search {|doc| doc.css('li') }
96
+ end
97
+ # has_many and has_one define Properties of the POSH format (HMachine::Property)
98
+ # Each Property object includes the HMachine module, so they can search, validate, and extract
99
+ end
100
+
101
+ Now you can do:
102
+
103
+ nav = Navigation.parse_first(document)
104
+ # document is a Nokogiri document.
105
+ # parse_first extracts just the first example of the format out of the document
106
+
107
+ nav.items
108
+ # Returns an array of contents
109
+ # This method comes from the has_many call up above that defines the Property
110
+
111
+ ## Other Microformat parsers
112
+
113
+ + [Mofo](http://mofo.rubyforge.org/) is a Ruby microformat parser backed by Hpricot.
114
+ + [Sumo](http://www.danwebb.net/2007/2/9/sumo-a-generic-microformats-parser-for-javascript) is a JavaScript microformat parser.
115
+ + [Operator](https://addons.mozilla.org/en-US/firefox/addon/4106) is a Firefox extension.
116
+ + [hKit](http://code.google.com/p/hkit/) is a microformat parser for PHP.
117
+ + [Oomph](http://visitmix.com/labs/oomph/) is a microformat toolkit add-in for Internet Explorer.
118
+
119
+ ## Feature wishlist:
120
+
121
+ + HTML outliner (using HTML5 sectioning)
13
122
  + Extensions so you can do something like: `String.is_a_valid? :hcard` in your tests
14
- + Export microformats to other standards. hCard => vCard.
15
- + HTML outlininer (using HTML5 sectioning)
123
+ + Extensions to turn Ruby objects into semantic HTML. Hash.to_definition_list, Array.to_ordered_list, etc.
124
+
125
+ ## TODO:
16
126
 
17
- Maybe some more than just that. It should be your lowercase-semantic-web friend.
127
+ + Handle nested microformats better (I like HMachine::Pattern::ValueClass's search implementation the best)
128
+ + Code is ugly. Especially XOXO.
129
+ + Better recursive parsing of trees. See above.
130
+ + Tests are all kinds of disorganized.
131
+ + Broader support for some of the weirder Patterns, like object[data]
18
132
 
19
133
  ## License
20
134
 
data/Rakefile CHANGED
@@ -1,6 +1,15 @@
1
+ begin
2
+ # Try to require the preresolved locked set of gems.
3
+ require File.expand_path('../.bundle/environment', __FILE__)
4
+ rescue LoadError
5
+ # Fall back on doing an unlocked resolve at runtime.
6
+ require "rubygems"
7
+ require "bundler"
8
+ Bundler.setup
9
+ end
10
+
1
11
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib')
2
12
  require 'hmachine'
3
-
4
13
  require 'rake'
5
14
 
6
15
  task :default => :test
@@ -16,8 +25,8 @@ begin
16
25
  require 'jeweler'
17
26
  Jeweler::Tasks.new do |gemspec|
18
27
  gemspec.name = "hmachine"
19
- gemspec.summary = "Ruby microformat parser"
20
- gemspec.description = "A Ruby microformat parser powered by Nokogiri"
28
+ gemspec.summary = "Ruby microformat parser and HTML toolkit"
29
+ gemspec.description = "A Ruby microformat parser and HTML toolkit powered by Nokogiri"
21
30
  gemspec.version = HMachine::VERSION
22
31
  gemspec.homepage = "http://github.com/mwunsch/hmachine"
23
32
  gemspec.authors = ["Mark Wunsch"]
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env ruby
2
+ ## hMachine: Microformat parser and HTML toolkit.
3
+ ##
4
+ ## Usage: hmachine [ OPTION ] [ SOURCE ]
5
+ ##
6
+ ## Find the Microformats in the given SOURCE. SOURCE can be a URL
7
+ ## or a string of HTML. If no Microformat is specified in UFORMAT,
8
+ ## hmachine will just print a list of what has been found.
9
+ ##
10
+ ## If a Microformat is specified, hmachine will convert it into a
11
+ ## more suitable format. eg. hCard becomes a vCard.
12
+ ##
13
+ ## If no SOURCE is given, hmachine will read from the Standard Input.
14
+ ##
15
+ ## Microformats:
16
+ ## --vcard, --hcard hCard => vCard converter
17
+ ## --xfn Get XFN URLs
18
+ ##
19
+ ## Other Options:
20
+ ## -h, --help show this help message
21
+ ## -v, --version version of hMachine
22
+ ##
23
+ ## Learn more about Microformats at http://microformats.org
24
+ ##
25
+ ##
26
+
27
+ require 'optparse'
28
+
29
+ def usage
30
+ File.readlines(__FILE__).
31
+ grep(/^##.*/).
32
+ map { |line| line.chomp[3..-1] }.
33
+ join("\n")
34
+ end
35
+
36
+ begin
37
+ require 'hmachine'
38
+ rescue LoadError
39
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
40
+ require 'hmachine'
41
+ end
42
+
43
+ options = {}
44
+ ARGV.options do |option|
45
+ option.banner = "Hi."
46
+ option.on('--hcard','--vcard') { options[:vcard] = true }
47
+ option.on('--xfn') { options[:xfn] = true }
48
+ option.on_tail('-h','--help') { puts usage ; exit }
49
+ option.on_tail('-v','--version') { puts HMachine::VERSION ; exit }
50
+ option.parse!
51
+ end
52
+
53
+ if ARGV.empty? && STDIN.tty?
54
+ puts usage
55
+ exit
56
+ end
57
+
58
+ def uformat_counts(group)
59
+ uf_count = HMachine::Microformat.microformats.values.collect do |uformat|
60
+ name = "#{uformat::FRIENDLY_NAME}"
61
+ found = group.select {|format| format.is_a?(uformat) }.count
62
+ if found > 0
63
+ name += "s" if found > 1
64
+ "Found #{found} #{name} in the document. Read more at: #{uformat::WIKI_URL}"
65
+ end
66
+ end.compact
67
+ if !uf_count.empty?
68
+ uf_count
69
+ else
70
+ puts "No microformats found in this document." ; exit
71
+ end
72
+ end
73
+
74
+ def parse_microformats(doc, type)
75
+ uformats = HMachine.find(doc, type)
76
+ if uformats
77
+ if uformats.respond_to?(:length)
78
+ uformats.each {|uf| yield uf if block_given? }
79
+ else
80
+ yield uformats if block_given?
81
+ end
82
+ else
83
+ puts "No #{type}s found in this document."
84
+ end
85
+ end
86
+
87
+ def input
88
+ ARGV.first ? ARGV.first : STDIN.read
89
+ end
90
+
91
+ if options.empty?
92
+ uformat_counts(HMachine.find(input)).each {|count| puts count }
93
+ else
94
+ if options[:vcard]
95
+ parse_microformats(input, :hcard) {|hcard| puts hcard.to_vcard }
96
+ elsif options[:xfn]
97
+ parse_microformats(input, :xfn) {|xfn| puts xfn.url }
98
+ end
99
+ end
@@ -0,0 +1,132 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{hmachine}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Mark Wunsch"]
12
+ s.date = %q{2010-02-24}
13
+ s.default_executable = %q{hmachine}
14
+ s.description = %q{A Ruby microformat parser and HTML toolkit powered by Nokogiri}
15
+ s.email = ["mark@markwunsch.com"]
16
+ s.executables = ["hmachine"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.md"
20
+ ]
21
+ s.files = [
22
+ ".gitignore",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE",
26
+ "README.md",
27
+ "Rakefile",
28
+ "bin/hmachine",
29
+ "hmachine.gemspec",
30
+ "lib/hmachine.rb",
31
+ "lib/hmachine/microformat.rb",
32
+ "lib/hmachine/microformat/adr.rb",
33
+ "lib/hmachine/microformat/geo.rb",
34
+ "lib/hmachine/microformat/hcard.rb",
35
+ "lib/hmachine/microformat/rellicense.rb",
36
+ "lib/hmachine/microformat/reltag.rb",
37
+ "lib/hmachine/microformat/votelinks.rb",
38
+ "lib/hmachine/microformat/xfn.rb",
39
+ "lib/hmachine/microformat/xmdp.rb",
40
+ "lib/hmachine/microformat/xoxo.rb",
41
+ "lib/hmachine/pattern.rb",
42
+ "lib/hmachine/pattern/abbr.rb",
43
+ "lib/hmachine/pattern/datetime.rb",
44
+ "lib/hmachine/pattern/typevalue.rb",
45
+ "lib/hmachine/pattern/url.rb",
46
+ "lib/hmachine/pattern/valueclass.rb",
47
+ "lib/hmachine/posh.rb",
48
+ "lib/hmachine/posh/anchor.rb",
49
+ "lib/hmachine/posh/base.rb",
50
+ "lib/hmachine/posh/definition_list.rb",
51
+ "test/fixtures/hcard/commercenet.html",
52
+ "test/fixtures/hcard/geo.html",
53
+ "test/fixtures/huffduffer.html",
54
+ "test/fixtures/likeorhate.html",
55
+ "test/fixtures/rel_license.html",
56
+ "test/fixtures/test-fixture/hcard/hcard1.html",
57
+ "test/fixtures/test-fixture/hcard/hcard11.html",
58
+ "test/fixtures/test-fixture/hcard/hcard12.html",
59
+ "test/fixtures/test-fixture/hcard/hcard17.html",
60
+ "test/fixtures/test-fixture/hcard/hcard2.html",
61
+ "test/fixtures/test-fixture/hcard/hcard3.html",
62
+ "test/fixtures/test-fixture/hcard/hcard4.html",
63
+ "test/fixtures/test-fixture/hcard/hcard5.html",
64
+ "test/fixtures/test-fixture/hcard/hcard6.html",
65
+ "test/fixtures/test-fixture/hcard/hcard7.html",
66
+ "test/fixtures/test-fixture/hcard/hcard8.html",
67
+ "test/fixtures/test-fixture/hcard/hcard9.html",
68
+ "test/fixtures/test-fixture/hcard/hcard99.html",
69
+ "test/fixtures/test-fixture/value-class-date-time/value-dt-test-YYYY-MM-DD--HH-MM.html",
70
+ "test/fixtures/test-fixture/value-class-date-time/value-dt-test-abbr-YYYY-MM-DD--HH-MM.html",
71
+ "test/fixtures/xfn.html",
72
+ "test/fixtures/xmdp.html",
73
+ "test/fixtures/xoxo.html",
74
+ "test/hmachine_test.rb",
75
+ "test/microformat/adr_test.rb",
76
+ "test/microformat/geo_test.rb",
77
+ "test/microformat/hcard_test.rb",
78
+ "test/microformat/rellicense_test.rb",
79
+ "test/microformat/reltag_test.rb",
80
+ "test/microformat/votelinks_test.rb",
81
+ "test/microformat/xfn_test.rb",
82
+ "test/microformat/xmdp_test.rb",
83
+ "test/microformat/xoxo_test.rb",
84
+ "test/microformat_test.rb",
85
+ "test/pattern/date_time_test.rb",
86
+ "test/pattern/value_class_test.rb",
87
+ "test/pattern_test.rb",
88
+ "test/posh/anchor_test.rb",
89
+ "test/posh/base_test.rb",
90
+ "test/posh/definition_list_test.rb",
91
+ "test/test_helper.rb"
92
+ ]
93
+ s.homepage = %q{http://github.com/mwunsch/hmachine}
94
+ s.rdoc_options = ["--charset=UTF-8"]
95
+ s.require_paths = ["lib"]
96
+ s.rubygems_version = %q{1.3.6}
97
+ s.summary = %q{Ruby microformat parser and HTML toolkit}
98
+ s.test_files = [
99
+ "test/hmachine_test.rb",
100
+ "test/microformat/adr_test.rb",
101
+ "test/microformat/geo_test.rb",
102
+ "test/microformat/hcard_test.rb",
103
+ "test/microformat/rellicense_test.rb",
104
+ "test/microformat/reltag_test.rb",
105
+ "test/microformat/votelinks_test.rb",
106
+ "test/microformat/xfn_test.rb",
107
+ "test/microformat/xmdp_test.rb",
108
+ "test/microformat/xoxo_test.rb",
109
+ "test/microformat_test.rb",
110
+ "test/pattern/date_time_test.rb",
111
+ "test/pattern/value_class_test.rb",
112
+ "test/pattern_test.rb",
113
+ "test/posh/anchor_test.rb",
114
+ "test/posh/base_test.rb",
115
+ "test/posh/definition_list_test.rb",
116
+ "test/test_helper.rb"
117
+ ]
118
+
119
+ if s.respond_to? :specification_version then
120
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
121
+ s.specification_version = 3
122
+
123
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
124
+ s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
125
+ else
126
+ s.add_dependency(%q<nokogiri>, [">= 0"])
127
+ end
128
+ else
129
+ s.add_dependency(%q<nokogiri>, [">= 0"])
130
+ end
131
+ end
132
+