media_types 0.2.6 → 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/CHANGELOG.md +6 -2
- data/Gemfile.lock +1 -1
- data/lib/media_types/scheme.rb +10 -0
- data/lib/media_types/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5674ca1175e8811375a3d065219c87cb8268e86
|
4
|
+
data.tar.gz: d945dc4c4326960d717be6f14350856b5bf596b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/media_types/scheme.rb
CHANGED
@@ -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
|
#
|
data/lib/media_types/version.rb
CHANGED