dmx-storage 0.0.1.pre.alpha21 → 0.0.1.pre.alpha24

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
  SHA256:
3
- metadata.gz: 72436ca4906c0d112793ea6e6ddc2c5e63b1a97c1636c72bb55f1f46a9749e90
4
- data.tar.gz: c4d83093d6ff0307a42ff31637f86c5bf38218ba7e566617cebea9a018d0b966
3
+ metadata.gz: 61d7c38d2844073e61e0a9fd8e583f694696ddf92606b9fff5174f7fe9ad95bd
4
+ data.tar.gz: 987558fb64b93ef57c072042d324e268d658b4751bb656105ed8efb362d0d55d
5
5
  SHA512:
6
- metadata.gz: 4f45fccf69f314287532193319eebdf9f5361c52237d6e1f06963ac73b00e17318ab76d9d75ad8b6408a0fd691d8e297d5ffd5e852bdd03f9b4f01e8af670454
7
- data.tar.gz: eaa57c6eb5048f561da6b88cbb2fe22607208297080ee3be0cef18274e8f1295ec1aee48beb6e3e43120c5837e32a46d4213d4a06f05dd463161c80cdfb22d99
6
+ metadata.gz: fc3ff903589cb09c83e8c17518c7d0173b9b1fc85ba163aba5ef18360bc0de0c6abef428cef4a761cc8b4fa8b8ec9bde6950dce03da8ba027f4f6b71b299bb8a
7
+ data.tar.gz: 549c78785a6343650eb94c8c021e585be48404523a8d96ce8c5e1b1f4e96d53db1b1f7aa1915722df1f75f8c1142863373d849c02f8d3c5f50ab5699e2918b64
@@ -26,6 +26,6 @@ blocks:
26
26
  - export GEM_VERSION=0.0.1.pre.alpha$SEMAPHORE_WORKFLOW_NUMBER
27
27
  - export GEM_NAME=dmx-storage-$GEM_VERSION.gem
28
28
  - cat ~/.gem/credentials
29
- - gem build storage.gemspec
29
+ - gem build dmxstorage.gemspec
30
30
  - gem push $GEM_NAME
31
31
 
@@ -1,10 +1,10 @@
1
- lib = File.expand_path("lib", __dir__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "storage/version"
3
+ require "dmxstorage/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'dmx-storage'
7
- spec.version = ENV['GEM_VERSION'] || Storage::VERSION
7
+ spec.version = ENV['GEM_VERSION'] || ::DmxStorage::VERSION
8
8
  spec.authors = ["CCTV"]
9
9
  spec.email = ["ben@dee.mx"]
10
10
  spec.summary = %q{Write a short summary, because RubyGems requires one.}
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dmxstorage/algolia/algolia'
4
+
5
+ module DmxStorage
6
+ # module Algolia
7
+ # def self.build
8
+ # pp 'ok'
9
+ # end
10
+ # end
11
+ # include ::DmxStorage::Algolia
12
+ end
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require './lib/storage/algolia/base'
3
+ require './lib/dmxstorage/algolia/base'
4
4
 
5
- module Storage
5
+ module DmxStorage
6
6
  module Algolia
7
7
  module Actions
8
- class All < ::Storage::Algolia::Base
8
+ class All < ::DmxStorage::Algolia::Base
9
9
  attr_reader :model_name, :cursor
10
10
 
11
11
  def initialize(model_name:, cursor: nil)
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require './lib/storage/algolia/base'
3
+ require './lib/dmxstorage/algolia/base'
4
4
 
5
- module Storage
5
+ module DmxStorage
6
6
  module Algolia
7
7
  module Actions
8
- class Create < ::Storage::Algolia::Base
8
+ class Create < ::DmxStorage::Algolia::Base
9
9
  attr_reader :model_name, :params
10
10
 
11
11
  def initialize(model_name:, params:)
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require './lib/storage/algolia/base'
3
+ require './lib/dmxstorage/algolia/base'
4
4
 
5
- module Storage
5
+ module DmxStorage
6
6
  module Algolia
7
7
  module Actions
8
- class Delete < ::Storage::Algolia::Base
8
+ class Delete < ::DmxStorage::Algolia::Base
9
9
  MAX_RETRIES = 3
10
10
 
11
11
  attr_reader :model_name, :id, :retries
@@ -23,7 +23,7 @@ module Storage
23
23
  private
24
24
 
25
25
  def original_object
26
- @original_object ||= ::Storage::Algolia::Actions::Get.process(
26
+ @original_object ||= ::DmxStorage::Algolia::Actions::Get.process(
27
27
  model_name: model_name,
28
28
  id: id
29
29
  )
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require './lib/storage/algolia/base'
3
+ require './lib/dmxstorage/algolia/base'
4
4
 
5
- module Storage
5
+ module DmxStorage
6
6
  module Algolia
7
7
  module Actions
8
- class Get < ::Storage::Algolia::Base
8
+ class Get < ::DmxStorage::Algolia::Base
9
9
  MAX_RETRIES = 3
10
10
 
11
11
  attr_reader :model_name, :id, :retries
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require './lib/storage/algolia/base'
3
+ require './lib/dmxstorage/algolia/base'
4
4
 
5
- module Storage
5
+ module DmxStorage
6
6
  module Algolia
7
7
  module Actions
8
- class Update < ::Storage::Algolia::Base
8
+ class Update < ::DmxStorage::Algolia::Base
9
9
  attr_reader :model_name, :params, :id, :retries
10
10
 
11
11
  def initialize(model_name:, params:, id:)
@@ -30,7 +30,7 @@ module Storage
30
30
  private
31
31
 
32
32
  def original_object
33
- @original_object ||= ::Storage::Algolia::Actions::Get.process(
33
+ @original_object ||= ::DmxStorage::Algolia::Actions::Get.process(
34
34
  model_name: model_name,
35
35
  id: id
36
36
  )
@@ -1,30 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Storage
3
+ module DmxStorage
4
4
  module Algolia
5
5
  def self.all(model_name:, cursor: nil)
6
- ::Storage::Algolia::Actions::All.new(
6
+ ::DmxStorage::Algolia::Actions::All.new(
7
7
  model_name: model_name,
8
8
  cursor: cursor
9
9
  )
10
10
  end
11
11
 
12
12
  def self.get(model_name:, id:)
13
- ::Storage::Algolia::Actions::Get.process(
13
+ ::DmxStorage::Algolia::Actions::Get.process(
14
14
  model_name: model_name,
15
15
  id: id
16
16
  )
17
17
  end
18
18
 
19
19
  def self.create(model_name:, params:)
20
- ::Storage::Algolia::Actions::Create.process(
20
+ ::DmxStorage::Algolia::Actions::Create.process(
21
21
  model_name: model_name,
22
22
  params: params
23
23
  )
24
24
  end
25
25
 
26
26
  def self.update(model_name:, params:, id:)
27
- ::Storage::Algolia::Actions::Update.process(
27
+ ::DmxStorage::Algolia::Actions::Update.process(
28
28
  model_name: model_name,
29
29
  params: params,
30
30
  id: id
@@ -32,14 +32,14 @@ module Storage
32
32
  end
33
33
 
34
34
  def self.delete(model_name:, id:)
35
- ::Storage::Algolia::Actions::Delete.process(
35
+ ::DmxStorage::Algolia::Actions::Delete.process(
36
36
  model_name: model_name,
37
37
  id: id
38
38
  )
39
39
  end
40
40
 
41
41
  def self.clear(model_name:)
42
- ::Storage::Algolia::Index::Clear.process(
42
+ ::DmxStorage::Algolia::Index::Clear.process(
43
43
  model_name: model_name
44
44
  )
45
45
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require './lib/storage/application_service'
3
+ require './lib/dmxstorage/application_service'
4
4
  require 'algoliasearch'
5
5
  require 'hashugar'
6
6
  require 'active_support/core_ext/hash/except'
@@ -8,7 +8,7 @@ require 'active_support/core_ext/hash/keys'
8
8
  require 'dotenv/load'
9
9
  ::Dotenv.load
10
10
 
11
- module Storage
11
+ module DmxStorage
12
12
  module Algolia
13
13
  class Base < ::ApplicationService
14
14
  private
@@ -24,7 +24,7 @@ module Storage
24
24
  end
25
25
 
26
26
  def normalize(data)
27
- ::Algolia::NormalizeId.process(data)
27
+ ::DmxStorage::Algolia::NormalizeId.process(data)
28
28
  end
29
29
 
30
30
  def params
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require './lib/storage/algolia/base'
3
+ require './lib/dmxstorage/algolia/base'
4
4
 
5
- module Storage
5
+ module DmxStorage
6
6
  module Algolia
7
7
  module Index
8
- class Clear < ::Storage::Algolia::Base
8
+ class Clear < ::DmxStorage::Algolia::Base
9
9
  attr_reader :model_name
10
10
 
11
11
  def initialize(model_name:)
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require './lib/dmxstorage/application_service'
4
+
5
+ module DmxStorage
6
+ module Algolia
7
+ class NormalizeId < ::ApplicationService
8
+ attr_reader :data
9
+
10
+ def initialize(data)
11
+ @data = data
12
+ end
13
+
14
+ def process
15
+ data.kind_of?(Array) ?
16
+ data.map { |node| objectid_to_id(node) }.to_hashugar :
17
+ objectid_to_id(data)
18
+ end
19
+
20
+ private
21
+
22
+ def objectid_to_id(node)
23
+ node[:id] = node.delete(:objectID)
24
+ node.to_hashugar
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Storage
3
+ module DmxStorage
4
4
  VERSION = "0.0.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dmx-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.alpha21
4
+ version: 0.0.1.pre.alpha24
5
5
  platform: ruby
6
6
  authors:
7
7
  - CCTV
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-28 00:00:00.000000000 Z
11
+ date: 2019-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashugar
@@ -156,19 +156,19 @@ files:
156
156
  - Rakefile
157
157
  - bin/console
158
158
  - bin/setup
159
- - lib/storage.rb
160
- - lib/storage/algolia/actions/all.rb
161
- - lib/storage/algolia/actions/create.rb
162
- - lib/storage/algolia/actions/delete.rb
163
- - lib/storage/algolia/actions/get.rb
164
- - lib/storage/algolia/actions/update.rb
165
- - lib/storage/algolia/algolia.rb
166
- - lib/storage/algolia/base.rb
167
- - lib/storage/algolia/index/clear.rb
168
- - lib/storage/algolia/normalize_id.rb
169
- - lib/storage/application_service.rb
170
- - lib/storage/version.rb
171
- - storage.gemspec
159
+ - dmxstorage.gemspec
160
+ - lib/dmxstorage.rb
161
+ - lib/dmxstorage/algolia/actions/all.rb
162
+ - lib/dmxstorage/algolia/actions/create.rb
163
+ - lib/dmxstorage/algolia/actions/delete.rb
164
+ - lib/dmxstorage/algolia/actions/get.rb
165
+ - lib/dmxstorage/algolia/actions/update.rb
166
+ - lib/dmxstorage/algolia/algolia.rb
167
+ - lib/dmxstorage/algolia/base.rb
168
+ - lib/dmxstorage/algolia/index/clear.rb
169
+ - lib/dmxstorage/algolia/normalize_id.rb
170
+ - lib/dmxstorage/application_service.rb
171
+ - lib/dmxstorage/version.rb
172
172
  homepage: http://github.com
173
173
  licenses:
174
174
  - MIT
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Storage
4
- include ::Storage::Algolia
5
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require './lib/storage/application_service'
4
-
5
- module Algolia
6
- class NormalizeId < ::ApplicationService
7
- attr_reader :data
8
-
9
- def initialize(data)
10
- @data = data
11
- end
12
-
13
- def process
14
- data.kind_of?(Array) ?
15
- data.map { |node| objectid_to_id(node) }.to_hashugar :
16
- objectid_to_id(data)
17
- end
18
-
19
- private
20
-
21
- def objectid_to_id(node)
22
- node[:id] = node.delete(:objectID)
23
- node.to_hashugar
24
- end
25
- end
26
- end