media_types 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/debian.yml +43 -43
- data/.github/workflows/publish-bookworm.yml +33 -0
- data/.github/workflows/publish-sid.yml +33 -0
- data/.github/workflows/ruby.yml +22 -22
- data/.gitignore +20 -10
- data/.rubocop.yml +29 -29
- data/CHANGELOG.md +175 -164
- data/Gemfile +6 -6
- data/LICENSE +21 -21
- data/README.md +666 -664
- data/Rakefile +12 -12
- data/bin/console +15 -15
- data/bin/setup +8 -8
- data/lib/media_types/constructable.rb +161 -160
- data/lib/media_types/dsl/errors.rb +18 -18
- data/lib/media_types/dsl.rb +172 -172
- data/lib/media_types/errors.rb +25 -19
- data/lib/media_types/formatter.rb +56 -56
- data/lib/media_types/hash.rb +21 -21
- data/lib/media_types/object.rb +35 -35
- data/lib/media_types/scheme/allow_nil.rb +30 -30
- data/lib/media_types/scheme/any_of.rb +41 -41
- data/lib/media_types/scheme/attribute.rb +46 -46
- data/lib/media_types/scheme/enumeration_context.rb +18 -18
- data/lib/media_types/scheme/enumeration_of_type.rb +80 -80
- data/lib/media_types/scheme/errors.rb +87 -87
- data/lib/media_types/scheme/links.rb +54 -54
- data/lib/media_types/scheme/missing_validation.rb +41 -41
- data/lib/media_types/scheme/not_strict.rb +15 -15
- data/lib/media_types/scheme/output_empty_guard.rb +45 -45
- data/lib/media_types/scheme/output_iterator_with_predicate.rb +66 -66
- data/lib/media_types/scheme/output_type_guard.rb +39 -39
- data/lib/media_types/scheme/rules.rb +186 -173
- data/lib/media_types/scheme/rules_exhausted_guard.rb +73 -73
- data/lib/media_types/scheme/validation_options.rb +44 -43
- data/lib/media_types/scheme.rb +535 -513
- data/lib/media_types/testing/assertions.rb +20 -20
- data/lib/media_types/validations.rb +118 -105
- data/lib/media_types/version.rb +5 -5
- data/lib/media_types/views.rb +12 -12
- data/lib/media_types.rb +73 -73
- data/media_types.gemspec +33 -33
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e73cbda14f6c92ce158da57f61d1bdf88bcda3db508d9c100519f42ba812975
|
4
|
+
data.tar.gz: a051ea9dfcc29933084cfc7d70d1c63edc35ccea7d74d616c8c79f76a75b43eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd93497ea5e07e0371c67d79dff55253eda875ebb5e1ab654bae3ecbca7af916ebd2778642b423fa19d443bba71185798e8fd9a6b73351185fc0538979bae042
|
7
|
+
data.tar.gz: b0e39b7c9124bcc60e4cebecb1af587670f37b29a3b0331c295a74605742ccdd0218fe05840adf2355263ba0ebdcec344fdcb965b8469b463d066c164af46184
|
@@ -1,43 +1,43 @@
|
|
1
|
-
name: Debian
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- "*"
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
build:
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
steps:
|
12
|
-
- uses: actions/checkout@v1
|
13
|
-
- name: Set up Ruby 2.7 (debian ruby)
|
14
|
-
uses: ruby/setup-ruby@
|
15
|
-
with:
|
16
|
-
ruby-version: 2.7
|
17
|
-
- name: Install dependencies
|
18
|
-
run: |
|
19
|
-
sudo apt-get update
|
20
|
-
DEBIAN_FRONTEND=noninteractive sudo apt-get --yes install gem2deb bundler ruby-{actionpack,awesome-print,http,minitest,minitest-reporters,oj,simplecov}
|
21
|
-
rm Gemfile.lock || true
|
22
|
-
bundle install --local
|
23
|
-
sudo apt-file update
|
24
|
-
- name: Build
|
25
|
-
run: |
|
26
|
-
bundle exec rake build
|
27
|
-
mkdir debpkg
|
28
|
-
cp pkg/media_types-*.gem media_types.gem
|
29
|
-
#(cd debpkg; gem2tgz media_types.gem)
|
30
|
-
#(cd debpkg; dh-make-ruby media_types-*.tar.gz)
|
31
|
-
#(cd debpkg; dh-make-ruby media_types-*.tar.gz)
|
32
|
-
(cd pkg; gem2deb media_types*.gem)
|
33
|
-
mv pkg/ruby-media-types_*_all.deb ruby-media-types.deb
|
34
|
-
- name: Upload gem
|
35
|
-
uses: actions/upload-artifact@v1
|
36
|
-
with:
|
37
|
-
name: media_types.gem
|
38
|
-
path: media_types.gem
|
39
|
-
- name: Upload deb
|
40
|
-
uses: actions/upload-artifact@v1
|
41
|
-
with:
|
42
|
-
name: ruby-media-types.deb
|
43
|
-
path: ruby-media-types.deb
|
1
|
+
name: Debian
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- "*"
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
build:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v1
|
13
|
+
- name: Set up Ruby 2.7 (debian ruby)
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: 2.7
|
17
|
+
- name: Install dependencies
|
18
|
+
run: |
|
19
|
+
sudo apt-get update
|
20
|
+
DEBIAN_FRONTEND=noninteractive sudo apt-get --yes install gem2deb bundler ruby-{actionpack,awesome-print,http,minitest,minitest-reporters,oj,simplecov}
|
21
|
+
rm Gemfile.lock || true
|
22
|
+
bundle install --local
|
23
|
+
sudo apt-file update
|
24
|
+
- name: Build
|
25
|
+
run: |
|
26
|
+
bundle exec rake build
|
27
|
+
mkdir debpkg
|
28
|
+
cp pkg/media_types-*.gem media_types.gem
|
29
|
+
#(cd debpkg; gem2tgz media_types.gem)
|
30
|
+
#(cd debpkg; dh-make-ruby media_types-*.tar.gz)
|
31
|
+
#(cd debpkg; dh-make-ruby media_types-*.tar.gz)
|
32
|
+
(cd pkg; gem2deb media_types*.gem)
|
33
|
+
mv pkg/ruby-media-types_*_all.deb ruby-media-types.deb
|
34
|
+
- name: Upload gem
|
35
|
+
uses: actions/upload-artifact@v1
|
36
|
+
with:
|
37
|
+
name: media_types.gem
|
38
|
+
path: media_types.gem
|
39
|
+
- name: Upload deb
|
40
|
+
uses: actions/upload-artifact@v1
|
41
|
+
with:
|
42
|
+
name: ruby-media-types.deb
|
43
|
+
path: ruby-media-types.deb
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Publish debian bookworm packages
|
2
|
+
|
3
|
+
on:
|
4
|
+
- workflow_dispatch
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
publish-bookworm:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
container:
|
10
|
+
image: debian:bookworm
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v3
|
13
|
+
name: Check out repository
|
14
|
+
- name: Install repo
|
15
|
+
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install wget && wget -O key.deb https://deb1.ws.maxmaton.nl/key.deb && DEBIAN_FRONTEND=noninteractive apt-get --yes install ./key.deb && echo "deb [signed-by=/usr/share/keyrings/maxmaton.gpg] http://deb.maxmaton.nl/debian bookworm main non-free" > /etc/apt/sources.list.d/maxmaton.list
|
16
|
+
- name: Install dependencies
|
17
|
+
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install build-essential gem scrypt sshpass gem2deb ruby-actionpack ruby-activesupport ruby-media-types
|
18
|
+
- name: Build gem
|
19
|
+
run: |
|
20
|
+
sed -i -re "s/VERSION\s+=\s+'([0-9]+.[0-9]+.[0-9]+)'/VERSION = '\1.bookworm'/g" lib/media_types/version.rb
|
21
|
+
gem build media_types.gemspec
|
22
|
+
- name: Build deb
|
23
|
+
run: DEBEMAIL=info@delftsolutions.nl gem2deb media_types-*.gem && ls -hal
|
24
|
+
- name: Publish
|
25
|
+
env:
|
26
|
+
PUBLISH_SIGNING_KEY: ${{ secrets.PUBLISH_SIGNING_KEY }}
|
27
|
+
SSHPASS: ${{ secrets.SSHPASS }}
|
28
|
+
run: |
|
29
|
+
echo "deb1.ws.maxmaton.nl ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgN3TiyKvRTj4xBSyQtYz0OuHZYv2i+x3NL+svh2k0SgPr0Xms4Vu+g3AXntXUQGRM0W9zbcZSHiBIWbliv3Y+20f7lKlj9uXUEMHDuiB7Fu7dXObfHswIvTX3XWiPdDeG1jYQbGM3tENX/wtEoixyL++33O69t2SFR5MkPk+/j+zlGLCFf0ypTAMb7bT5NjRNM3+v0LT2WVSZuawA7Fl8WBVTq7MSSuCZIxHIv1kEq6AWpOjWZHNVZrijs+uRTIPcrZ47wSt6tanjAnWT9sAzu8KqcvQsPw9IQwqV1nfQWz0wMit7ijn9B3MrkNHXP5PaNiZQCezsbrh9glhShz0z" > known_hosts
|
30
|
+
echo "deb1.ws.maxmaton.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMr5uAraiRj0pQ9Q9dQO0xMosTzFUAe+VjtMclIUbdJ7r7XMUa3etxh3BfBlW4nq3ZdIFCsV2zwzTaYSmfh95Xs=" >> known_hosts
|
31
|
+
echo "deb1.ws.maxmaton.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhQl7Ik6h7hSQbdo9ZfF78WYFCzch8SAOXFBxxAZH06" >> known_hosts
|
32
|
+
echo "Uploading :" ruby-media-types_*.deb
|
33
|
+
scrypt enc --passphrase "env:PUBLISH_SIGNING_KEY" ruby-media-types_*.deb | sshpass -e ssh -o "UserKnownHostsFile=known_hosts" publish@deb1.ws.maxmaton.nl "echo 'uploading bookworm' && sudo /opt/max/publish-deb ruby-media-types bookworm main && echo 'bookworm done'"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Publish debian sid packages
|
2
|
+
|
3
|
+
on:
|
4
|
+
- workflow_dispatch
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
publish-sid:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
container:
|
10
|
+
image: debian:sid
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v3
|
13
|
+
name: Check out repository
|
14
|
+
- name: Install repo
|
15
|
+
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install wget && wget -O key.deb https://deb1.ws.maxmaton.nl/key.deb && DEBIAN_FRONTEND=noninteractive apt-get --yes install ./key.deb && echo "deb [signed-by=/usr/share/keyrings/maxmaton.gpg] http://deb.maxmaton.nl/debian sid main non-free" > /etc/apt/sources.list.d/maxmaton.list
|
16
|
+
- name: Install dependencies
|
17
|
+
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install build-essential gem scrypt sshpass gem2deb ruby-actionpack ruby-activesupport ruby-media-types
|
18
|
+
- name: Build gem
|
19
|
+
run: |
|
20
|
+
sed -i -re "s/VERSION\s+=\s+'([0-9]+.[0-9]+.[0-9]+)'/VERSION = '\1.sid'/g" lib/media_types/version.rb
|
21
|
+
gem build media_types.gemspec
|
22
|
+
- name: Build deb
|
23
|
+
run: DEBEMAIL=info@delftsolutions.nl gem2deb media_types-*.gem && ls -hal
|
24
|
+
- name: Publish
|
25
|
+
env:
|
26
|
+
PUBLISH_SIGNING_KEY: ${{ secrets.PUBLISH_SIGNING_KEY }}
|
27
|
+
SSHPASS: ${{ secrets.SSHPASS }}
|
28
|
+
run: |
|
29
|
+
echo "deb1.ws.maxmaton.nl ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgN3TiyKvRTj4xBSyQtYz0OuHZYv2i+x3NL+svh2k0SgPr0Xms4Vu+g3AXntXUQGRM0W9zbcZSHiBIWbliv3Y+20f7lKlj9uXUEMHDuiB7Fu7dXObfHswIvTX3XWiPdDeG1jYQbGM3tENX/wtEoixyL++33O69t2SFR5MkPk+/j+zlGLCFf0ypTAMb7bT5NjRNM3+v0LT2WVSZuawA7Fl8WBVTq7MSSuCZIxHIv1kEq6AWpOjWZHNVZrijs+uRTIPcrZ47wSt6tanjAnWT9sAzu8KqcvQsPw9IQwqV1nfQWz0wMit7ijn9B3MrkNHXP5PaNiZQCezsbrh9glhShz0z" > known_hosts
|
30
|
+
echo "deb1.ws.maxmaton.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMr5uAraiRj0pQ9Q9dQO0xMosTzFUAe+VjtMclIUbdJ7r7XMUa3etxh3BfBlW4nq3ZdIFCsV2zwzTaYSmfh95Xs=" >> known_hosts
|
31
|
+
echo "deb1.ws.maxmaton.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhQl7Ik6h7hSQbdo9ZfF78WYFCzch8SAOXFBxxAZH06" >> known_hosts
|
32
|
+
echo "Uploading :" ruby-media-types_*.deb
|
33
|
+
scrypt enc --passphrase "env:PUBLISH_SIGNING_KEY" ruby-media-types_*.deb | sshpass -e ssh -o "UserKnownHostsFile=known_hosts" publish@deb1.ws.maxmaton.nl "echo 'uploading sid' && sudo /opt/max/publish-deb ruby-media-types sid main && echo 'sid done'"
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
name: Ruby
|
2
|
-
|
3
|
-
on: [push]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
build:
|
7
|
-
runs-on: ubuntu-latest
|
8
|
-
|
9
|
-
steps:
|
10
|
-
- uses: actions/checkout@v1
|
11
|
-
- name: Set up Ruby 3.1
|
12
|
-
uses: actions/setup-ruby@v1
|
13
|
-
with:
|
14
|
-
ruby-version: 3.1.x
|
15
|
-
- name: Build and test with Rake
|
16
|
-
run: |
|
17
|
-
sudo apt-get update
|
18
|
-
DEBIAN_FRONTEND=noninteractive sudo apt-get install --yes bundler
|
19
|
-
rm Gemfile.lock || true
|
20
|
-
gem install bundler
|
21
|
-
bundle install --jobs 4 --retry 3
|
22
|
-
bundle exec rake
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v1
|
11
|
+
- name: Set up Ruby 3.1
|
12
|
+
uses: actions/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: 3.1.x
|
15
|
+
- name: Build and test with Rake
|
16
|
+
run: |
|
17
|
+
sudo apt-get update
|
18
|
+
DEBIAN_FRONTEND=noninteractive sudo apt-get install --yes bundler
|
19
|
+
rm Gemfile.lock || true
|
20
|
+
gem install bundler
|
21
|
+
bundle install --jobs 4 --retry 3
|
22
|
+
bundle exec rake
|
data/.gitignore
CHANGED
@@ -1,10 +1,20 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/_yardoc/
|
4
|
-
/coverage/
|
5
|
-
/doc/
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/tmp/
|
9
|
-
|
10
|
-
.idea/
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
10
|
+
.idea/
|
11
|
+
|
12
|
+
/media_types-*.gem
|
13
|
+
/media-types-*.tar.gz
|
14
|
+
/ruby-media-types-*
|
15
|
+
/ruby-media-types_*.deb
|
16
|
+
/ruby-media-types_*.buildinfo
|
17
|
+
/ruby-media-types_*.changes
|
18
|
+
/ruby-media-types_*.debian.tar.xz
|
19
|
+
/ruby-media-types_*.dsc
|
20
|
+
/ruby-media-types_*.orig.tar.gz
|
data/.rubocop.yml
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
AllCops:
|
2
|
-
Include:
|
3
|
-
- "**/Rakefile"
|
4
|
-
- "lib/**/*.rb"
|
5
|
-
Exclude:
|
6
|
-
- "Gemfile"
|
7
|
-
- "bin/**/*"
|
8
|
-
TargetRubyVersion: 3.0
|
9
|
-
|
10
|
-
Layout/EmptyLinesAroundClassBody:
|
11
|
-
Enabled: false
|
12
|
-
|
13
|
-
Layout/EndOfLine:
|
14
|
-
Enabled: false
|
15
|
-
|
16
|
-
Metrics/LineLength:
|
17
|
-
Max: 120
|
18
|
-
|
19
|
-
Metrics/MethodLength:
|
20
|
-
Max: 15
|
21
|
-
|
22
|
-
Style/Documentation:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Style/EmptyMethod:
|
26
|
-
EnforcedStyle: expanded
|
27
|
-
|
28
|
-
Style/IfUnlessModifier:
|
29
|
-
Enabled: false
|
1
|
+
AllCops:
|
2
|
+
Include:
|
3
|
+
- "**/Rakefile"
|
4
|
+
- "lib/**/*.rb"
|
5
|
+
Exclude:
|
6
|
+
- "Gemfile"
|
7
|
+
- "bin/**/*"
|
8
|
+
TargetRubyVersion: 3.0
|
9
|
+
|
10
|
+
Layout/EmptyLinesAroundClassBody:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Layout/EndOfLine:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Metrics/LineLength:
|
17
|
+
Max: 120
|
18
|
+
|
19
|
+
Metrics/MethodLength:
|
20
|
+
Max: 15
|
21
|
+
|
22
|
+
Style/Documentation:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Style/EmptyMethod:
|
26
|
+
EnforcedStyle: expanded
|
27
|
+
|
28
|
+
Style/IfUnlessModifier:
|
29
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,164 +1,175 @@
|
|
1
|
-
# Changelog
|
2
|
-
|
3
|
-
## 2.
|
4
|
-
|
5
|
-
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
-
|
17
|
-
|
18
|
-
## 2.
|
19
|
-
|
20
|
-
-
|
21
|
-
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
- Add
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
-
|
154
|
-
-
|
155
|
-
-
|
156
|
-
-
|
157
|
-
-
|
158
|
-
- Add `
|
159
|
-
- Add
|
160
|
-
- Add
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 2.3.0
|
4
|
+
|
5
|
+
- Add ability to define multiple versions using one block.
|
6
|
+
- Add `index` attribute type that automatically generates a link list compatible with media_types-serialization.
|
7
|
+
- Add support for `collection` to automatically look up a previously defined schema when passing a view.
|
8
|
+
- Add ability to mark certain attributes as optional when validating with `loose: true` and required otherwise.
|
9
|
+
|
10
|
+
## 2.2.0
|
11
|
+
|
12
|
+
- Change dependencies and build output to be debian compatible
|
13
|
+
|
14
|
+
## 2.1.1
|
15
|
+
|
16
|
+
- Fix Ruby 2.6 to 2.7 incompatible change
|
17
|
+
|
18
|
+
## 2.1.0
|
19
|
+
|
20
|
+
- Add `override_suffix` to force a specific suffix
|
21
|
+
- Fix all deprecation warnings
|
22
|
+
|
23
|
+
## 2.0.1
|
24
|
+
|
25
|
+
- Views can now be accessed indifferently.
|
26
|
+
- Attribute keys no longer match indifferently.
|
27
|
+
- Fixed infinite loop when validating non-hash, non-array items.
|
28
|
+
|
29
|
+
## 2.0.0
|
30
|
+
|
31
|
+
- Remove ability to set default suffix. All suffixes now default to `+json`.
|
32
|
+
- Suffixes are now set for a given view and version instead of as a block.
|
33
|
+
- Add `suffix :yoursuffix` command to override the default `:json` suffix.
|
34
|
+
- Remove defaults block.
|
35
|
+
- Remove registrations block.
|
36
|
+
|
37
|
+
## 1.0.0
|
38
|
+
|
39
|
+
- Add the ability to do inline tests when defining validations using `assert_pass '<json>'` and `assert_fail '<json>'`.
|
40
|
+
- `media_type` has been replaced with `use_name`.
|
41
|
+
- It is no longer possible to set a default version. Please use `version <x> do` instead.
|
42
|
+
- You no longer need to specify a custom format string. If you set an organisation with `def self.organisation` or set a module wide organisation with `MediaTypes::set_organisation <module>, '<organisation>'` the library will generate identifiers for you.
|
43
|
+
- `self.base_format` has been replaced by `identifier_format do |type:, view:, version:, suffix:|`.
|
44
|
+
- Add the `empty` validation to mark an empty object as valid.
|
45
|
+
- Add the `identifier` function to get the [Media Type Identifier](https://en.wikipedia.org/wiki/Media_type) for the validator.
|
46
|
+
- Add `version(x)` and `view(x)` functions.
|
47
|
+
- Add an `available_validations` functions that returns all defined validations.
|
48
|
+
- Fix an issue where validations could accidentally merge if defined with a bad `base_format`.
|
49
|
+
- Fix an issue where undefined validations would accept an empty object.
|
50
|
+
|
51
|
+
## 0.6.2
|
52
|
+
|
53
|
+
- Fix handling empty collections
|
54
|
+
|
55
|
+
## 0.6.1
|
56
|
+
|
57
|
+
- Fix no `validations` error on `validatable?` (now returns `false`)
|
58
|
+
- Update `bundler` to `2.x`
|
59
|
+
|
60
|
+
## 0.6.0
|
61
|
+
|
62
|
+
- Change default expected type for `attribute` to Object
|
63
|
+
- Remove default `actionpack` calls for `.register`
|
64
|
+
- Add integration for registering with `actionpack` (rails)
|
65
|
+
- Add integration for registering with `http` (http.rb)
|
66
|
+
- Fix stack overflow for cyclic schema
|
67
|
+
|
68
|
+
## 0.5.5
|
69
|
+
|
70
|
+
- Fix an issue with `attribute(optional:, &block)` not passing `optional:` to the created `collection`.
|
71
|
+
|
72
|
+
## 0.5.4
|
73
|
+
|
74
|
+
- Fix formatter reworked template when fields are not present
|
75
|
+
|
76
|
+
## 0.5.3
|
77
|
+
|
78
|
+
- Remove `require 'awesome_print'` in library code as it's marked as a development dependency onlvy
|
79
|
+
|
80
|
+
## 0.5.2
|
81
|
+
|
82
|
+
- Add requires in files with missing requires
|
83
|
+
|
84
|
+
## 0.5.1
|
85
|
+
|
86
|
+
- Fix merging optional attributes
|
87
|
+
- Change `#inspect` to look like a tree
|
88
|
+
|
89
|
+
## 0.5.0
|
90
|
+
|
91
|
+
- Change internal representation of key to symbol
|
92
|
+
- Change default type from `nil` to `Object`, removing special behaviour for nil
|
93
|
+
- Add `Rules` class to handle normalization of keys and handling `rules` (`Scheme`, `Attribute`, etc)
|
94
|
+
- Add guard classes to handle guard behaviour (`OutputEmptyGuard`, `OutputTypeGuard` and `RulesExhaustedGuard`)
|
95
|
+
- Add `optional:` keywords to most dsl (`attribute`, `collection`, `any`, `link`)
|
96
|
+
- Add `Formatter` class to handle formatting of the `Constructable#to_s`
|
97
|
+
- Add behaviour to strip leading dot (`.`) or plus (`+`) from `+%<var>` if `var` is nil, fixing weird media types
|
98
|
+
- Add behaviour to remove format variable values if format variable is not present, fixing warnings
|
99
|
+
- Add `inspect` for most public classes
|
100
|
+
- Add second argument for type or scheme to `any` dsl, mimicking `collection`
|
101
|
+
- Add tests for most dsl, common permutations
|
102
|
+
- Rename `force` to `expected_type`
|
103
|
+
- Remove `format_view` behaviour where it adds a dot (`.`) if a view is present
|
104
|
+
- Remove special iteration behaviour for `Links` (`link` dsl), allowing them to be optional, or non-exhaustive
|
105
|
+
- Raise error if `self.base_format` is not available at time of `Dsl.media_type` call
|
106
|
+
- Fix `expected_type` guard for arrays, nil, or arrays with nil.
|
107
|
+
|
108
|
+
## 0.4.1
|
109
|
+
|
110
|
+
- Use strings for `:_links`, matching the other validation keys
|
111
|
+
|
112
|
+
## 0.4.0
|
113
|
+
|
114
|
+
- Simplify `assert_media_type_format` by dumping views completely
|
115
|
+
- Add test for `merge`
|
116
|
+
- Add test for nested blocks in `validations` using `view` and `version` nesting
|
117
|
+
- Add test for `validatable?`
|
118
|
+
- Add block passing to `Scheme.new`
|
119
|
+
|
120
|
+
## 0.3.0
|
121
|
+
|
122
|
+
- Add `merge` dsl to merge two `Scheme`
|
123
|
+
|
124
|
+
## 0.2.6
|
125
|
+
|
126
|
+
- Change validation to accept both symbolised and stringified input ánd validations
|
127
|
+
|
128
|
+
## 0.2.5
|
129
|
+
|
130
|
+
- Add automatic require for `media_types/scheme/any_of`
|
131
|
+
|
132
|
+
## 0.2.4
|
133
|
+
|
134
|
+
- Change messages for `assert_media_types_registered` to be more informative and consistent
|
135
|
+
|
136
|
+
## 0.2.3
|
137
|
+
|
138
|
+
- Fix an issue with `Hash#compact` which was introduce in 2.4+. Now works with Ruby 2.3
|
139
|
+
|
140
|
+
## 0.2.2
|
141
|
+
|
142
|
+
- Fix an issue with `Registrar#versions`
|
143
|
+
- Fix link in the gemspec to Github
|
144
|
+
|
145
|
+
## 0.2.1
|
146
|
+
|
147
|
+
- Fix an issue with `Constructable#valid?` and `Constructable#validate!`
|
148
|
+
|
149
|
+
## 0.2.0
|
150
|
+
|
151
|
+
Breaking changes to update public API and usage
|
152
|
+
|
153
|
+
- Remove `Base` class (use `MediaTypes::Dsl` instead)
|
154
|
+
- Remove a lot of configuration options as they are deemed unneeded
|
155
|
+
- Remove `active_support` dependency
|
156
|
+
- Rename `ConstructableMimeType` to `Constructable`
|
157
|
+
- Moved global scheme types to `Scheme` as subtype
|
158
|
+
- Add `MediaTypes::Dsl`
|
159
|
+
- Add `validations` block to capture schemes
|
160
|
+
- Add `registrations` block to capture register intent
|
161
|
+
- Add `defaults` block to capture mime type defaults
|
162
|
+
- Add `MediaTypes.register` class method to call `Mime::Type.register`
|
163
|
+
- Add `Registerable` capture class
|
164
|
+
- Add type / base setting for `Constructable`
|
165
|
+
- Add versioned validations
|
166
|
+
- Add forced types of `collection`s
|
167
|
+
- Add `attribute` with block
|
168
|
+
- Add `EnumerationOfType` for schema typed arrays
|
169
|
+
- Add `AnyOf` for scheme enum types
|
170
|
+
- Add non-block calls for `Scheme` dsl
|
171
|
+
- Add yard documentation to `/docs`
|
172
|
+
|
173
|
+
## 0.1.0
|
174
|
+
|
175
|
+
:baby: initial release
|