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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e761011e4c6ae8f32a932c1c349730ce112ef66
4
- data.tar.gz: 39cd9b7f3bd62161f202e13fe3e33e576292d0a7
3
+ metadata.gz: e528182a7b7ca1f550d6fc15856de26df6d01fa1
4
+ data.tar.gz: af053abcbedaa87037b748fbf7892c1c461e957a
5
5
  SHA512:
6
- metadata.gz: 2d67d7ba3d10a5bac786ae0d3353fc8e32a3850284eac00306ff14bdfbbd026e6fbd7edba7445e6ffa015ff2157f838640e0ec1ee93beb6025a1bd1df3877cea
7
- data.tar.gz: cbced204ad097551a74f375c5b0a597fc5f063a902ecc83392ae136891b2e6cc86a219cba0ee45824d614ba684f2259be354c836f0ce30c8e9024caa8d69646a
6
+ metadata.gz: 2abd35e4045b2ee3816b9c14a57ac7f34dcac43a14bec0292d4b5e530e29fe24d8c20c5ced294f22f7bab523be2402050ab9fcbac6cfa79850fcdf11e5a438ca
7
+ data.tar.gz: 70bf764a95eb810217ca424aa762af047c50d66f9054e8bfedb633b1a9b21cafbb724882ab95a334ea28ad994a5d413a7359763d22be8fe373ed68453ad2dc74
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  **.DS_Store
2
2
  test/reports/
3
+ enrichment_db-*.*.*.gem
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enrichment_db (0.1.5)
4
+ enrichment_db (0.1.6)
5
5
  multi_json (~> 1.3)
6
6
  pg
7
7
  pr_geohash
@@ -0,0 +1,12 @@
1
+ require 'helper'
2
+
3
+ class EnrichmentDb::Ato::Datum < EnrichmentDb::DatumModel
4
+ attr_reader :id
5
+
6
+ DATABASE_NAME = 'ato'
7
+ UID_NAME = 'region_id'
8
+
9
+ def self.format_result(result)
10
+ EnrichmentDb::Helper.format_geo_result(result)
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ $LOAD_PATH.unshift("#{File.dirname(__FILE__)}")
2
+
3
+ module EnrichmentDb::Language
4
+ end
5
+
6
+ require 'language/datum'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module EnrichmentDb
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  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.6
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: