freebase-importers 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/freebase_importers/animal.rb +34 -0
- data/lib/freebase_importers/version.rb +1 -1
- data/spec/integration_spec.rb +7 -0
- metadata +5 -4
@@ -0,0 +1,34 @@
|
|
1
|
+
module FreebaseImporters
|
2
|
+
class Animal < Base
|
3
|
+
map :id
|
4
|
+
map :name
|
5
|
+
|
6
|
+
map :"/biology/organism_classification/higher_classification"
|
7
|
+
map :"/biology/organism_classification/lower_classifications", []
|
8
|
+
map :"/fictional_universe/character_species/characters_of_this_species", []
|
9
|
+
|
10
|
+
add_to_mql :"type", "/biology/animal"
|
11
|
+
add_to_mql :"/biology/organism_classification/rank", "species"
|
12
|
+
images!
|
13
|
+
end
|
14
|
+
end
|
15
|
+
# module FreebaseImporters
|
16
|
+
# class President < Base
|
17
|
+
# map :name
|
18
|
+
# map :id
|
19
|
+
#
|
20
|
+
# add_to_mql :"/government/us_president/presidency_number", []
|
21
|
+
# add_method :presidency_numbers, -> { data["/government/us_president/presidency_number"] }
|
22
|
+
#
|
23
|
+
# map :"/people/person/date_of_birth"
|
24
|
+
# add_method :date_of_birth, -> {
|
25
|
+
# date = data["/people/person/date_of_birth"]
|
26
|
+
# date ? Date.parse(date) : nil rescue date
|
27
|
+
# }
|
28
|
+
#
|
29
|
+
# map :"/people/person/height_meters"
|
30
|
+
#
|
31
|
+
# add_to_mql :type, "/government/us_president"
|
32
|
+
# images!
|
33
|
+
# end
|
34
|
+
# end
|
data/spec/integration_spec.rb
CHANGED
@@ -7,6 +7,13 @@ describe FreebaseImporters do
|
|
7
7
|
expect(FreebaseImporters).to be_a_kind_of Module
|
8
8
|
end
|
9
9
|
|
10
|
+
describe FreebaseImporters::Animal do
|
11
|
+
let(:animal) { FreebaseImporters::Animal.first }
|
12
|
+
it "should have a name" do
|
13
|
+
expect(animal.name).to match /\w+/
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
10
17
|
describe FreebaseImporters::Book do
|
11
18
|
let(:book) { FreebaseImporters::Book.first }
|
12
19
|
it "should have a name" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freebase-importers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- Rakefile
|
140
140
|
- freebase-importers.gemspec
|
141
141
|
- lib/freebase_importers.rb
|
142
|
+
- lib/freebase_importers/animal.rb
|
142
143
|
- lib/freebase_importers/base.rb
|
143
144
|
- lib/freebase_importers/book.rb
|
144
145
|
- lib/freebase_importers/car.rb
|
@@ -165,7 +166,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
166
|
version: '0'
|
166
167
|
segments:
|
167
168
|
- 0
|
168
|
-
hash:
|
169
|
+
hash: 1306700090854972905
|
169
170
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
171
|
none: false
|
171
172
|
requirements:
|
@@ -174,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
175
|
version: '0'
|
175
176
|
segments:
|
176
177
|
- 0
|
177
|
-
hash:
|
178
|
+
hash: 1306700090854972905
|
178
179
|
requirements: []
|
179
180
|
rubyforge_project:
|
180
181
|
rubygems_version: 1.8.25
|