hakoy 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hakoy/version.rb +1 -1
  3. data/lib/hakoy.rb +3 -14
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78043bf9756159ef93266bb984468e291cbfc086
4
- data.tar.gz: c4213e97fd70bc9c3e5bdf4c3bfd5bff79e77fc5
3
+ metadata.gz: e927f2f407fa31512d3db7a44f32ad8077d965dd
4
+ data.tar.gz: e9aba5c6ead90290ae341ccc5742053e038b7a0f
5
5
  SHA512:
6
- metadata.gz: 60e31277315cbcac5559c6e7c885621711ace2802b667601451fd871bda7752d972f9d270ba6bbf9d3bf5da6113ac57c3929cb4341050e5bc96be25ea9a24a98
7
- data.tar.gz: 60c43d0529f95632b27e4a0ce4d5f747cf1fdbd75bf97813ac098bccf79babfb0c49e0dff34de72df3cd41bbfcef27fc61af4309de96b78c19d0a45e68d43d69
6
+ metadata.gz: f74bc3f20e55b4baa4bacf964658056dfd5fcf6737f284721debe98cdf171bf746815ef3a2827fdc041b9e92de3bf1286115ae827debacd8afacd09fd6834714
7
+ data.tar.gz: d4c960548a81b20d75197b8f40e142ea22ae130150fd86d47ef4a4d5c48fc7bf30958fa1993e041f57b1c7979880576c924da01aa1e5474bfe3415b8628aad9b
data/lib/hakoy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hakoy
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/hakoy.rb CHANGED
@@ -18,7 +18,6 @@ module Hakoy
18
18
  class Proxy
19
19
  DEFAULT_OUTPUT_FORMAT = 'csv'
20
20
  DEFAULT_UID_KEY = 'uid'
21
- REQUIED_KEYS = %w(customer product timestamp price quantity order_id)
22
21
 
23
22
  def initialize(conf)
24
23
  @timestamp_key = conf.fetch(:timestamp_key)
@@ -28,11 +27,8 @@ module Hakoy
28
27
  @file_iterator = conf.fetch(:file_iterator) { FileIterator }
29
28
  @append_strategy = conf.fetch(:append_strategy) { AppendStrategy.new }
30
29
  @required_keys_mapping = conf.fetch(:required_keys_mapping)
31
-
32
- assert_required_keys_present!(@required_keys_mapping)
33
-
34
- @timestamp_path = TimestampPath.new
35
- @row_normalizer = RowNormalizer.new(
30
+ @timestamp_path = TimestampPath.new
31
+ @row_normalizer = RowNormalizer.new(
36
32
  required_keys: @required_keys_mapping.values, uid_key: @uid_key
37
33
  )
38
34
  end
@@ -44,13 +40,6 @@ module Hakoy
44
40
 
45
41
  private
46
42
 
47
- def assert_required_keys_present!(mapping)
48
- mapping.keys.each do |key|
49
- raise "Missing one of #{REQUIED_KEYS}" \
50
- unless REQUIED_KEYS.include? key.to_s
51
- end
52
- end
53
-
54
43
  def store_row(row_hash)
55
44
  file_path = build_file_path(row_hash)
56
45
  normalized_row_hash = normalize_row_hash(row_hash)
@@ -74,7 +63,7 @@ module Hakoy
74
63
 
75
64
  def finalize_store!
76
65
  @append_strategy.finalize! \
77
- uid_key: DEFAULT_UID_KEY,
66
+ uid_key: DEFAULT_UID_KEY,
78
67
  keys_mapping: @required_keys_mapping
79
68
  end
80
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hakoy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lin He