easy_talk 0.1.0 → 0.1.2

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: 6fcc0c59463e51453f3a5242447abf42b06ea093e6573b3c887136e3036ad963
4
- data.tar.gz: 62aea206f5db132804b9ceae927f3de2f2eefc429e137ff121b325b689eb458f
3
+ metadata.gz: 64c3d125d05981a0e2d01d1ccaa62a235f4d032ca95f3ee0b54667c13952850b
4
+ data.tar.gz: 0e24c433ee18e83cf979d9702af4e85091963f308feffcce09ed3d1b80fd94ce
5
5
  SHA512:
6
- metadata.gz: 8996f94f698b255160f318add11bab15b4b182a1127919885196d5ace961ca41f092a4d1f28eed553ed6848b36b3ae75ae49bbe82b5dbb60c32c89b75263b1c7
7
- data.tar.gz: 4b81dc4128e4f9455d7bf7c814957e5ed38989ce5cd3de63ed5d2deb789706a360af1df16ded68f6ae0cbf1ec1ab728cac9216f71e3e9cda6250953620b5c235
6
+ metadata.gz: 96a1eab7a194cce4067680550269cd277aa7f75ccfdf710d0f34b5a5381505067896a8cb1cdff9c82b866684dac0f78515fbb0a258628c94991358babfcc26a0
7
+ data.tar.gz: fad9245949080abdb1f72581d924c5b7df17529f8d94fab6ede4a4fc9bb46d013cd6b3d9cee787b4953c9947931bfb40d963494b968f681dad2e90f038708c53
data/CHANGELOG.md CHANGED
@@ -0,0 +1,5 @@
1
+ ## [0.1.1] - 2024-02-10
2
+ - Removed pry-byebug.
3
+
4
+ ## [0.1.0] - 2024-04-09
5
+ - Initial release
data/easy_talk.gemspec CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.require_paths = ['lib']
33
33
 
34
34
  spec.add_dependency 'activesupport', '~> 6.0'
35
+ spec.add_dependency 'json-schema', '~> 2.8'
35
36
  spec.add_dependency 'sorbet-runtime'
36
37
  spec.add_development_dependency 'pry-byebug', '>= 3.10.1'
37
38
  spec.add_development_dependency 'rake', '~> 13.1'
@@ -6,6 +6,7 @@ require 'active_support/core_ext'
6
6
  require 'active_support/time'
7
7
  require 'active_support/concern'
8
8
  require 'active_support/json'
9
+ require 'json-schema'
9
10
  require_relative 'builder'
10
11
  require_relative 'schema_definition'
11
12
 
@@ -81,11 +82,15 @@ module EasyTalk
81
82
  "#/$defs/#{name}"
82
83
  end
83
84
 
85
+ def validate_json(json)
86
+ JSON::Validator.validate(json_schema, json)
87
+ end
88
+
84
89
  # Returns the JSON schema for the model.
85
90
  def json_schema
86
91
  @json_schema ||= begin
87
92
  schema = Builder.new(schema_definition).schema
88
- schema.to_json
93
+ schema.as_json
89
94
  end
90
95
  end
91
96
 
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pry-byebug'
4
3
  require_relative 'keywords'
5
4
 
6
5
  module EasyTalk
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyTalk
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  end
data/lib/easy_talk.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  # The EasyTalk module is the main namespace for the gem.
4
4
  module EasyTalk
5
5
  class Error < StandardError; end
6
- require 'pry-byebug'
7
6
  require 'sorbet-runtime'
8
7
  require 'easy_talk/sorbet_extension'
9
8
  require 'easy_talk/types/any_of'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_talk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Bayona
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-09 00:00:00.000000000 Z
11
+ date: 2024-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json-schema
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.8'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sorbet-runtime
29
43
  requirement: !ruby/object:Gem::Requirement