media_types 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +10 -10
- data/.travis.yml +0 -1
- data/CHANGELOG.md +6 -1
- data/Gemfile +6 -6
- data/Gemfile.lock +28 -24
- data/README.md +9 -2
- data/Rakefile +12 -12
- data/lib/media_types/dsl.rb +2 -0
- data/lib/media_types/version.rb +1 -1
- data/media_types.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1f24bfe6e322e33b8fa5bfb4af2df6d7af751cd81f85830477a73777e5ca9b96
|
4
|
+
data.tar.gz: 3936ae9836750c1fbb136efe0995df8214393380f990032d7b0e1e0d8787441c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50b0ed65d73f88590394327ecf7ae2e51c33dbf68faad099f6e880ec8bde4de17c698da9229d8f7cb0cc0b4ca1de7922475d0ae424caf04d78c4b50a2da8d3d4
|
7
|
+
data.tar.gz: 885a33a8888c23aa2e4aaf903432464cfc435efeeaa360d10e9d85fbae65ee547ec56db7c93bf5292ebc0cf662a5299eaae20abd3072e5a08ce3442caf9906fc
|
data/.gitignore
CHANGED
@@ -1,10 +1,10 @@
|
|
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/
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# 0.6.1
|
2
|
+
|
3
|
+
- Fix no `validations` error on `validatable?` (now returns `false`)
|
4
|
+
- Update `bundler` to `2.x`
|
5
|
+
|
1
6
|
# 0.6.0
|
2
7
|
|
3
8
|
- Change default expected type for `attribute` to Object
|
@@ -16,7 +21,7 @@
|
|
16
21
|
|
17
22
|
# 0.5.3
|
18
23
|
|
19
|
-
- Remove `require 'awesome_print'` in library code as it's marked as a development dependency
|
24
|
+
- Remove `require 'awesome_print'` in library code as it's marked as a development dependency onlvy
|
20
25
|
|
21
26
|
# 0.5.2
|
22
27
|
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in media_types.gemspec
|
6
|
-
gemspec
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in media_types.gemspec
|
6
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
media_types (0.6.
|
4
|
+
media_types (0.6.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
actionpack (5.2.
|
10
|
-
actionview (= 5.2.
|
11
|
-
activesupport (= 5.2.
|
9
|
+
actionpack (5.2.2)
|
10
|
+
actionview (= 5.2.2)
|
11
|
+
activesupport (= 5.2.2)
|
12
12
|
rack (~> 2.0)
|
13
13
|
rack-test (>= 0.6.3)
|
14
14
|
rails-dom-testing (~> 2.0)
|
15
15
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
16
|
-
actionview (5.2.
|
17
|
-
activesupport (= 5.2.
|
16
|
+
actionview (5.2.2)
|
17
|
+
activesupport (= 5.2.2)
|
18
18
|
builder (~> 3.1)
|
19
19
|
erubi (~> 1.4)
|
20
20
|
rails-dom-testing (~> 2.0)
|
21
21
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
22
|
-
activesupport (5.2.
|
22
|
+
activesupport (5.2.2)
|
23
23
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
24
24
|
i18n (>= 0.7, < 2)
|
25
25
|
minitest (~> 5.1)
|
26
26
|
tzinfo (~> 1.1)
|
27
|
-
addressable (2.
|
27
|
+
addressable (2.6.0)
|
28
28
|
public_suffix (>= 2.0.2, < 4.0)
|
29
29
|
ansi (1.5.0)
|
30
30
|
awesome_print (1.8.0)
|
31
31
|
builder (3.2.3)
|
32
|
-
concurrent-ruby (1.
|
32
|
+
concurrent-ruby (1.1.4)
|
33
33
|
crass (1.0.4)
|
34
34
|
docile (1.3.1)
|
35
35
|
domain_name (0.5.20180417)
|
36
36
|
unf (>= 0.0.5, < 1.0.0)
|
37
|
-
erubi (1.
|
38
|
-
http (
|
37
|
+
erubi (1.8.0)
|
38
|
+
http (4.0.5)
|
39
39
|
addressable (~> 2.3)
|
40
40
|
http-cookie (~> 1.0)
|
41
41
|
http-form_data (~> 2.0)
|
@@ -44,26 +44,28 @@ GEM
|
|
44
44
|
domain_name (~> 0.5)
|
45
45
|
http-form_data (2.1.1)
|
46
46
|
http_parser.rb (0.6.0)
|
47
|
-
i18n (1.
|
47
|
+
i18n (1.6.0)
|
48
48
|
concurrent-ruby (~> 1.0)
|
49
|
-
json (2.
|
50
|
-
loofah (2.2.
|
49
|
+
json (2.2.0)
|
50
|
+
loofah (2.2.3)
|
51
51
|
crass (~> 1.0.2)
|
52
52
|
nokogiri (>= 1.5.9)
|
53
|
-
mini_portile2 (2.
|
53
|
+
mini_portile2 (2.4.0)
|
54
54
|
minitest (5.11.3)
|
55
55
|
minitest-ci (3.4.0)
|
56
56
|
minitest (>= 5.0.6)
|
57
|
-
minitest-reporters (1.3.
|
57
|
+
minitest-reporters (1.3.6)
|
58
58
|
ansi
|
59
59
|
builder
|
60
60
|
minitest (>= 5.0)
|
61
61
|
ruby-progressbar
|
62
|
-
nokogiri (1.
|
63
|
-
mini_portile2 (~> 2.
|
64
|
-
|
62
|
+
nokogiri (1.10.1)
|
63
|
+
mini_portile2 (~> 2.4.0)
|
64
|
+
nokogiri (1.10.1-x64-mingw32)
|
65
|
+
mini_portile2 (~> 2.4.0)
|
66
|
+
oj (3.7.9)
|
65
67
|
public_suffix (3.0.3)
|
66
|
-
rack (2.0.
|
68
|
+
rack (2.0.6)
|
67
69
|
rack-test (1.1.0)
|
68
70
|
rack (>= 1.0, < 3)
|
69
71
|
rails-dom-testing (2.0.3)
|
@@ -71,7 +73,7 @@ GEM
|
|
71
73
|
nokogiri (>= 1.6)
|
72
74
|
rails-html-sanitizer (1.0.4)
|
73
75
|
loofah (~> 2.2, >= 2.2.2)
|
74
|
-
rake (
|
76
|
+
rake (12.3.2)
|
75
77
|
ruby-progressbar (1.10.0)
|
76
78
|
simplecov (0.16.1)
|
77
79
|
docile (~> 1.1)
|
@@ -83,23 +85,25 @@ GEM
|
|
83
85
|
thread_safe (~> 0.1)
|
84
86
|
unf (0.1.4)
|
85
87
|
unf_ext
|
88
|
+
unf_ext (0.0.7.5)
|
86
89
|
unf_ext (0.0.7.5-x64-mingw32)
|
87
90
|
|
88
91
|
PLATFORMS
|
92
|
+
ruby
|
89
93
|
x64-mingw32
|
90
94
|
|
91
95
|
DEPENDENCIES
|
92
96
|
actionpack
|
93
97
|
awesome_print
|
94
|
-
bundler (~>
|
98
|
+
bundler (~> 2)
|
95
99
|
http
|
96
100
|
media_types!
|
97
101
|
minitest (~> 5.0)
|
98
102
|
minitest-ci
|
99
103
|
minitest-reporters
|
100
104
|
oj
|
101
|
-
rake (~>
|
105
|
+
rake (~> 12.3)
|
102
106
|
simplecov
|
103
107
|
|
104
108
|
BUNDLED WITH
|
105
|
-
|
109
|
+
2.0.1
|
data/README.md
CHANGED
@@ -37,9 +37,11 @@ You can define media types by inheriting from this base type, or create your own
|
|
37
37
|
```Ruby
|
38
38
|
require 'media_types'
|
39
39
|
|
40
|
-
class Venue
|
40
|
+
class Venue
|
41
|
+
include MediaTypes::Dsl
|
42
|
+
|
41
43
|
def self.base_format
|
42
|
-
'application/vnd.mydomain.%<type>s.v%<version
|
44
|
+
'application/vnd.mydomain.%<type>s.v%<version>s.%<view>s+%<suffix>s'
|
43
45
|
end
|
44
46
|
|
45
47
|
media_type 'venue', defaults: { suffix: :json, version: 2 }
|
@@ -372,6 +374,11 @@ Load the `http` integration and call `.register` on all media types you want to
|
|
372
374
|
|
373
375
|
Currently uses `oj` under the hood and this can not be changed.
|
374
376
|
|
377
|
+
## Related
|
378
|
+
|
379
|
+
- [`MediaTypes::Serialization`](https://github.com/XPBytes/media_types-serialization): :cyclone: Add media types supported serialization using your favourite serializer
|
380
|
+
- [`MediaTypes::Validation`](https://github.com/XPBytes/media_types-validation): :heavy_exclamation_mark: Response validations according to a media-type
|
381
|
+
|
375
382
|
## Development
|
376
383
|
|
377
384
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/Rakefile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'bundler/gem_tasks'
|
4
|
-
require 'rake/testtask'
|
5
|
-
|
6
|
-
Rake::TestTask.new(:test) do |t|
|
7
|
-
t.libs << 'test'
|
8
|
-
t.libs << 'lib'
|
9
|
-
t.test_files = FileList['test/**/*_test.rb']
|
10
|
-
end
|
11
|
-
|
12
|
-
task default: :test
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rake/testtask'
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << 'test'
|
8
|
+
t.libs << 'lib'
|
9
|
+
t.test_files = FileList['test/**/*_test.rb']
|
10
|
+
end
|
11
|
+
|
12
|
+
task default: :test
|
data/lib/media_types/dsl.rb
CHANGED
data/lib/media_types/version.rb
CHANGED
data/media_types.gemspec
CHANGED
@@ -25,12 +25,12 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_development_dependency 'actionpack'
|
27
27
|
spec.add_development_dependency 'awesome_print'
|
28
|
-
spec.add_development_dependency 'bundler', '~>
|
28
|
+
spec.add_development_dependency 'bundler', '~> 2'
|
29
29
|
spec.add_development_dependency 'http'
|
30
30
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
31
31
|
spec.add_development_dependency 'minitest-ci'
|
32
32
|
spec.add_development_dependency 'minitest-reporters'
|
33
33
|
spec.add_development_dependency 'oj'
|
34
|
-
spec.add_development_dependency 'rake', '~>
|
34
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
35
35
|
spec.add_development_dependency 'simplecov'
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: media_types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derk-Jan Karrenbeld
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: http
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '12.3'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '12.3'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: simplecov
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
version: '0'
|
221
221
|
requirements: []
|
222
222
|
rubyforge_project:
|
223
|
-
rubygems_version: 2.6
|
223
|
+
rubygems_version: 2.7.6
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: Library to create media type definitions, schemes and validations
|