media_types 2.3.0 → 2.3.2
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 +34 -33
- data/.github/workflows/publish-sid.yml +34 -33
- data/.github/workflows/ruby.yml +22 -22
- data/.gitignore +20 -20
- data/.rubocop.yml +29 -29
- data/CHANGELOG.md +183 -175
- data/Gemfile +6 -6
- data/Gemfile.lock +43 -43
- data/LICENSE +21 -21
- data/README.md +666 -666
- data/Rakefile +12 -12
- data/bin/console +15 -15
- data/bin/setup +8 -8
- data/lib/media_types/constructable.rb +161 -161
- data/lib/media_types/dsl/errors.rb +18 -18
- data/lib/media_types/dsl.rb +172 -172
- data/lib/media_types/errors.rb +25 -25
- 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 -186
- data/lib/media_types/scheme/rules_exhausted_guard.rb +75 -73
- data/lib/media_types/scheme/validation_options.rb +44 -44
- data/lib/media_types/scheme.rb +535 -535
- data/lib/media_types/testing/assertions.rb +20 -20
- data/lib/media_types/validations.rb +118 -118
- 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 +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1142ee3380c374e5f49563e0bc5dd52d379b1d5f0971f32573d1c4e508da8a53
|
4
|
+
data.tar.gz: 1110579b304aeaaa2cdf1c78c9083df5dae0c42a903daf448c5f8c3abea77c41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c91d590c74715eaf9d5cc705f9fc8cc1c8777fd32aaabd0a155548dc04c1c22426a5cd387803116956d8665465ec9ff5bee8c3f81140acb649e3a74821c449f
|
7
|
+
data.tar.gz: 520d8fa98570b498aaeae73168ea6e2c286fa918936874030eb16d42901e81a4431c10c2af168594f33c01e677f00ce46f2d7b9bd993051aaa634231ab70bf61
|
@@ -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@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
|
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
|
@@ -1,33 +1,34 @@
|
|
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
|
-
-
|
13
|
-
|
14
|
-
- name: Install
|
15
|
-
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install
|
16
|
-
-
|
17
|
-
|
18
|
-
- name: Build gem
|
19
|
-
run: |
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
echo "deb1.ws.maxmaton.nl
|
31
|
-
echo "deb1.ws.maxmaton.nl
|
32
|
-
echo "
|
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
|
+
- name: Install repo
|
13
|
+
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
|
14
|
+
- name: Install dependencies
|
15
|
+
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install git build-essential gem scrypt sshpass gem2deb ruby-actionpack ruby-activesupport
|
16
|
+
- uses: actions/checkout@v3
|
17
|
+
name: Check out repository
|
18
|
+
- name: Build gem
|
19
|
+
run: |
|
20
|
+
git config --global --add safe.directory "$(pwd)"
|
21
|
+
sed -i -re "s/VERSION\s+=\s+'([0-9]+.[0-9]+.[0-9]+)'/VERSION = '\1.bookworm'/g" lib/media_types/version.rb
|
22
|
+
gem build media_types.gemspec
|
23
|
+
- name: Build deb
|
24
|
+
run: DEBEMAIL=info@delftsolutions.nl gem2deb media_types-*.gem && ls -hal
|
25
|
+
- name: Publish
|
26
|
+
env:
|
27
|
+
PUBLISH_SIGNING_KEY: ${{ secrets.PUBLISH_SIGNING_KEY }}
|
28
|
+
SSHPASS: ${{ secrets.SSHPASS }}
|
29
|
+
run: |
|
30
|
+
echo "deb1.ws.maxmaton.nl ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgN3TiyKvRTj4xBSyQtYz0OuHZYv2i+x3NL+svh2k0SgPr0Xms4Vu+g3AXntXUQGRM0W9zbcZSHiBIWbliv3Y+20f7lKlj9uXUEMHDuiB7Fu7dXObfHswIvTX3XWiPdDeG1jYQbGM3tENX/wtEoixyL++33O69t2SFR5MkPk+/j+zlGLCFf0ypTAMb7bT5NjRNM3+v0LT2WVSZuawA7Fl8WBVTq7MSSuCZIxHIv1kEq6AWpOjWZHNVZrijs+uRTIPcrZ47wSt6tanjAnWT9sAzu8KqcvQsPw9IQwqV1nfQWz0wMit7ijn9B3MrkNHXP5PaNiZQCezsbrh9glhShz0z" > known_hosts
|
31
|
+
echo "deb1.ws.maxmaton.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMr5uAraiRj0pQ9Q9dQO0xMosTzFUAe+VjtMclIUbdJ7r7XMUa3etxh3BfBlW4nq3ZdIFCsV2zwzTaYSmfh95Xs=" >> known_hosts
|
32
|
+
echo "deb1.ws.maxmaton.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhQl7Ik6h7hSQbdo9ZfF78WYFCzch8SAOXFBxxAZH06" >> known_hosts
|
33
|
+
echo "Uploading :" ruby-media-types_*.deb
|
34
|
+
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'"
|
@@ -1,33 +1,34 @@
|
|
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
|
-
-
|
13
|
-
|
14
|
-
- name: Install
|
15
|
-
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install
|
16
|
-
-
|
17
|
-
|
18
|
-
- name: Build gem
|
19
|
-
run: |
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
echo "deb1.ws.maxmaton.nl
|
31
|
-
echo "deb1.ws.maxmaton.nl
|
32
|
-
echo "
|
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
|
+
- name: Install repo
|
13
|
+
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
|
14
|
+
- name: Install dependencies
|
15
|
+
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install git build-essential gem scrypt sshpass gem2deb ruby-actionpack ruby-activesupport
|
16
|
+
- uses: actions/checkout@v3
|
17
|
+
name: Check out repository
|
18
|
+
- name: Build gem
|
19
|
+
run: |
|
20
|
+
git config --global --add safe.directory "$(pwd)"
|
21
|
+
sed -i -re "s/VERSION\s+=\s+'([0-9]+.[0-9]+.[0-9]+)'/VERSION = '\1.sid'/g" lib/media_types/version.rb
|
22
|
+
gem build media_types.gemspec
|
23
|
+
- name: Build deb
|
24
|
+
run: DEBEMAIL=info@delftsolutions.nl gem2deb media_types-*.gem && ls -hal
|
25
|
+
- name: Publish
|
26
|
+
env:
|
27
|
+
PUBLISH_SIGNING_KEY: ${{ secrets.PUBLISH_SIGNING_KEY }}
|
28
|
+
SSHPASS: ${{ secrets.SSHPASS }}
|
29
|
+
run: |
|
30
|
+
echo "deb1.ws.maxmaton.nl ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgN3TiyKvRTj4xBSyQtYz0OuHZYv2i+x3NL+svh2k0SgPr0Xms4Vu+g3AXntXUQGRM0W9zbcZSHiBIWbliv3Y+20f7lKlj9uXUEMHDuiB7Fu7dXObfHswIvTX3XWiPdDeG1jYQbGM3tENX/wtEoixyL++33O69t2SFR5MkPk+/j+zlGLCFf0ypTAMb7bT5NjRNM3+v0LT2WVSZuawA7Fl8WBVTq7MSSuCZIxHIv1kEq6AWpOjWZHNVZrijs+uRTIPcrZ47wSt6tanjAnWT9sAzu8KqcvQsPw9IQwqV1nfQWz0wMit7ijn9B3MrkNHXP5PaNiZQCezsbrh9glhShz0z" > known_hosts
|
31
|
+
echo "deb1.ws.maxmaton.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMr5uAraiRj0pQ9Q9dQO0xMosTzFUAe+VjtMclIUbdJ7r7XMUa3etxh3BfBlW4nq3ZdIFCsV2zwzTaYSmfh95Xs=" >> known_hosts
|
32
|
+
echo "deb1.ws.maxmaton.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhQl7Ik6h7hSQbdo9ZfF78WYFCzch8SAOXFBxxAZH06" >> known_hosts
|
33
|
+
echo "Uploading :" ruby-media-types_*.deb
|
34
|
+
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,20 +1,20 @@
|
|
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
|
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
|