constantin 0.2.0 → 0.3.0
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 +4 -4
- data/README.md +10 -3
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/constantin.gemspec +1 -1
- data/lib/constantin/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9348a560ada2d1ca5c0dd6371c7317a92f4ca5af4f4f5c01f69911c31208c9a
|
4
|
+
data.tar.gz: 0645f8f6ce5795403e2729f624953c77056f522b84c8da8c2122c6c2ebfa48a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e80ae057f5a2fbe56159a3f92b4ad8f5057e3d900fc0c4ddebf97cbca058d77ae8575bd820ab1d00214ef916c8c8c2e25e59f6e0c2988cc1f5128d8647560006
|
7
|
+
data.tar.gz: b9ffd555cb5a234569552a24f0646fdcbfa5f368ce117a710c907f79203b5a8696f82c942d6ff24c1b06214e4ec0b5ab070b0cafb28c49bfca2a8aa3fd0e6901
|
data/README.md
CHANGED
@@ -20,6 +20,10 @@ And then execute:
|
|
20
20
|
class Country < Constantin::Option
|
21
21
|
define_options 'US', 'PH', 'JP'
|
22
22
|
define_options { NZ: "New Zealand"}
|
23
|
+
|
24
|
+
define_option_group 'ASIA' do
|
25
|
+
[PH, JP]
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
Country::ALL
|
@@ -28,8 +32,11 @@ Country::ALL
|
|
28
32
|
Country.constants
|
29
33
|
=> [:US, :PH, :JP, :NZ]
|
30
34
|
|
31
|
-
Country::
|
32
|
-
=> '
|
35
|
+
Country::NZ
|
36
|
+
=> 'New Zealand'
|
37
|
+
|
38
|
+
Country::ASIA
|
39
|
+
=> ['PH','JP']
|
33
40
|
```
|
34
41
|
|
35
42
|
Validate field in model against constants
|
@@ -43,7 +50,7 @@ user.address = "US"
|
|
43
50
|
user.valid?
|
44
51
|
=> true
|
45
52
|
|
46
|
-
user.address = "
|
53
|
+
user.address = "America"
|
47
54
|
user.valid?
|
48
55
|
=> false
|
49
56
|
```
|
data/bin/console
CHANGED
File without changes
|
data/bin/setup
CHANGED
File without changes
|
data/constantin.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_dependency "activesupport", "~> 6.
|
30
|
+
spec.add_dependency "activesupport", "~> 6.1.3"
|
31
31
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 2.0"
|
33
33
|
spec.add_development_dependency "rake", ">= 12.3.3"
|
data/lib/constantin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constantin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jude_cali
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.
|
19
|
+
version: 6.1.3
|
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: 6.
|
26
|
+
version: 6.1.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
114
|
+
rubygems_version: 3.2.15
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Handy way to handle constants.
|