strum-cache 0.0.3 → 0.1.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: 68bcc14c5132c6498fbe47188eeee25c7a47bad93357e0c00e999e456a923258
4
- data.tar.gz: ae93681fa8f28c73e35a235e122b869b19dd4b51301de1377c03e502113f296e
3
+ metadata.gz: f1057277181a99a80a1ca12f32fcf1349c2c23170f22ac2912239cd3432321d3
4
+ data.tar.gz: 2b5f3e05091e217d8d205cda0718be2f3646c874993c35299123f5a3f484a7e7
5
5
  SHA512:
6
- metadata.gz: bba45287395f656357cc035564131b17304c0649d313c032bff97e565cc17401bc1fa949fbef99c09cff12d517b6d71b5d22996ba66bca48be9a96deacd97a83
7
- data.tar.gz: aae3bc53cc5c46f9ab7835e12e9027db21cdb519ea0a960b549f94009e68ee09143cf8fd07f17795dca2910e9264d1c02d84bfedad739e537a284c2387747fdf
6
+ metadata.gz: 588edc1bf46b4f51690d88388690eb28a58a1adebdcb8266c37d64a018e6ae1b5e0aca6d31098c747433693741024fa0d53adde477c3b2af5ed3c713ff5b1339
7
+ data.tar.gz: a25937df792f2c5e583f9b59a98c204429f3a4e5bf52b7d874f9ca241bb9afed30398b5e2e1da96f53273e1a93acc6f9cd64e136b2167c0492ff6aba60d1ec81
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,22 +1,26 @@
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
 
16
18
  setting :cache_headers
19
+ setting :redis_class, Redis
17
20
 
18
21
  class Error < StandardError; end
19
22
 
23
+ # rubocop: disable Metrics/AbcSize,Metrics/MethodLength
20
24
  def self.const_missing(resource_name)
21
25
  # Strum::Cache::Entity::Find.(id)
22
26
  # Strum::Cache::Entity::Search.(params)
@@ -54,7 +58,7 @@ module Strum
54
58
  include Strum::Service
55
59
 
56
60
  define_method :call do
57
- if entity = from_cache_by_id(input) || find_by_id(input)
61
+ if (entity = from_cache_by_id(input) || find_by_id(input))
58
62
  output(entity)
59
63
  else
60
64
  not_found
@@ -89,7 +93,7 @@ module Strum
89
93
  include Strum::Service
90
94
 
91
95
  define_method :call do
92
- if entity = from_cache_by_params || search_by_params
96
+ if (entity = from_cache_by_params || search_by_params)
93
97
  output(entity)
94
98
  else
95
99
  not_found
@@ -120,5 +124,7 @@ module Strum
120
124
  end)
121
125
  end
122
126
  end
127
+ # rubocop: enable Metrics/AbcSize,Metrics/MethodLength
123
128
  end
129
+ # rubocop: enable Style/Documentation
124
130
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strum
4
4
  module Cache
5
- VERSION = "0.0.3"
5
+ VERSION = "0.1.1"
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 ? ::Redis.new(url: redis_url) : ::Redis.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", "~> 0"
34
+ spec.add_runtime_dependency "dry-configurable", "~> 0.11.6"
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.3
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhiy Nazarov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-18 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
@@ -81,20 +81,48 @@ 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
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 0.0.3
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
97
- description:
96
+ version: 0.0.3
97
+ - !ruby/object:Gem::Dependency
98
+ name: strum-pipe
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.0.3
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
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
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.1'
125
+ description:
98
126
  email:
99
127
  - sn@nazarov.com.ua
100
128
  executables: []
@@ -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,14 +145,14 @@ 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
133
- post_install_message:
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
155
+ post_install_message:
134
156
  rdoc_options: []
135
157
  require_paths:
136
158
  - lib
@@ -138,15 +160,15 @@ 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.0.3
149
- signing_key:
170
+ rubygems_version: 3.1.6
171
+ signing_key:
150
172
  specification_version: 4
151
173
  summary: Cache resources
152
174
  test_files: []
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,117 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- strum-cache (0.0.3)
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 (~> 0)
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.4.9)
31
- concurrent-ruby (~> 1.0)
32
- dry-equalizer (0.3.0)
33
- dry-inflector (0.2.0)
34
- dry-logic (1.0.8)
35
- concurrent-ruby (~> 1.0)
36
- dry-core (~> 0.2)
37
- dry-equalizer (~> 0.2)
38
- dry-struct (1.3.0)
39
- dry-core (~> 0.4, >= 0.4.4)
40
- dry-equalizer (~> 0.3)
41
- dry-types (~> 1.3)
42
- ice_nine (~> 0.11)
43
- dry-types (1.4.0)
44
- concurrent-ruby (~> 1.0)
45
- dry-container (~> 0.3)
46
- dry-core (~> 0.4, >= 0.4.4)
47
- dry-equalizer (~> 0.3)
48
- dry-inflector (~> 0.1, >= 0.1.2)
49
- dry-logic (~> 1.0, >= 1.0.2)
50
- faraday (1.1.0)
51
- multipart-post (>= 1.2, < 3)
52
- ruby2_keywords
53
- ice_nine (0.11.2)
54
- json (2.3.1)
55
- json-schema (2.8.1)
56
- addressable (>= 2.4)
57
- multipart-post (2.1.1)
58
- parallel (1.20.0)
59
- parser (2.7.2.0)
60
- ast (~> 2.4.1)
61
- public_suffix (4.0.6)
62
- rainbow (3.0.0)
63
- rake (13.0.1)
64
- redis (4.2.3)
65
- regexp_parser (1.8.2)
66
- rexml (3.2.4)
67
- rspec (3.10.0)
68
- rspec-core (~> 3.10.0)
69
- rspec-expectations (~> 3.10.0)
70
- rspec-mocks (~> 3.10.0)
71
- rspec-core (3.10.0)
72
- rspec-support (~> 3.10.0)
73
- rspec-expectations (3.10.0)
74
- diff-lcs (>= 1.2.0, < 2.0)
75
- rspec-support (~> 3.10.0)
76
- rspec-mocks (3.10.0)
77
- diff-lcs (>= 1.2.0, < 2.0)
78
- rspec-support (~> 3.10.0)
79
- rspec-support (3.10.0)
80
- rubocop (0.90.0)
81
- parallel (~> 1.10)
82
- parser (>= 2.7.1.1)
83
- rainbow (>= 2.2.2, < 4.0)
84
- regexp_parser (>= 1.7)
85
- rexml
86
- rubocop-ast (>= 0.3.0, < 1.0)
87
- ruby-progressbar (~> 1.7)
88
- unicode-display_width (>= 1.4.0, < 2.0)
89
- rubocop-ast (0.8.0)
90
- parser (>= 2.7.1.5)
91
- ruby-debug-ide (0.7.2)
92
- rake (>= 0.8.1)
93
- ruby-progressbar (1.10.1)
94
- ruby2_keywords (0.0.2)
95
- sequel (5.38.0)
96
- strum (0.1.3)
97
- dry-inflector (~> 0.2.0)
98
- dry-struct (~> 1.2)
99
- json-schema (~> 2.8.1)
100
- sequel (~> 5.29)
101
- thor (~> 0.20)
102
- thor (0.20.3)
103
- unicode-display_width (1.7.0)
104
-
105
- PLATFORMS
106
- ruby
107
-
108
- DEPENDENCIES
109
- bundler (~> 2.1.4)
110
- debase (~> 0.2.4)
111
- rspec (~> 3)
112
- rubocop (~> 0.90.0)
113
- ruby-debug-ide (~> 0.7.0)
114
- strum-cache!
115
-
116
- BUNDLED WITH
117
- 2.1.4
data/README.md DELETED
@@ -1,68 +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
- ###How to use
44
-
45
- `Strum::Cache::Entity::Find.(id)` - find Entity by id
46
-
47
- `Strum::Cache::Entity::Search.(params)` - search Entity by params
48
-
49
- `Strum::Cache::Entity::Push.(params)` - push Entity to cache
50
-
51
- ## Development
52
-
53
- 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.
54
-
55
- 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).
56
-
57
- ## Contributing
58
-
59
- 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).
60
-
61
-
62
- ## License
63
-
64
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
65
-
66
- ## Code of Conduct
67
-
68
- 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).