strum-cache 0.0.4 → 0.1.2

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: 134526e82a9302929bf973421134deee663814a7744e38caa0053bcffab4a3ed
4
- data.tar.gz: 74ee547b25c31f5f4efc0a7daf75670799cae63e62cd47afa22322ba6781ebe6
3
+ metadata.gz: efaba98c772965cd918f40d6e2cb276869a045076f6847445188623547bec63d
4
+ data.tar.gz: 53ece08bc876602d5279f0b794cfb312322dcdedaf0b16e16d89b442c8cf93c1
5
5
  SHA512:
6
- metadata.gz: 6e2e1406c50c00abda2a0ac80f2ed83cfede406ca62e19e6350448d02b2d674fd6111a3b4ddad5d95c0d93846a2cb32df0ef97fa0f73c9ddc442a72e460b51be
7
- data.tar.gz: e7c3fbd291b3011a1cf07036fff3666f64983758713145b970683e74726151799fd775f8f7eff45cf7eabf022f2b2a20f37b515679aab5a7c5a5951859aa464d
6
+ metadata.gz: bedc338386c5d7c0af603a8af5b86ae8bba15fc7c3c613127ab9c6e2c218aa85a659a01c8da1e0264f6edb660fd742b81b74e42a8327156017999ba93bcd288d
7
+ data.tar.gz: ccd5267452450fdcde534e386fc94e768f20a5e430f05c820823979c4b8772fbf574ff9dbbe3cd75d8a1600a85b37cab964c61b5f7289e01cd85b48cba2169ad
data/.gitignore CHANGED
@@ -9,6 +9,7 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ /.rbenv-gemsets
12
13
 
13
14
  # Editor directories and files
14
15
  .idea
data/lib/strum/cache.rb CHANGED
@@ -1,15 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "dry/inflector"
4
+ require "dry/configurable"
3
5
  require "strum/cache/version"
4
6
  require "strum/service"
5
7
  require "strum/pipe"
6
- require "dry/inflector"
7
- require "dry/configurable"
8
+ require "strum/json"
8
9
  require "strum/cache_utils/redis"
9
10
  require "strum/cache_utils/find"
10
11
  require "strum/cache_utils/search"
11
12
 
12
13
  module Strum
14
+ # rubocop: disable Style/Documentation
13
15
  module Cache
14
16
  extend Dry::Configurable
15
17
 
@@ -18,6 +20,7 @@ module Strum
18
20
 
19
21
  class Error < StandardError; end
20
22
 
23
+ # rubocop: disable Metrics/AbcSize,Metrics/MethodLength
21
24
  def self.const_missing(resource_name)
22
25
  # Strum::Cache::Entity::Find.(id)
23
26
  # Strum::Cache::Entity::Search.(params)
@@ -55,7 +58,7 @@ module Strum
55
58
  include Strum::Service
56
59
 
57
60
  define_method :call do
58
- if entity = from_cache_by_id(input) || find_by_id(input)
61
+ if (entity = from_cache_by_id(input) || find_by_id(input))
59
62
  output(entity)
60
63
  else
61
64
  not_found
@@ -90,7 +93,7 @@ module Strum
90
93
  include Strum::Service
91
94
 
92
95
  define_method :call do
93
- if entity = from_cache_by_params || search_by_params
96
+ if (entity = from_cache_by_params || search_by_params)
94
97
  output(entity)
95
98
  else
96
99
  not_found
@@ -121,5 +124,7 @@ module Strum
121
124
  end)
122
125
  end
123
126
  end
127
+ # rubocop: enable Metrics/AbcSize,Metrics/MethodLength
124
128
  end
129
+ # rubocop: enable Style/Documentation
125
130
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strum
4
4
  module Cache
5
- VERSION = "0.0.4"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
@@ -4,15 +4,11 @@ require "strum/cache_utils/build_resources_url"
4
4
 
5
5
  module Strum
6
6
  module CacheUtils
7
+ # Resource url builder
7
8
  class BuildResourceUrl
8
9
  include Strum::Service
9
10
 
10
11
  def call
11
- underscore_resource_code = inflector.underscore(resource_code)
12
- base_url = ENV.fetch("#{underscore_resource_code.upcase}_RESOURCE_URL") do
13
- host = ENV.fetch("BASE_RESOURCE_URL")
14
- File.join(host, inflector.pluralize(underscore_resource_code.gsub(/_/, "-")))
15
- end
16
12
  output(url: File.join(base_url, resource_id.to_s))
17
13
  rescue KeyError
18
14
  Strum::CacheUtils::BuildResourcesUrl.call(resource_code: resource_code, params: { id: resource_id }) do |m|
@@ -30,6 +26,17 @@ module Strum
30
26
  def inflector
31
27
  @inflector ||= Dry::Inflector.new
32
28
  end
29
+
30
+ def underscore_resource_code
31
+ inflector.underscore(resource_code)
32
+ end
33
+
34
+ def base_url
35
+ ENV.fetch("#{underscore_resource_code.upcase}_RESOURCE_URL") do
36
+ host = ENV.fetch("BASE_RESOURCE_URL")
37
+ File.join(host, inflector.pluralize(underscore_resource_code.gsub(/_/, "-")))
38
+ end
39
+ end
33
40
  end
34
41
  end
35
42
  end
@@ -4,6 +4,7 @@ require "uri"
4
4
 
5
5
  module Strum
6
6
  module CacheUtils
7
+ # Build url to resource
7
8
  class BuildResourcesUrl
8
9
  include Strum::Service
9
10
 
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "strum/json_deserializer"
4
3
  require "strum/cache_utils/build_resource_url"
5
4
 
6
5
  module Strum
7
6
  module CacheUtils
7
+ # Find service
8
8
  class Find
9
9
  include Strum::Service
10
10
 
11
11
  def call
12
12
  Strum::Pipe.call(Strum::CacheUtils::BuildResourceUrl,
13
13
  Strum::CacheUtils::SendRequest,
14
- Strum::JsonDeserializer,
14
+ Strum::Json::Deserializer,
15
15
  input: input) do |m|
16
16
  m.success { |responce| output(responce) }
17
17
  m.failure { |errors| add_errors(errors) }
@@ -6,6 +6,7 @@ require "strum/cache_utils/redis_storage"
6
6
 
7
7
  module Strum
8
8
  module CacheUtils
9
+ # Redis storage
9
10
  class Redis
10
11
  include Strum::Service
11
12
 
@@ -5,7 +5,9 @@ require "redis"
5
5
 
6
6
  module Strum
7
7
  module CacheUtils
8
+ # Redis storage
8
9
  module RedisStorage
10
+ # rubocop: disable Metrics/MethodLength, Metrics/AbcSize
9
11
  def self.const_missing(resource_name)
10
12
  const_set(resource_name.to_s.strip.capitalize, Class.new do
11
13
  include Singleton
@@ -13,10 +15,15 @@ module Strum
13
15
 
14
16
  define_method :initialize do
15
17
  redis_url = ENV.fetch("#{resource_name.upcase}_CACHE_REDIS_URL", ENV.fetch("CACHE_REDIS_URL", nil))
16
- @redis = redis_url ? Strum::Cache.config.redis_class.new(url: redis_url) : Strum::Cache.config.redis_class.new
18
+ @redis = if redis_url
19
+ Strum::Cache.config.redis_class.new(url: redis_url)
20
+ else
21
+ Strum::Cache.config.redis_class.new
22
+ end
17
23
  end
18
24
  end)
19
25
  end
26
+ # rubocop: enable Metrics/MethodLength, Metrics/AbcSize
20
27
  end
21
28
  end
22
29
  end
@@ -3,17 +3,17 @@
3
3
  require "strum/pipe"
4
4
  require "strum/cache_utils/build_resources_url"
5
5
  require "strum/cache_utils/send_request"
6
- require "strum/json_deserializer"
7
6
 
8
7
  module Strum
9
8
  module CacheUtils
9
+ # Search entity
10
10
  class Search
11
11
  include Strum::Service
12
12
 
13
13
  def call
14
14
  Strum::Pipe.call(Strum::CacheUtils::BuildResourcesUrl,
15
15
  Strum::CacheUtils::SendRequest,
16
- Strum::JsonDeserializer,
16
+ Strum::Json::Deserializer,
17
17
  input: input) do |m|
18
18
  m.success { |responce| output(responce) }
19
19
  m.failure { |errors| add_errors(errors) }
@@ -5,19 +5,12 @@ require "json"
5
5
 
6
6
  module Strum
7
7
  module CacheUtils
8
+ # Send request to entity source
8
9
  class SendRequest
9
10
  include Strum::Service
10
11
 
11
12
  def call
12
- cache_headers = (Strum::Cache.config.cache_headers).is_a?(Hash) ? Strum::Cache.config.cache_headers : {}
13
- conn = Faraday.new(url: url)
14
- resp = conn.get do |req|
15
- req.params = params if input[:params]
16
- req.headers["Content-Type"] = "application/json"
17
- req.headers["Accept"] = "application/json"
18
- cache_headers.each { |k, v| req.headers[k] = v }
19
- end
20
- resp.success? && output(JSON.parse(resp.body))
13
+ (resp = send_request).success? && output(JSON.parse(resp.body))
21
14
  rescue Faraday::Error => e
22
15
  add_error(:connection, e)
23
16
  rescue JSON::JSONError => e
@@ -27,6 +20,25 @@ module Strum
27
20
  def audit
28
21
  required :url
29
22
  end
23
+
24
+ private
25
+
26
+ def cache_headers
27
+ Strum::Cache.config.cache_headers.is_a?(Hash) ? Strum::Cache.config.cache_headers : {}
28
+ end
29
+
30
+ def conn
31
+ Faraday.new(url: url)
32
+ end
33
+
34
+ def send_request
35
+ conn.get do |req|
36
+ req.params = params if input[:params]
37
+ req.headers["Content-Type"] = "application/json"
38
+ req.headers["Accept"] = "application/json"
39
+ cache_headers.each { |k, v| req.headers[k] = v }
40
+ end
41
+ end
30
42
  end
31
43
  end
32
44
  end
data/strum-cache.gemspec CHANGED
@@ -9,28 +9,34 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["sn@nazarov.com.ua"]
10
10
 
11
11
  spec.summary = "Cache resources"
12
- spec.homepage = "https://code.qpard.com/strum/strum-cache"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
12
+ spec.homepage = "https://gitlab.com/strum-rb/strum-cache"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
14
14
 
15
15
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
- spec.metadata["source_code_uri"] = "https://code.qpard.com/strum/strum-cache"
19
- spec.metadata["changelog_uri"] = "https://code.qpard.com/strum/strum-cacheCHANGELOG.md"
18
+ spec.metadata["source_code_uri"] = "https://gitlab.com/strum-rb/strum-cache"
19
+ spec.metadata["changelog_uri"] = "https://gitlab.com/strum-rb/strum-cache/CHANGELOG.md"
20
20
 
21
21
  # Specify which files should be added to the gem when it is released.
22
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
23
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ f.match(
26
+ /^(test|spec|features|\.rubocop.yml|\.ruby-version|Gemfile.lock|Gemfile|\.gitlab-ci.yml|README|\.travis.yml|CHANGELOG|\.rspec)/ # rubocop:disable Layout/LineLength
27
+ )
28
+ end
25
29
  end
26
30
  spec.bindir = "exe"
27
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
32
  spec.require_paths = ["lib"]
29
33
 
30
- spec.add_dependency "dry-configurable", "~> 0.11.6"
31
- spec.add_dependency "dry-inflector", "~> 0.2"
32
- spec.add_dependency "faraday", "~> 1.1"
33
- spec.add_dependency "json", "~> 2.3"
34
- spec.add_dependency "redis", "~> 4.2"
35
- spec.add_dependency "strum"
34
+ spec.add_runtime_dependency "dry-configurable", "~> 0.12.1"
35
+ spec.add_runtime_dependency "dry-inflector", "~> 0.2"
36
+ spec.add_runtime_dependency "faraday", "~> 1.1"
37
+ spec.add_runtime_dependency "json", "~> 2.3"
38
+ spec.add_runtime_dependency "redis", "~> 4.2"
39
+ spec.add_runtime_dependency "strum-json", "~> 0.0.3"
40
+ spec.add_runtime_dependency "strum-pipe", "~> 0.0.3"
41
+ spec.add_runtime_dependency "strum-service", "~> 0.1"
36
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strum-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhiy Nazarov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2021-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.11.6
19
+ version: 0.12.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.11.6
26
+ version: 0.12.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dry-inflector
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -81,19 +81,47 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '4.2'
83
83
  - !ruby/object:Gem::Dependency
84
- name: strum
84
+ name: strum-json
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.0.3
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.0.3
97
+ - !ruby/object:Gem::Dependency
98
+ name: strum-pipe
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '0'
103
+ version: 0.0.3
90
104
  type: :runtime
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - ">="
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.0.3
111
+ - !ruby/object:Gem::Dependency
112
+ name: strum-service
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.1'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
95
123
  - !ruby/object:Gem::Version
96
- version: '0'
124
+ version: '0.1'
97
125
  description:
98
126
  email:
99
127
  - sn@nazarov.com.ua
@@ -102,14 +130,8 @@ extensions: []
102
130
  extra_rdoc_files: []
103
131
  files:
104
132
  - ".gitignore"
105
- - ".rspec"
106
- - ".rubocop.yml"
107
- - ".travis.yml"
108
133
  - CODE_OF_CONDUCT.md
109
- - Gemfile
110
- - Gemfile.lock
111
134
  - LICENSE.txt
112
- - README.md
113
135
  - Rakefile
114
136
  - bin/console
115
137
  - bin/setup
@@ -123,13 +145,13 @@ files:
123
145
  - lib/strum/cache_utils/search.rb
124
146
  - lib/strum/cache_utils/send_request.rb
125
147
  - strum-cache.gemspec
126
- homepage: https://code.qpard.com/strum/strum-cache
148
+ homepage: https://gitlab.com/strum-rb/strum-cache
127
149
  licenses: []
128
150
  metadata:
129
151
  allowed_push_host: https://rubygems.org
130
- homepage_uri: https://code.qpard.com/strum/strum-cache
131
- source_code_uri: https://code.qpard.com/strum/strum-cache
132
- changelog_uri: https://code.qpard.com/strum/strum-cacheCHANGELOG.md
152
+ homepage_uri: https://gitlab.com/strum-rb/strum-cache
153
+ source_code_uri: https://gitlab.com/strum-rb/strum-cache
154
+ changelog_uri: https://gitlab.com/strum-rb/strum-cache/CHANGELOG.md
133
155
  post_install_message:
134
156
  rdoc_options: []
135
157
  require_paths:
@@ -138,14 +160,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
160
  requirements:
139
161
  - - ">="
140
162
  - !ruby/object:Gem::Version
141
- version: 2.3.0
163
+ version: 2.7.0
142
164
  required_rubygems_version: !ruby/object:Gem::Requirement
143
165
  requirements:
144
166
  - - ">="
145
167
  - !ruby/object:Gem::Version
146
168
  version: '0'
147
169
  requirements: []
148
- rubygems_version: 3.1.4
170
+ rubygems_version: 3.1.6
149
171
  signing_key:
150
172
  specification_version: 4
151
173
  summary: Cache resources
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,26 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.6
3
- NewCops: enable
4
-
5
- # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
6
- Style/HashSyntax:
7
- Enabled: true
8
-
9
- # Method definitions after `private` or `protected` isolated calls need one
10
- # extra level of indentation.
11
- Layout/IndentationConsistency:
12
- Enabled: true
13
- EnforcedStyle: indented_internal_methods
14
-
15
- # Two spaces, no tabs (for indentation).
16
- Layout/IndentationWidth:
17
- Enabled: true
18
-
19
- # Check quotes usage according to lint rule below.
20
- Style/StringLiterals:
21
- Enabled: true
22
- EnforcedStyle: double_quotes
23
-
24
- Layout/LineLength:
25
- Max: 120
26
- IgnoredPatterns: ['\A#']
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.6.5
6
- before_install: gem install bundler -v 2.1.4
data/Gemfile DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in strum-cache.gemspec
6
- gemspec
7
-
8
- gem "bundler", "~> 2.1.4"
9
- gem "rspec", "~> 3"
10
- gem "rubocop", "~> 0.90.0"
11
-
12
- gem "debase", "~> 0.2.4"
13
- gem "ruby-debug-ide", "~> 0.7.0"
data/Gemfile.lock DELETED
@@ -1,118 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- strum-cache (0.0.4)
5
- dry-configurable (~> 0.11.6)
6
- dry-inflector (~> 0.2)
7
- faraday (~> 1.1)
8
- json (~> 2.3)
9
- redis (~> 4.2)
10
- strum
11
-
12
- GEM
13
- remote: https://rubygems.org/
14
- specs:
15
- addressable (2.7.0)
16
- public_suffix (>= 2.0.2, < 5.0)
17
- ast (2.4.1)
18
- concurrent-ruby (1.1.7)
19
- debase (0.2.4.1)
20
- debase-ruby_core_source (>= 0.10.2)
21
- debase-ruby_core_source (0.10.11)
22
- diff-lcs (1.4.4)
23
- dry-configurable (0.11.6)
24
- concurrent-ruby (~> 1.0)
25
- dry-core (~> 0.4, >= 0.4.7)
26
- dry-equalizer (~> 0.2)
27
- dry-container (0.7.2)
28
- concurrent-ruby (~> 1.0)
29
- dry-configurable (~> 0.1, >= 0.1.3)
30
- dry-core (0.5.0)
31
- concurrent-ruby (~> 1.0)
32
- dry-equalizer (0.3.0)
33
- dry-inflector (0.2.0)
34
- dry-logic (1.1.0)
35
- concurrent-ruby (~> 1.0)
36
- dry-core (~> 0.5, >= 0.5)
37
- dry-struct (1.3.0)
38
- dry-core (~> 0.4, >= 0.4.4)
39
- dry-equalizer (~> 0.3)
40
- dry-types (~> 1.3)
41
- ice_nine (~> 0.11)
42
- dry-types (1.4.0)
43
- concurrent-ruby (~> 1.0)
44
- dry-container (~> 0.3)
45
- dry-core (~> 0.4, >= 0.4.4)
46
- dry-equalizer (~> 0.3)
47
- dry-inflector (~> 0.1, >= 0.1.2)
48
- dry-logic (~> 1.0, >= 1.0.2)
49
- faraday (1.3.0)
50
- faraday-net_http (~> 1.0)
51
- multipart-post (>= 1.2, < 3)
52
- ruby2_keywords
53
- faraday-net_http (1.0.0)
54
- ice_nine (0.11.2)
55
- json (2.5.1)
56
- json-schema (2.8.1)
57
- addressable (>= 2.4)
58
- multipart-post (2.1.1)
59
- parallel (1.20.1)
60
- parser (3.0.0.0)
61
- ast (~> 2.4.1)
62
- public_suffix (4.0.6)
63
- rainbow (3.0.0)
64
- rake (13.0.3)
65
- redis (4.2.5)
66
- regexp_parser (2.0.3)
67
- rexml (3.2.4)
68
- rspec (3.10.0)
69
- rspec-core (~> 3.10.0)
70
- rspec-expectations (~> 3.10.0)
71
- rspec-mocks (~> 3.10.0)
72
- rspec-core (3.10.1)
73
- rspec-support (~> 3.10.0)
74
- rspec-expectations (3.10.1)
75
- diff-lcs (>= 1.2.0, < 2.0)
76
- rspec-support (~> 3.10.0)
77
- rspec-mocks (3.10.1)
78
- diff-lcs (>= 1.2.0, < 2.0)
79
- rspec-support (~> 3.10.0)
80
- rspec-support (3.10.1)
81
- rubocop (0.90.0)
82
- parallel (~> 1.10)
83
- parser (>= 2.7.1.1)
84
- rainbow (>= 2.2.2, < 4.0)
85
- regexp_parser (>= 1.7)
86
- rexml
87
- rubocop-ast (>= 0.3.0, < 1.0)
88
- ruby-progressbar (~> 1.7)
89
- unicode-display_width (>= 1.4.0, < 2.0)
90
- rubocop-ast (0.8.0)
91
- parser (>= 2.7.1.5)
92
- ruby-debug-ide (0.7.2)
93
- rake (>= 0.8.1)
94
- ruby-progressbar (1.11.0)
95
- ruby2_keywords (0.0.2)
96
- sequel (5.40.0)
97
- strum (0.1.3)
98
- dry-inflector (~> 0.2.0)
99
- dry-struct (~> 1.2)
100
- json-schema (~> 2.8.1)
101
- sequel (~> 5.29)
102
- thor (~> 0.20)
103
- thor (0.20.3)
104
- unicode-display_width (1.7.0)
105
-
106
- PLATFORMS
107
- ruby
108
-
109
- DEPENDENCIES
110
- bundler (~> 2.1.4)
111
- debase (~> 0.2.4)
112
- rspec (~> 3)
113
- rubocop (~> 0.90.0)
114
- ruby-debug-ide (~> 0.7.0)
115
- strum-cache!
116
-
117
- BUNDLED WITH
118
- 2.1.4
data/README.md DELETED
@@ -1,70 +0,0 @@
1
- # Strum::Cache
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/strum/cache`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'strum-cache'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle install
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install strum-cache
22
-
23
- ## Usage
24
-
25
- ###ENV variables:
26
-
27
- `CACHE_REDIS_URL` - connection string to Redis
28
-
29
- `{RESOURCE}_CACHE_REDIS_URL` - separated Redis connection string for resource
30
-
31
- `BASE_RESOURCE_URL` - full url to resource find endpoint. example: "http://example.com/entities"
32
-
33
- `{RESOURCE}_RESOURCE_URL` - separated full url to resource find endpoint. example: "http://example.com/entities"
34
-
35
- `BASE_RESOURCE_SEARCH_URL` - full url to resource search endpoint. example: "http://example.com/entities/search"
36
-
37
- `{RESOURCE}_RESOURCE_SEARCH_URL` - separated full url to resource search endpoint. example: "http://example.com/entities/search"
38
-
39
- ###Configurable
40
-
41
- `Strum::Cache.config.cache_headers` - hash with headers that should be sent on http request
42
-
43
- `Strum::Cache::config.redis_class` - class of Redis. Default is `Redis`, can be changed for mock
44
-
45
- ###How to use
46
-
47
- `Strum::Cache::Entity::Find.(id)` - find Entity by id
48
-
49
- `Strum::Cache::Entity::Search.(params)` - search Entity by params
50
-
51
- `Strum::Cache::Entity::Push.(params)` - push Entity to cache
52
-
53
- ## Development
54
-
55
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
56
-
57
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
58
-
59
- ## Contributing
60
-
61
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/strum-cache. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/strum-cache/blob/master/CODE_OF_CONDUCT.md).
62
-
63
-
64
- ## License
65
-
66
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
67
-
68
- ## Code of Conduct
69
-
70
- Everyone interacting in the Strum::Cache project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/strum-cache/blob/master/CODE_OF_CONDUCT.md).