media_types 0.5.3 → 0.5.4

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
  SHA1:
3
- metadata.gz: aa2d55104d031ce996a25b386d36173805d3fd5e
4
- data.tar.gz: 7d85d220951893827fdce34ef141690a66556b2d
3
+ metadata.gz: 3f15e657fcca45b625494c2073e435fa4ad17cc4
4
+ data.tar.gz: 7e9bc019db8851dae9be4c3d24dc219aee8b7772
5
5
  SHA512:
6
- metadata.gz: af26052379d3c839dc5eaee39631a3d6bd9aed9b8fabe88edc51af77aa4af9737e93cef46aff70e00a2517d7ed3c13a4f325f4a1bf836b9e6292eb07c06acf94
7
- data.tar.gz: faf22068a9b6ffda54e63a8a09add78c238363977728609056b354d277f3c834a51a61084f39eef6c9715ad5ce1b11b0d60182d0d5aec6d0a886be2f482d0a1d
6
+ metadata.gz: ebe9b0510ed749de2b481ca57eb0621d200414e1a4223eb4b69499976c2b1651b47d3f0076c57ffca11621df4daec2346be150c4c20924ba29155f504d99b9a3
7
+ data.tar.gz: af54f6cc7eef76f360e4f158770c2e6ac08a4b4e21cf0d4333eed42f303a51ea34700afb8eac463f486742a9dc844b75eaab14f7dec0aea0cecfe7f49fe64153
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.5.4
2
+
3
+ - Fix formatter reworked template when fields are not present
4
+
1
5
  # 0.5.3
2
6
 
3
7
  - Remove `require 'awesome_print'` in library code as it's marked as a development dependency only
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- media_types (0.5.3)
4
+ media_types (0.5.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -27,10 +27,11 @@ module MediaTypes
27
27
  def rework_template(filtered_arguments)
28
28
  filtered_arguments.reduce(template) do |reworked, (key, value)|
29
29
  next reworked if MediaTypes::Object.new(value).present?
30
- start_of_template_variable = "%<#{key}>"
31
30
 
32
- # noinspection RubyBlockToMethodReference
33
- reworked.gsub("[\\.+](#{start_of_template_variable})") { start_of_template_variable }
31
+ reworked.gsub(/[.+](%<[A-z]+>)/) do |match|
32
+ partial_format = "%<#{key}>"
33
+ match.include?(partial_format) ? partial_format : match
34
+ end
34
35
  end
35
36
  end
36
37
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MediaTypes
4
- VERSION = '0.5.3'
4
+ VERSION = '0.5.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: media_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derk-Jan Karrenbeld