enrichment_db 0.1.6 → 0.1.7
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/enrichment_db/ato/datum.rb +12 -0
- data/lib/enrichment_db/language.rb +6 -0
- data/lib/enrichment_db/language/datum.rb +19 -0
- data/lib/enrichment_db/version.rb +1 -1
- data/test/language/datum_test.rb +12 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e528182a7b7ca1f550d6fc15856de26df6d01fa1
|
4
|
+
data.tar.gz: af053abcbedaa87037b748fbf7892c1c461e957a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2abd35e4045b2ee3816b9c14a57ac7f34dcac43a14bec0292d4b5e530e29fe24d8c20c5ced294f22f7bab523be2402050ab9fcbac6cfa79850fcdf11e5a438ca
|
7
|
+
data.tar.gz: 70bf764a95eb810217ca424aa762af047c50d66f9054e8bfedb633b1a9b21cafbb724882ab95a334ea28ad994a5d413a7359763d22be8fe373ed68453ad2dc74
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class EnrichmentDb::Language::Datum < EnrichmentDb::DatumModel
|
4
|
+
def self.format_result(result)
|
5
|
+
if result.size > 0
|
6
|
+
puts "Found #{result.size} object/s"
|
7
|
+
result.collect do |h|
|
8
|
+
h.delete('id')
|
9
|
+
h
|
10
|
+
end.sort_by do |h|
|
11
|
+
h['value']
|
12
|
+
end.each_with_object({}) do |record, h|
|
13
|
+
h[record.fetch('value')] = record.fetch('language')
|
14
|
+
end
|
15
|
+
else
|
16
|
+
puts "Nothing found"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "#{File.dirname(__FILE__)}/../test_helper"
|
2
|
+
|
3
|
+
describe EnrichmentDb::Language::Datum do
|
4
|
+
it 'should retrieve correct record' do
|
5
|
+
table_name = 'Electronics_Brands'
|
6
|
+
schema_name = 'arabic'
|
7
|
+
result = EnrichmentDb::Language::Datum.all(table_name, schema_name)
|
8
|
+
test_result = result.keys.first
|
9
|
+
expecting = 'Acer'
|
10
|
+
assert_equal expecting, test_result
|
11
|
+
end
|
12
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enrichment_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Wallis
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- enrichment_db.gemspec
|
69
69
|
- lib/enrichment_db.rb
|
70
70
|
- lib/enrichment_db/.DS_Store
|
71
|
+
- lib/enrichment_db/ato/datum.rb
|
71
72
|
- lib/enrichment_db/census.rb
|
72
73
|
- lib/enrichment_db/census/datum.rb
|
73
74
|
- lib/enrichment_db/datum.rb
|
@@ -84,6 +85,8 @@ files:
|
|
84
85
|
- lib/enrichment_db/geo/state.rb
|
85
86
|
- lib/enrichment_db/geo/suburb.rb
|
86
87
|
- lib/enrichment_db/helper.rb
|
88
|
+
- lib/enrichment_db/language.rb
|
89
|
+
- lib/enrichment_db/language/datum.rb
|
87
90
|
- lib/enrichment_db/version.rb
|
88
91
|
- test/census/datum_test.rb
|
89
92
|
- test/datum_test.rb
|
@@ -97,6 +100,7 @@ files:
|
|
97
100
|
- test/factories/suburb.rb
|
98
101
|
- test/geo/locator_test.rb
|
99
102
|
- test/helper_test.rb
|
103
|
+
- test/language/datum_test.rb
|
100
104
|
- test/test_helper.rb
|
101
105
|
homepage: https://github.com/lexerdev/enrichment-db.gem
|
102
106
|
licenses:
|
@@ -133,6 +137,7 @@ test_files:
|
|
133
137
|
- enrichment_db.gemspec
|
134
138
|
- lib/enrichment_db.rb
|
135
139
|
- lib/enrichment_db/.DS_Store
|
140
|
+
- lib/enrichment_db/ato/datum.rb
|
136
141
|
- lib/enrichment_db/census.rb
|
137
142
|
- lib/enrichment_db/census/datum.rb
|
138
143
|
- lib/enrichment_db/datum.rb
|
@@ -149,6 +154,8 @@ test_files:
|
|
149
154
|
- lib/enrichment_db/geo/state.rb
|
150
155
|
- lib/enrichment_db/geo/suburb.rb
|
151
156
|
- lib/enrichment_db/helper.rb
|
157
|
+
- lib/enrichment_db/language.rb
|
158
|
+
- lib/enrichment_db/language/datum.rb
|
152
159
|
- lib/enrichment_db/version.rb
|
153
160
|
- test/census/datum_test.rb
|
154
161
|
- test/datum_test.rb
|
@@ -162,5 +169,5 @@ test_files:
|
|
162
169
|
- test/factories/suburb.rb
|
163
170
|
- test/geo/locator_test.rb
|
164
171
|
- test/helper_test.rb
|
172
|
+
- test/language/datum_test.rb
|
165
173
|
- test/test_helper.rb
|
166
|
-
has_rdoc:
|