dmx-storage 0.0.1.pre.alpha24 → 0.0.1

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: 61d7c38d2844073e61e0a9fd8e583f694696ddf92606b9fff5174f7fe9ad95bd
4
- data.tar.gz: 987558fb64b93ef57c072042d324e268d658b4751bb656105ed8efb362d0d55d
3
+ metadata.gz: aac14aa5f53e407f83c51642bf04e2d3146f29b31f335ae367f8a3b9e4ee1ddb
4
+ data.tar.gz: '095b5d94a0810e065af53235a84ece2ec4561befdff8d3453c2334475e32e64c'
5
5
  SHA512:
6
- metadata.gz: fc3ff903589cb09c83e8c17518c7d0173b9b1fc85ba163aba5ef18360bc0de0c6abef428cef4a761cc8b4fa8b8ec9bde6950dce03da8ba027f4f6b71b299bb8a
7
- data.tar.gz: 549c78785a6343650eb94c8c021e585be48404523a8d96ce8c5e1b1f4e96d53db1b1f7aa1915722df1f75f8c1142863373d849c02f8d3c5f50ab5699e2918b64
6
+ metadata.gz: e2837d913b830cd6581584cb3816ba88ecde0d5c23b8e3a3f21b988bbe4989ac9f0e0033c648d76867f587269cb76568a17f64bc1ec7fd0ae7b3e6b779ab9930
7
+ data.tar.gz: bad55c4e5ef10d1ee01c92a559e5f908b4ac3a5b07756a89f340cd93f738eb096195f97df549636c1dd6bdfe23a02b2403e3334b61bf40332e9a6aff71399eb9
data/.gitignore CHANGED
@@ -11,5 +11,4 @@
11
11
  .rspec_status
12
12
  /.env
13
13
  /**/.DS_Store
14
- /.DS_Store
15
- /*.gem
14
+ /.DS_Store
@@ -16,6 +16,7 @@ blocks:
16
16
  - |
17
17
  echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
18
18
  - chmod 0600 ~/.gem/credentials
19
+ - gem owner storage --add ben@dee.mx
19
20
  - sem-version ruby 2.6.1
20
21
  - checkout
21
22
  - cache restore
@@ -24,8 +25,9 @@ blocks:
24
25
  - name: 'Build and deploy'
25
26
  commands:
26
27
  - export GEM_VERSION=0.0.1.pre.alpha$SEMAPHORE_WORKFLOW_NUMBER
27
- - export GEM_NAME=dmx-storage-$GEM_VERSION.gem
28
+ - export GEM_NAME=storage-$GEM_VERSION
28
29
  - cat ~/.gem/credentials
29
- - gem build dmxstorage.gemspec
30
- - gem push $GEM_NAME
30
+ - gem build storage.gemspec
31
+ - echo $GEM_NAME
32
+ # - gem push "storage-$GEM_VERSION.gem"
31
33
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dmx-storage (0.0.1)
4
+ storage (0.1.0)
5
5
  activesupport (~> 6.0.0)
6
6
  algoliasearch (~> 1.27.1)
7
7
  dotenv (~> 2.7.5)
@@ -65,9 +65,9 @@ PLATFORMS
65
65
  DEPENDENCIES
66
66
  bundler (~> 2.0)
67
67
  byebug (~> 11.0.1)
68
- dmx-storage!
69
68
  rake (~> 10.0)
70
69
  rspec (~> 3.0)
70
+ storage!
71
71
  webmock (~> 3.7.6)
72
72
 
73
73
  BUNDLED WITH
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Storage
4
+ include ::Storage::Algolia
5
+ end
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require './lib/dmxstorage/algolia/base'
3
+ require './lib/storage/algolia/base'
4
4
 
5
- module DmxStorage
5
+ module Storage
6
6
  module Algolia
7
7
  module Actions
8
- class All < ::DmxStorage::Algolia::Base
8
+ class All < ::Storage::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/dmxstorage/algolia/base'
3
+ require './lib/storage/algolia/base'
4
4
 
5
- module DmxStorage
5
+ module Storage
6
6
  module Algolia
7
7
  module Actions
8
- class Create < ::DmxStorage::Algolia::Base
8
+ class Create < ::Storage::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/dmxstorage/algolia/base'
3
+ require './lib/storage/algolia/base'
4
4
 
5
- module DmxStorage
5
+ module Storage
6
6
  module Algolia
7
7
  module Actions
8
- class Delete < ::DmxStorage::Algolia::Base
8
+ class Delete < ::Storage::Algolia::Base
9
9
  MAX_RETRIES = 3
10
10
 
11
11
  attr_reader :model_name, :id, :retries
@@ -23,7 +23,7 @@ module DmxStorage
23
23
  private
24
24
 
25
25
  def original_object
26
- @original_object ||= ::DmxStorage::Algolia::Actions::Get.process(
26
+ @original_object ||= ::Storage::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/dmxstorage/algolia/base'
3
+ require './lib/storage/algolia/base'
4
4
 
5
- module DmxStorage
5
+ module Storage
6
6
  module Algolia
7
7
  module Actions
8
- class Get < ::DmxStorage::Algolia::Base
8
+ class Get < ::Storage::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/dmxstorage/algolia/base'
3
+ require './lib/storage/algolia/base'
4
4
 
5
- module DmxStorage
5
+ module Storage
6
6
  module Algolia
7
7
  module Actions
8
- class Update < ::DmxStorage::Algolia::Base
8
+ class Update < ::Storage::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 DmxStorage
30
30
  private
31
31
 
32
32
  def original_object
33
- @original_object ||= ::DmxStorage::Algolia::Actions::Get.process(
33
+ @original_object ||= ::Storage::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 DmxStorage
3
+ module Storage
4
4
  module Algolia
5
5
  def self.all(model_name:, cursor: nil)
6
- ::DmxStorage::Algolia::Actions::All.new(
6
+ ::Storage::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
- ::DmxStorage::Algolia::Actions::Get.process(
13
+ ::Storage::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
- ::DmxStorage::Algolia::Actions::Create.process(
20
+ ::Storage::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
- ::DmxStorage::Algolia::Actions::Update.process(
27
+ ::Storage::Algolia::Actions::Update.process(
28
28
  model_name: model_name,
29
29
  params: params,
30
30
  id: id
@@ -32,14 +32,14 @@ module DmxStorage
32
32
  end
33
33
 
34
34
  def self.delete(model_name:, id:)
35
- ::DmxStorage::Algolia::Actions::Delete.process(
35
+ ::Storage::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
- ::DmxStorage::Algolia::Index::Clear.process(
42
+ ::Storage::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/dmxstorage/application_service'
3
+ require './lib/storage/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 DmxStorage
11
+ module Storage
12
12
  module Algolia
13
13
  class Base < ::ApplicationService
14
14
  private
@@ -24,7 +24,7 @@ module DmxStorage
24
24
  end
25
25
 
26
26
  def normalize(data)
27
- ::DmxStorage::Algolia::NormalizeId.process(data)
27
+ ::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/dmxstorage/algolia/base'
3
+ require './lib/storage/algolia/base'
4
4
 
5
- module DmxStorage
5
+ module Storage
6
6
  module Algolia
7
7
  module Index
8
- class Clear < ::DmxStorage::Algolia::Base
8
+ class Clear < ::Storage::Algolia::Base
9
9
  attr_reader :model_name
10
10
 
11
11
  def initialize(model_name:)
@@ -0,0 +1,26 @@
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module DmxStorage
3
+ module Storage
4
4
  VERSION = "0.0.1"
5
5
  end
@@ -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 "dmxstorage/version"
3
+ require "storage/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'dmx-storage'
7
- spec.version = ENV['GEM_VERSION'] || ::DmxStorage::VERSION
7
+ spec.version = ENV['GEM_VERSION'] || Storage::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.}
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.alpha24
4
+ version: 0.0.1
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-29 00:00:00.000000000 Z
11
+ date: 2019-10-28 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
- - 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
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
172
172
  homepage: http://github.com
173
173
  licenses:
174
174
  - MIT
@@ -188,11 +188,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - ">"
191
+ - - ">="
192
192
  - !ruby/object:Gem::Version
193
- version: 1.3.1
193
+ version: '0'
194
194
  requirements: []
195
- rubygems_version: 3.0.3
195
+ rubygems_version: 3.0.6
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: Write a short summary, because RubyGems requires one.
@@ -1,12 +0,0 @@
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,28 +0,0 @@
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