jakal 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,8 +4,9 @@ require 'hpricot'
4
4
  module Jkl
5
5
  class << self
6
6
 
7
- def post_to(uri, post_args)
7
+ def post_to(url, post_args = {})
8
8
  begin
9
+ uri = URI.parse(url)
9
10
  resp, data = Net::HTTP.post_form(uri, post_args)
10
11
  data
11
12
  rescue URI::InvalidURIError => e
@@ -41,7 +41,6 @@ class JklTest < Test::Unit::TestCase
41
41
  EOF
42
42
  tags = Jkl::Extraction::tags(key, text)
43
43
  assert tags["Person"][0] == "Barack Obama"
44
- puts Jkl::Extraction::entities(key,text)
45
44
  end
46
45
  end
47
46
 
@@ -66,15 +65,11 @@ class JklTest < Test::Unit::TestCase
66
65
  end
67
66
  def stub_topix
68
67
  url = YAML::load_file('config/config.yml')['topix']
69
- response = raw = File.open('test/fixtures/topix_rss.xml','r') do |file|
70
- file.readlines.to_s
71
- end
68
+ response = File.read('test/fixtures/topix_rss.xml')
72
69
  stub_request(:get, "#{url}London").to_return(:body => response)
73
70
  end
74
71
  def stub_news_article
75
- response = raw = File.open('test/fixtures/bbc_story.html','r') do |file|
76
- file.readlines.to_s
77
- end
72
+ response = File.read('test/fixtures/bbc_story.html')
78
73
  stub_request(:get, "http://www.localnews8.com/Global/story.asp?S=10876507").to_return(
79
74
  :body => response
80
75
  )
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 7
9
- version: 0.1.7
8
+ - 8
9
+ version: 0.1.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - sshingler
@@ -73,7 +73,7 @@ dependencies:
73
73
  version: 0.0.9
74
74
  type: :runtime
75
75
  version_requirements: *id004
76
- description: Jakal is a Ruby library which contains some utilities for connecting to internet based APIs and cleaning text.
76
+ description: Jakal is a Ruby library which contains some utilities for tagging content, cleaning text from web pages and working with RSS feeds.
77
77
  email: "'shingler@gmail.com'"
78
78
  executables: []
79
79
 
@@ -124,6 +124,6 @@ rubyforge_project:
124
124
  rubygems_version: 1.3.6
125
125
  signing_key:
126
126
  specification_version: 2
127
- summary: Jakal is a Ruby library which contains some utilities for connecting to internet based APIs and cleaning text.
127
+ summary: Jakal is a Ruby library which contains some utilities for tagging content, cleaning text from web pages and working with RSS feeds.
128
128
  test_files: []
129
129