freebase-api 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +13 -13
- data/lib/freebase_api/topic.rb +8 -6
- data/lib/freebase_api/version.rb +1 -1
- data/spec/fixtures/topic.json +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTg1YWI3YTlmNzU4YjY5N2EzNDhiYjE0MzJmMzRjNzVmMmQ1ZTMzNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWQ3NGY0MWNhZDNiYWI4ZDg1ZWMyZDQ5NjJkNjI5ZWRkMGNlMDg0NA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTczZTBhOTU1N2I0Zjg4YmI5MGU0ZDlkYTEzODhmZTU4ZTQ3ZTVkMmMzYzcx
|
10
|
+
YzQzMTIzMDZmMzMzNDZhZDllMDMyMjc3MzJmYTZjYjU5NTk1YTI3ZWFlNzg5
|
11
|
+
YmFiNTM1ZDIzNGU0M2JkMmY5YmM5OWI3ZGJkZDA3M2E2MzRlOGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTJhNDRjYzIzNDM2ZTkyMDc5NTY0OTYzNTE1YzI4OWNmNDc5ZDAzZTI3NjI1
|
14
|
+
YmU5NGZmODNhNGJmYmVhMTY3ZTJlY2VhZTc1OGYzMGJlNjc5ZGNmY2Y4NDg0
|
15
|
+
ZjA5NjA3NjBhODY3MDE1ZTlhN2Q5M2NlNTE4MWU3ZjMxMjU1YTA=
|
data/Gemfile.lock
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
freebase-api (0.1)
|
4
|
+
freebase-api (0.1.2)
|
5
5
|
httparty (~> 0.10)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
colorize (0.5.8)
|
11
|
-
coveralls (0.6.
|
11
|
+
coveralls (0.6.7)
|
12
12
|
colorize
|
13
13
|
multi_json (~> 1.3)
|
14
14
|
rest-client
|
15
15
|
simplecov (>= 0.7)
|
16
16
|
thor
|
17
|
-
diff-lcs (1.2.
|
18
|
-
httparty (0.
|
17
|
+
diff-lcs (1.2.4)
|
18
|
+
httparty (0.11.0)
|
19
19
|
multi_json (~> 1.0)
|
20
|
-
multi_xml
|
21
|
-
mime-types (1.
|
22
|
-
multi_json (1.
|
23
|
-
multi_xml (0.5.
|
24
|
-
rake (10.0.
|
20
|
+
multi_xml (>= 0.5.2)
|
21
|
+
mime-types (1.23)
|
22
|
+
multi_json (1.7.2)
|
23
|
+
multi_xml (0.5.3)
|
24
|
+
rake (10.0.4)
|
25
25
|
redcarpet (2.2.2)
|
26
26
|
rest-client (1.6.7)
|
27
27
|
mime-types (>= 1.16)
|
@@ -29,16 +29,16 @@ GEM
|
|
29
29
|
rspec-core (~> 2.13.0)
|
30
30
|
rspec-expectations (~> 2.13.0)
|
31
31
|
rspec-mocks (~> 2.13.0)
|
32
|
-
rspec-core (2.13.
|
32
|
+
rspec-core (2.13.1)
|
33
33
|
rspec-expectations (2.13.0)
|
34
34
|
diff-lcs (>= 1.1.3, < 2.0)
|
35
|
-
rspec-mocks (2.13.
|
35
|
+
rspec-mocks (2.13.1)
|
36
36
|
simplecov (0.7.1)
|
37
37
|
multi_json (~> 1.0)
|
38
38
|
simplecov-html (~> 0.7.1)
|
39
39
|
simplecov-html (0.7.1)
|
40
|
-
thor (0.
|
41
|
-
yard (0.8.
|
40
|
+
thor (0.18.1)
|
41
|
+
yard (0.8.6.1)
|
42
42
|
|
43
43
|
PLATFORMS
|
44
44
|
ruby
|
data/lib/freebase_api/topic.rb
CHANGED
@@ -171,12 +171,14 @@ module FreebaseAPI
|
|
171
171
|
|
172
172
|
def build_property(property, content)
|
173
173
|
unless @excluded_properties.select { |p| property.start_with?(p) }.any?
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
174
|
+
if content['valuetype']
|
175
|
+
case content['valuetype']
|
176
|
+
when 'compound', 'object'
|
177
|
+
# Note : some referenced topics have empty ids, we need to exclude them
|
178
|
+
@properties[property] = content['values'].reject { |s| s['id'].empty? }.map { |at| Topic.new(at['id'], :data => at) }
|
179
|
+
else
|
180
|
+
@properties[property] = content['values'].map { |at| Attribute.new(at, :type => content['valuetype']) }
|
181
|
+
end
|
180
182
|
end
|
181
183
|
end
|
182
184
|
end
|
data/lib/freebase_api/version.rb
CHANGED
data/spec/fixtures/topic.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freebase-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aymeric Brisse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|