ssm_config 1.2.1 → 1.2.3

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: fc2240e68acd1bb76a701e1101dfb2a457e33fdbad0e444a134284746e9fd2fa
4
- data.tar.gz: a993b5e09f224a107e44dc5a612bf49fcd6455e604d9a1613d6485f589a6271e
3
+ metadata.gz: 831eb6c691b037b55c991d51b7db74d2f65ce6aeb25ce1f72e4b8a58c09e86a7
4
+ data.tar.gz: eb0016f6b7983d7c52e111e163077b12874f763f2afffb43509611b860b1aab8
5
5
  SHA512:
6
- metadata.gz: 1fe7b998ecc23dffdba9c74ecd7c8ac9b3d54f02e8a7efec6d8692e2ef9dbab56b904d320fce5b284c2fa2fb8f5a95a5be81d1fdab99367390bac22500b428d7
7
- data.tar.gz: 952104e797a51ad680b80f0f4f5745f5f946583cbca450041d1fbfd58188c9d0bc9bc8f188795ebf068ac62b8549d7f34d621eb27a8a5191b399a139bd5c6e18
6
+ metadata.gz: 689e51652b4cafe794bedda63be2697220f63f495ec879c46b5a6f95f8b489d3763648c83e9037e05044814efeaf0d1e1abdfa30fdad68e9ff633cc641c27202
7
+ data.tar.gz: 3a17b84d245ca4f18017ec1709db431ec7c9cfacef94de4c14cd4ced15007fccf225849d368ed3ac613a9c7d236d7bb7333727dcc564f2dcc7409b258c7a599e
data/README.md CHANGED
@@ -28,7 +28,7 @@ Or install it yourself as:
28
28
 
29
29
  To utilize ActiveRecords, create the following model:
30
30
  ```
31
- rails generate model SsmConfigRecord file:string:index accessor_keys:string value:string datatype:string
31
+ rails generate model SsmConfigRecord file:string:index accessor_keys:string value:text datatype:string
32
32
  ```
33
33
 
34
34
  The supported datatypes are `[string, integer, boolean, float]`. The first character entered in the field `datatype` should be the character that corresponds to the first character of the datatype (so one of `[s, i, b, f]`). This field is not case-sensitive.
@@ -11,6 +11,8 @@ module SsmConfig
11
11
  def table_exists?
12
12
  return active_record_model_exists? if active_record_exists? && constant_exists?
13
13
  false
14
+ rescue ActiveRecord::NoDatabaseError
15
+ return false
14
16
  end
15
17
 
16
18
  def hash
@@ -41,8 +43,9 @@ module SsmConfig
41
43
  end
42
44
 
43
45
  def transform_class(value, type)
44
- raise SsmConfig::UnsupportedDatatype, 'Not a valid class: must be one of string, integer, boolean, or float' unless VALID_DATATYPES.include? type.to_s.downcase[0]
45
- return value.send("to_#{type.to_s.downcase[0]}") unless type[0] == 'b'
46
+ type_char = type.to_s.downcase[0]
47
+ raise SsmConfig::UnsupportedDatatype, 'Not a valid class: must be one of string, integer, boolean, or float' unless VALID_DATATYPES.include? type_char
48
+ return value.send("to_#{type_char}") unless type_char == 'b'
46
49
  convert_boolean(value)
47
50
  end
48
51
 
data/lib/ssm_config.rb CHANGED
@@ -7,7 +7,7 @@ require 'active_support/core_ext/hash/indifferent_access'
7
7
  require 'active_support/time'
8
8
 
9
9
  module SsmConfig
10
- VERSION = '1.2.1'.freeze
10
+ VERSION = '1.2.3'.freeze
11
11
  REFRESH_TIME = (30.minutes).freeze
12
12
 
13
13
  class << self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssm_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Santiago Herrera
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-18 00:00:00.000000000 Z
11
+ date: 2023-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler