media_types-serialization 0.7.0 → 0.8.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/ci.yml +20 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +3 -3
- data/lib/media_types/serialization/base.rb +10 -6
- data/lib/media_types/serialization/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2041c208e2369bfd60399c0dce92cbea8f3e0c51c1c4b361c6c29540285eb95a
|
4
|
+
data.tar.gz: 7cae4d020bc3c1b79665dc4cccb36701ed360190995f57c56eee7c0e715ce6e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 763a81b77ce760ad2634b4b8670286105ce017f205f9a1fc2b92d2f018af1512a15179bea3899f39c580c5b79207955e6dc869377eca1cf431c24bff7c410d74
|
7
|
+
data.tar.gz: f255ce45bf62686fa789d309061030f23445fdbd68854cd7a9204c6e7ae4df701c8d7308b9b153e8ba95cd0287b44d0c9200c0d8df95869fc1329913f110d718
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v1
|
12
|
+
- name: Set up Ruby 2.6
|
13
|
+
uses: actions/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: 2.6.x
|
16
|
+
- name: Build and test with Rake
|
17
|
+
run: |
|
18
|
+
gem install bundler
|
19
|
+
bundle install --jobs 4 --retry 3
|
20
|
+
bundle exec rake
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
media_types-serialization (0.7.0
|
4
|
+
media_types-serialization (0.7.0)
|
5
5
|
actionpack (>= 4.0.0)
|
6
6
|
activesupport (>= 4.0.0)
|
7
7
|
http_headers-accept (>= 0.2.2, < 1.0.0)
|
@@ -57,7 +57,7 @@ GEM
|
|
57
57
|
awesome_print (1.8.0)
|
58
58
|
builder (3.2.3)
|
59
59
|
concurrent-ruby (1.1.4)
|
60
|
-
crass (1.0.
|
60
|
+
crass (1.0.5)
|
61
61
|
erubi (1.8.0)
|
62
62
|
globalid (0.4.2)
|
63
63
|
activesupport (>= 4.2.0)
|
@@ -68,7 +68,7 @@ GEM
|
|
68
68
|
http_headers-utils (0.2.0)
|
69
69
|
i18n (1.6.0)
|
70
70
|
concurrent-ruby (~> 1.0)
|
71
|
-
loofah (2.
|
71
|
+
loofah (2.3.1)
|
72
72
|
crass (~> 1.0.2)
|
73
73
|
nokogiri (>= 1.5.9)
|
74
74
|
mail (2.7.1)
|
@@ -27,13 +27,17 @@ module MediaTypes
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def to_link_header
|
30
|
-
entries = header_links(view: current_view).each_with_index.map do |(rel,
|
31
|
-
|
32
|
-
href = opts.is_a?(String) ? opts : opts.delete(:href)
|
33
|
-
parameters = { rel: rel }.merge(opts.is_a?(String) ? {} : opts)
|
30
|
+
entries = header_links(view: current_view).each_with_index.map do |(rel, links), index|
|
31
|
+
links = [links] unless links.is_a?(Array)
|
34
32
|
|
35
|
-
|
36
|
-
|
33
|
+
links.map do |opts|
|
34
|
+
next unless opts.is_a?(String) || opts.try(:[], :href)
|
35
|
+
href = opts.is_a?(String) ? opts : opts.delete(:href)
|
36
|
+
parameters = { rel: rel }.merge(opts.is_a?(String) ? {} : opts)
|
37
|
+
|
38
|
+
HttpHeaders::Link::Entry.new("<#{href}>", index: index, parameters: parameters)
|
39
|
+
end
|
40
|
+
end.flatten.compact
|
37
41
|
|
38
42
|
return nil unless entries.present?
|
39
43
|
HttpHeaders::Utils::List.to_header(entries)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: media_types-serialization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
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: 2019-10-
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -177,6 +177,7 @@ executables: []
|
|
177
177
|
extensions: []
|
178
178
|
extra_rdoc_files: []
|
179
179
|
files:
|
180
|
+
- ".github/workflows/ci.yml"
|
180
181
|
- ".gitignore"
|
181
182
|
- ".idea/.rakeTasks"
|
182
183
|
- ".idea/dictionaries/Derk_Jan.xml"
|