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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07bdf0bb72927f6e29b245e02fca50612f571370519faf4d700b86faa83c64fe
4
- data.tar.gz: 9cd9142ee960df19c85914a673f0a45f109eee0a32fece4a9b62fe1106ecbec8
3
+ metadata.gz: 2041c208e2369bfd60399c0dce92cbea8f3e0c51c1c4b361c6c29540285eb95a
4
+ data.tar.gz: 7cae4d020bc3c1b79665dc4cccb36701ed360190995f57c56eee7c0e715ce6e0
5
5
  SHA512:
6
- metadata.gz: 10a829365e6763894eb52638198da8012e00b90e2c19ce173fb9d4c21a69dea968cab6662b4f02e833f21ef06249b5854e1b43875c1ca20017c1ead9bb4bcf50
7
- data.tar.gz: 396e9b9ac84b983585ff8b832fb098924be39c513787317da71a5b0987783f4c623748c089b50b583f7b253995643d53631fc724191b1bcb84adecf3b44ba46c
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
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0
4
+
5
+ - ✨ Add support for having multiple link headers with the same `rel`
6
+
3
7
  ## 0.7.0
4
8
 
5
9
  - ✨ Add `extract_set_links` to serializer for collection links
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- media_types-serialization (0.7.0.beta1)
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.4)
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.2.3)
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, opts), index|
31
- next unless opts.is_a?(String) || opts.try(:[], :href)
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
- HttpHeaders::Link::Entry.new("<#{href}>", index: index, parameters: parameters)
36
- end.compact
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)
@@ -1,5 +1,5 @@
1
1
  module MediaTypes
2
2
  module Serialization
3
- VERSION = '0.7.0'
3
+ VERSION = '0.8.0'
4
4
  end
5
5
  end
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.7.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-23 00:00:00.000000000 Z
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"