http_store 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff710f804e2c0ac3705b4db86731ac78a345ee1c32f06ae72f906b664d4de9b5
4
- data.tar.gz: 9e707e5b850c71657d7460e91f582ab6fac4704a795a75b87e943505c8ba2e7e
3
+ metadata.gz: e21b78e87d29ba5cc7dda5c373c0c795c5ad497a7e50657079055b6d711cbf7c
4
+ data.tar.gz: 51a2b9c79ed2ec24db30a08aa27692cce94209176e86f35fef42964467f99766
5
5
  SHA512:
6
- metadata.gz: 147582a4f00bd67f1c1458d0971fe5c7f7b95a4dc7f69ed15f30ff0a7a30545eb22f15a06d4b990ca07ae7dc9d9259a260ae87fb4a81981b6d8646bbc0db771a
7
- data.tar.gz: 05ab3a59edbbc3f13d747ea53f3ba16ef9b82a7029834f2647b050316bcc3e9838dfd053108650b855fd83afd5a5808d2c0fc0c573eddfa52fc2ff2a1a4f71ca
6
+ metadata.gz: 1e2511f353ba3cec16b15452daef6d817f0698c44662ed56463f4f7466d8649c0235e907c70c92310ac4f385e174bf570bdc19ee4ad1683ccaa3bf0878809dc7
7
+ data.tar.gz: 845a31ef1c6579a82d129f9d615a79565aee3d5460429d178c516c7d3ba5ee18d1a5a0285b07d92ac4cf8bedddcd4b720fa224bfad52f6ee87c8b8395971995b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- http_store (0.5.0)
4
+ http_store (0.5.1)
5
5
  activerecord (>= 5.0, < 6.1)
6
6
  hashie (~> 3.0)
7
7
  rails (>= 5, < 7)
@@ -1,7 +1,8 @@
1
1
  module HttpStore
2
2
  module Helpers
3
3
  module Storable
4
- STRING_LIMIT_SIZE = 30_000
4
+ STRING_LIMIT_SIZE = 1000
5
+ TEXT_LIMIT_SIZE = 10000
5
6
 
6
7
  def storeable_record
7
8
  return unless HttpStore.config.store_enable
@@ -39,11 +40,11 @@ module HttpStore
39
40
  storable_v = storable(v)
40
41
 
41
42
  begin
42
- storable_v = storable_v.to_json[0..STRING_LIMIT_SIZE] if v.is_a?(Hash) || v.is_a?(Array)
43
+ storable_v = storable_v.to_json[0..TEXT_LIMIT_SIZE] if v.is_a?(Hash) || v.is_a?(Array)
43
44
 
44
45
  [k, storable_v]
45
46
  rescue JSON::GeneratorError
46
- [k, storable_v.to_s[0..STRING_LIMIT_SIZE]]
47
+ [k, storable_v.to_s[0..TEXT_LIMIT_SIZE]]
47
48
  end
48
49
  end.to_h
49
50
  end
@@ -69,7 +70,7 @@ module HttpStore
69
70
  raise EncodingError unless str.encoding.name == 'UTF-8'
70
71
  raise EncodingError unless str.valid_encoding?
71
72
 
72
- str.length > STRING_LIMIT_SIZE ? { digest: Digest::SHA1.hexdigest(str), origin: str[0..1000] } : str
73
+ str.length > STRING_LIMIT_SIZE ? { digest: Digest::SHA1.hexdigest(str), origin: str[0..STRING_LIMIT_SIZE] } : str
73
74
  rescue EncodingError
74
75
  { digest: Digest::SHA1.hexdigest(str) }
75
76
  end
@@ -1,3 +1,3 @@
1
1
  module HttpStore
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - black
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-28 00:00:00.000000000 Z
11
+ date: 2020-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client