calais 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.markdown CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changes
2
2
 
3
+ ## 0.0.11
4
+
5
+ * simple fix for some rubies not liking DateTime.parse without including date
6
+ * tests for SocialTags
7
+ * typo fix: SocailTag != SocialTag
8
+
3
9
  ## 0.0.10
4
10
 
5
11
  * community patch to expose SocialTags
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 10
5
4
  :build:
5
+ :patch: 11
data/lib/calais.rb CHANGED
@@ -3,6 +3,7 @@ require 'net/http'
3
3
  require 'cgi'
4
4
  require 'iconv'
5
5
  require 'set'
6
+ require 'date'
6
7
 
7
8
  require 'rubygems'
8
9
  require 'nokogiri'
@@ -45,7 +45,7 @@ module Calais
45
45
  attr_accessor :name, :score
46
46
  end
47
47
 
48
- class SocailTag
48
+ class SocialTag
49
49
  attr_accessor :name, :importance
50
50
  end
51
51
 
@@ -111,7 +111,7 @@ module Calais
111
111
  end
112
112
 
113
113
  @socialtags = doc.root.xpath("rdf:Description/c:socialtag/..").map do |node|
114
- tag = SocailTag.new
114
+ tag = SocialTag.new
115
115
  tag.name = node.xpath("c:name[1]").first.content
116
116
  tag.importance = node.xpath("c:importance[1]").first.content.to_i
117
117
 
@@ -69,6 +69,15 @@ describe Calais::Response, :new do
69
69
  response.categories.map {|c| c.score }.should == [nil]
70
70
  end
71
71
 
72
+ it 'should find social tags' do
73
+ @response.socialtags.map {|c| c.name }.sort.should == ["Appropriate technology", "Bicycles", "Business_Finance", "Cycling", "Motorized bicycle", "Recreation", "Sustainability", "Sustainable transport", "Technology_Internet"]
74
+ end
75
+
76
+ it 'should have important scores associated with social tags' do
77
+ @response.socialtags.map {|c| c.importance.should be_a_kind_of(Integer) }
78
+ end
79
+
80
+
72
81
  it 'should find instances for each entity' do
73
82
  @response.entities.each {|e|
74
83
  e.instances.size.should > 0
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calais
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ hash: 9
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 11
10
+ version: 0.0.11
5
11
  platform: ruby
6
12
  authors:
7
13
  - Abhay Kumar
@@ -9,39 +15,57 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-07-21 00:00:00 -07:00
18
+ date: 2010-08-02 00:00:00 -07:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: nokogiri
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 29
30
+ segments:
31
+ - 1
32
+ - 3
33
+ - 3
23
34
  version: 1.3.3
24
- version:
35
+ type: :runtime
36
+ version_requirements: *id001
25
37
  - !ruby/object:Gem::Dependency
26
38
  name: json
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
30
42
  requirements:
31
43
  - - ">="
32
44
  - !ruby/object:Gem::Version
45
+ hash: 21
46
+ segments:
47
+ - 1
48
+ - 1
49
+ - 3
33
50
  version: 1.1.3
34
- version:
51
+ type: :runtime
52
+ version_requirements: *id002
35
53
  - !ruby/object:Gem::Dependency
36
54
  name: curb
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
40
58
  requirements:
41
59
  - - ">="
42
60
  - !ruby/object:Gem::Version
61
+ hash: 19
62
+ segments:
63
+ - 0
64
+ - 1
65
+ - 4
43
66
  version: 0.1.4
44
- version:
67
+ type: :runtime
68
+ version_requirements: *id003
45
69
  description: A Ruby interface to the Calais Web Service
46
70
  email: info@opensynapse.net
47
71
  executables: []
@@ -61,6 +85,9 @@ files:
61
85
  - lib/calais/client.rb
62
86
  - lib/calais/error.rb
63
87
  - lib/calais/response.rb
88
+ - spec/calais/client_spec.rb
89
+ - spec/calais/response_spec.rb
90
+ - spec/helper.rb
64
91
  has_rdoc: true
65
92
  homepage: http://github.com/abhay/calais
66
93
  licenses: []
@@ -71,21 +98,27 @@ rdoc_options:
71
98
  require_paths:
72
99
  - lib
73
100
  required_ruby_version: !ruby/object:Gem::Requirement
101
+ none: false
74
102
  requirements:
75
103
  - - ">="
76
104
  - !ruby/object:Gem::Version
105
+ hash: 3
106
+ segments:
107
+ - 0
77
108
  version: "0"
78
- version:
79
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
+ none: false
80
111
  requirements:
81
112
  - - ">="
82
113
  - !ruby/object:Gem::Version
114
+ hash: 3
115
+ segments:
116
+ - 0
83
117
  version: "0"
84
- version:
85
118
  requirements: []
86
119
 
87
120
  rubyforge_project: calais
88
- rubygems_version: 1.3.5
121
+ rubygems_version: 1.3.7
89
122
  signing_key:
90
123
  specification_version: 3
91
124
  summary: A Ruby interface to the Calais Web Service