media_types 0.2.6 → 0.3.0

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
  SHA1:
3
- metadata.gz: 02d7fc6698f9ffe3657e4002aeb8d6b1d22ea5a6
4
- data.tar.gz: 94eb2b298ca505165c87c5f40244738964e3c511
3
+ metadata.gz: c5674ca1175e8811375a3d065219c87cb8268e86
4
+ data.tar.gz: d945dc4c4326960d717be6f14350856b5bf596b2
5
5
  SHA512:
6
- metadata.gz: bb55aecfd55b0d0067b806b2ba090626a6090a011823b0b4a89396f7e8bb55bdac514fe0f3c21e7479df440eb51450940a79f6a39e9e3bd80a74c9ae3078b1a6
7
- data.tar.gz: 30c78ced61aa8154cbb877787218025aaf33e74aaa9b9ed45bafa79a098bf9907ef193f8b825ded09921bdfcda387a4a29c97414528f101cfc8376f59477e78b
6
+ metadata.gz: 95cab60688688522ed99735dfd030f133ef0a49ffe18cbaffad9dcde6f596c56a12446dadb9973803f77147b70ecf56e81a84ccb05d0260e0ac677edff1f78b1
7
+ data.tar.gz: 219f62fb2a2c249326ae71e37dc7098db3b70b7e6f7af81509abf2afc0d5dd8782e7b7b7d360912b6553df86c9e2cb2777b6ee0759285e770865fc12dc13f95b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.3.0
2
+
3
+ - Add `merge` dsl to merge two `Scheme`
4
+
1
5
  # 0.2.6
2
6
 
3
7
  - Change validation to accept both symbolised and stringified input ánd validations
@@ -8,11 +12,11 @@
8
12
 
9
13
  # 0.2.4
10
14
 
11
- - Change messages for `assert_media_types_registered` to be more informative and consistent.
15
+ - Change messages for `assert_media_types_registered` to be more informative and consistent
12
16
 
13
17
  # 0.2.3
14
18
 
15
- - Fix an issue with `Hash#compact` which was introduce in 2.4+. Now works with Ruby 2.3.
19
+ - Fix an issue with `Hash#compact` which was introduce in 2.4+. Now works with Ruby 2.3
16
20
 
17
21
  # 0.2.2
18
22
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- media_types (0.2.6)
4
+ media_types (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -219,6 +219,16 @@ module MediaTypes
219
219
  validations.default = scheme
220
220
  end
221
221
 
222
+ ##
223
+ # Merges a +scheme+ into this scheme without changing the incoming +scheme+
224
+ #
225
+ # @param [Scheme] scheme the scheme to merge into this
226
+ #
227
+ def merge(scheme, &block)
228
+ self.validations = validations.merge(scheme.send(:validations).dup)
229
+ instance_exec(&block) if block_given?
230
+ end
231
+
222
232
  ##
223
233
  # Allow for extra keys in the schema/collection even when passing strict: true to #validate!
224
234
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MediaTypes
4
- VERSION = '0.2.6'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: media_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derk-Jan Karrenbeld