schemacop 3.0.3 → 3.0.4

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: 8beb01b4d3fc6d20f2179d2e44086b534d50b673248635d19782fba609737ce3
4
- data.tar.gz: e905b06d0f7bed58cf5a1247a4ec4a201fe053241516aa6269275b87ef41ba31
3
+ metadata.gz: 2b28a407ae498b94fa8c7897895d052c1bea34ebeee991ab992b4a86aa94f7ab
4
+ data.tar.gz: 7bd4dbd4f0a51ac591a7ff6189fd98e803597c0487f8a16e43c78774dc75c5e3
5
5
  SHA512:
6
- metadata.gz: 2418e8eacb3854f85b8fa4689d3a4819d4b6ff76aedb0910c5e7b2f41566d15339347e5890e46588f4d8859f79594bd049988d669e9c3486d4bef4db06733fa7
7
- data.tar.gz: 26e0d958b4509fa5376703d17bc00ca05d28fc39fc631a26e2444356065e3c2f80982aa8411b89d197bccafa4a18023aaf3933221be347e1030973e8f64af5e4
6
+ metadata.gz: b40fb214b50815f65f87f978052f0c6bc38018340d00eeeddb68e392dfb44106e0d6ebeb5e908172113dadc57cd0f88bbdf1d230d38cd5dab31382f8d217f34a
7
+ data.tar.gz: cf87908ded44c22bd53b824e732f7447ade01608104cb55a844879fb7f17b2172b78c13b47adb0f373abbba3a90f75d353cf0f63ec5d74b16128eee780743db6
data/CHANGELOG.md CHANGED
@@ -10,6 +10,11 @@
10
10
  ### Changes
11
11
  -->
12
12
 
13
+ ## 3.0.4 (2021-02-15)
14
+
15
+ * Add `examples_keyword` to context which allows to customize the name of the
16
+ `examples` attribute in JSON output
17
+
13
18
  ## 3.0.3 (2021-02-15)
14
19
 
15
20
  * Fix boolean node casting
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.3
1
+ 3.0.4
@@ -2,9 +2,13 @@ module Schemacop
2
2
  module V3
3
3
  class Context
4
4
  attr_accessor :schemas
5
+ attr_accessor :examples_keyword
6
+
7
+ DEFAULT_EXAMPLES_KEYWORD = :examples
5
8
 
6
9
  def initialize
7
10
  @schemas = {}.with_indifferent_access.freeze
11
+ @examples_keyword = DEFAULT_EXAMPLES_KEYWORD
8
12
  end
9
13
 
10
14
  def schema(name, type = :hash, **options, &block)
@@ -170,7 +170,7 @@ module Schemacop
170
170
  end
171
171
 
172
172
  json[:title] = @title if @title
173
- json[:examples] = @examples if @examples
173
+ json[Schemacop.context.examples_keyword] = @examples if @examples
174
174
  json[:description] = @description if @description
175
175
  json[:default] = @default if @default
176
176
  json[:enum] = @enum.to_a if @enum
data/schemacop.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: schemacop 3.0.3 ruby lib
2
+ # stub: schemacop 3.0.4 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "schemacop".freeze
6
- s.version = "3.0.3"
6
+ s.version = "3.0.4"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schemacop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sitrox
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2021-02-15 00:00:00.000000000 Z
@@ -164,8 +164,8 @@ dependencies:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.21.2
167
- description:
168
- email:
167
+ description:
168
+ email:
169
169
  executables: []
170
170
  extensions: []
171
171
  extra_rdoc_files: []
@@ -277,7 +277,7 @@ homepage: https://github.com/sitrox/schemacop
277
277
  licenses:
278
278
  - MIT
279
279
  metadata: {}
280
- post_install_message:
280
+ post_install_message:
281
281
  rdoc_options: []
282
282
  require_paths:
283
283
  - lib
@@ -292,8 +292,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.0.3
296
- signing_key:
295
+ rubygems_version: 3.1.4
296
+ signing_key:
297
297
  specification_version: 4
298
298
  summary: Schemacop validates ruby structures consisting of nested hashes and arrays
299
299
  against simple schema definitions.