super_settings 0.0.1.rc1 → 0.0.1.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/super_settings/coerce.rb +4 -2
- data/lib/super_settings.rb +8 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9562c88fa68bb2d609f007ed31371870706ab0e12a772857caefc7d4f84fb89
|
4
|
+
data.tar.gz: f434c13622fe523791b543d9c04f5023cbdcee3d265dcbd2b2d9da0947780c64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b13fa738e17df5bd4693939e4c182b4b81b668e0b113a6067e63d436f118e9362438f2503b40c7f6de05f5675653f00fae571c96195d55b3c56b6f557243a29e
|
7
|
+
data.tar.gz: 2bbc6ee2b3059a136e134f4204c94cc4ca0437380ca132de5275be7b3a8c7623c9ae4e2b42f8aa268ea814c74b3ecf12b9fc6a370252eaa65501599b8a3da5f5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.1.
|
1
|
+
0.0.1.rc3
|
@@ -1,10 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "set"
|
4
|
+
|
3
5
|
module SuperSettings
|
4
6
|
# Utility functions for coercing values to other data types.
|
5
7
|
class Coerce
|
6
8
|
# rubocop:disable Lint/BooleanSymbol
|
7
|
-
FALSE_VALUES = [
|
9
|
+
FALSE_VALUES = Set.new([
|
8
10
|
false, 0,
|
9
11
|
"0", :"0",
|
10
12
|
"f", :f,
|
@@ -13,7 +15,7 @@ module SuperSettings
|
|
13
15
|
"FALSE", :FALSE,
|
14
16
|
"off", :off,
|
15
17
|
"OFF", :OFF
|
16
|
-
].
|
18
|
+
]).freeze
|
17
19
|
# rubocop:enable Lint/BooleanSymbol
|
18
20
|
|
19
21
|
class << self
|
data/lib/super_settings.rb
CHANGED
@@ -32,6 +32,14 @@ module SuperSettings
|
|
32
32
|
val.nil? ? default : val.to_s
|
33
33
|
end
|
34
34
|
|
35
|
+
# Alias for {#get} to allow using the [] operator to get a setting value.
|
36
|
+
#
|
37
|
+
# @param key [String, Symbol]
|
38
|
+
# @return [String]
|
39
|
+
def [](key)
|
40
|
+
get(key)
|
41
|
+
end
|
42
|
+
|
35
43
|
# Get a setting value cast to an integer.
|
36
44
|
#
|
37
45
|
# @param key [String, Symbol]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description:
|
27
|
+
description:
|
28
28
|
email:
|
29
29
|
- bbdurand@gmail.com
|
30
30
|
executables: []
|
@@ -74,7 +74,7 @@ homepage: https://github.com/bdurand/super_settings
|
|
74
74
|
licenses:
|
75
75
|
- MIT
|
76
76
|
metadata: {}
|
77
|
-
post_install_message:
|
77
|
+
post_install_message:
|
78
78
|
rdoc_options: []
|
79
79
|
require_paths:
|
80
80
|
- lib
|
@@ -89,8 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: 1.3.1
|
91
91
|
requirements: []
|
92
|
-
rubygems_version: 3.
|
93
|
-
signing_key:
|
92
|
+
rubygems_version: 3.2.22
|
93
|
+
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: Fast access runtime settings for a Rails application with an included UI
|
96
96
|
and API for administration.
|