json_schematize 0.6.0 → 0.6.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: 7db5a295c8de919a0eb55d2894094d8c5c97f932b0955495c31ed762e84133f8
4
- data.tar.gz: a8dc99a3affdf8027d9ec4bde5e689e84b18d1571ba126e54cb806d484ad8fb2
3
+ metadata.gz: d0b80648f60c06f94a7530ba812d49891e57d28549cd63f1ba42e7adfd74cb03
4
+ data.tar.gz: 0b97d3b638941ce37b2907640840759fc9462df4447d04f3828847bcb580aa8d
5
5
  SHA512:
6
- metadata.gz: 4de0766c2fb072d96908c1cb66e7611c79db5635cfc046b51d90ad40a8d732d0fe086e62e1b243b0813d90b48e9607198c854624544e2e05b7bbd8a59dd7fb2b
7
- data.tar.gz: ce9fa6fdda05e251c7ec45cbff00a22f7aba3ce28f31820f682da05676584defdf491540d5cddd17e26697d572665081781430be7dcaa87723d7466f975f2560
6
+ metadata.gz: cb8ac2f474f45303d6c9f17924ba1a92de71cb6cd645382ec12579e2d69274039ba8bc67c528c08f3fad0f2103265ac2792c8c88f12aec37b754b47a61f71691
7
+ data.tar.gz: 3f49f060c7fbcefd0705256e23853eb4220c5d63636c75be1e15f721b3fa2d0d631965424101e69cee1c4108d1976191a4717d1643ff15250a746b48d0794002
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- json_schematize (0.6.0)
4
+ json_schematize (0.6.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Matt Taylor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,7 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class JsonSchematize::Base
4
- def self.acceptable_types
5
- raise NoMethodError, "Expected acceptable_values to be defined in parent class"
3
+ module JsonSchematize
4
+ class Base
5
+ def self.acceptable_types
6
+ raise NoMethodError, "Expected acceptable_values to be defined in parent class"
7
+ end
6
8
  end
7
9
  end
@@ -2,18 +2,20 @@
2
2
 
3
3
  require "json_schematize/base"
4
4
 
5
- class JsonSchematize::Boolean < JsonSchematize::Base
6
- FALSE_VALUES = ["false", "f", "0", false]
7
- TRUE_VALUES = ["true", "t", "1", true]
5
+ module JsonSchematize
6
+ class Boolean < JsonSchematize::Base
7
+ FALSE_VALUES = ["false", "f", "0", false]
8
+ TRUE_VALUES = ["true", "t", "1", true]
8
9
 
9
- def self.new(val)
10
- return false if FALSE_VALUES.include?(val)
11
- return true if TRUE_VALUES.include?(val)
10
+ def self.new(val)
11
+ return false if FALSE_VALUES.include?(val)
12
+ return true if TRUE_VALUES.include?(val)
12
13
 
13
- raise JsonSchematize::UndefinedBoolean, "#{val} is not a valid #{self.class}"
14
- end
14
+ raise JsonSchematize::UndefinedBoolean, "#{val} is not a valid #{self.class}"
15
+ end
15
16
 
16
- def self.acceptable_types
17
- [TrueClass, FalseClass]
17
+ def self.acceptable_types
18
+ [TrueClass, FalseClass]
19
+ end
18
20
  end
19
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonSchematize
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.1"
5
5
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "json_schematize/version"
4
+
3
5
  require "json_schematize/base"
4
6
  require "json_schematize/boolean"
5
7
  require "json_schematize/generator"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_schematize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Taylor
@@ -82,6 +82,7 @@ files:
82
82
  - Dockerfile
83
83
  - Gemfile
84
84
  - Gemfile.lock
85
+ - LICENSE
85
86
  - Makefile
86
87
  - README.md
87
88
  - bin/console