dragonfly_harfbuzz 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8780a3c9bff0ca80af60c9b793ab7fb0e04db07c600ee5010332b3a03c5d27d1
4
- data.tar.gz: e19f34bce31c5b347fbb607d15e1944b771f96a76ae10f2d5c059d25fb8a3f76
3
+ metadata.gz: 8770ccbb7bfdfe8b736a4e2074118fe6229161dff997af7d72eba97ae5c2bade
4
+ data.tar.gz: 248e3e3d33af72f6362eb02fa733e3b97ee92c101f47d27323e0708b3ec40cb5
5
5
  SHA512:
6
- metadata.gz: eb95dad4fb98e7a90a168261d7c483b3fc4602331968ccaa0499e431b5008c2d2b34aa9a6f68eb0178a1d883b0fbaa14ac67f2f5f6a484f5d881c455362e09dc
7
- data.tar.gz: 2a6d9c7fe23ab4f8290f505363bcc51e9beb1b579f835b606dde94647616832d65ec73f8ace5bdd32869ba4e1fbb60c3fe7c041ec1bdeeb8fdfee8978f22749a
6
+ metadata.gz: 936adfbd294352ec1f41301d948fe06ea1d7045a47c68a053bef53bea718b9d7953baac758070afb066c593a035b6f6642402956cfd8a8d31a8b81a6731de6c9
7
+ data.tar.gz: 91a5e0d69b79347ecea40d1a8502ef4a56a2cb21a5b8ef19c90e4bc3786cbeeff8f3ffb202f3cbeedd465b621614ef3153e0288e4d2f75bedd47a458f394dd2f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.1.3
4
+
5
+ * make sure that `str` argument to `hb_view` is properly escaped
6
+
3
7
  ## 1.1.2
4
8
 
5
9
  * improved `SUPPORTED_FORMATS` matching that ignores case
@@ -25,7 +25,7 @@ module DragonflyHarfbuzz
25
25
  --output-format=#{format}
26
26
  ]
27
27
 
28
- args << "--text='#{str}'" unless options.has_key?('unicodes')
28
+ args << "--text=#{Shellwords.escape(str)}" unless options.key?('unicodes')
29
29
 
30
30
  options.reject { |k, _| %w[format markup_svg flatten_svg split_paths].include?(k.to_s) }.each do |k, v|
31
31
  args << "--#{k.to_s.tr('_', '-')}=#{Shellwords.escape(v)}" if v.present?
@@ -46,7 +46,7 @@ module DragonflyHarfbuzz
46
46
  content
47
47
  end
48
48
 
49
- def update_url(attrs, str = '', options = {})
49
+ def update_url(attrs, _str = '', options = {})
50
50
  format = options.fetch('format', 'svg').to_s
51
51
  attrs.ext = format
52
52
  end
@@ -54,11 +54,11 @@ module DragonflyHarfbuzz
54
54
  private
55
55
 
56
56
  def str_from_unicodes(unicodes)
57
- unicodes.split(",").map do |hexstring|
57
+ unicodes.split(',').map do |hexstring|
58
58
  begin
59
- Array(hexstring).pack("H*").force_encoding('utf-16be').encode('utf-8')
60
- rescue
61
- " "
59
+ Array(hexstring).pack('H*').force_encoding('utf-16be').encode('utf-8')
60
+ rescue StandardError
61
+ ' '
62
62
  end
63
63
  end.join
64
64
  end
@@ -1,3 +1,3 @@
1
1
  module DragonflyHarfbuzz
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '1.1.3'.freeze
3
3
  end
@@ -5,11 +5,11 @@ describe DragonflyHarfbuzz::Processors::HbView do
5
5
  let(:content) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample.otf')) }
6
6
  let(:processor) { DragonflyHarfbuzz::Processors::HbView.new }
7
7
 
8
- let(:string) { 'FOO' }
8
+ let(:string) { "F'OO" }
9
9
 
10
10
  describe 'SUPPORTED_FORMATS' do
11
11
  DragonflyHarfbuzz::SUPPORTED_FORMATS.each do |format|
12
- unless File.exists?(SAMPLES_DIR.join("sample.#{format}"))
12
+ unless File.exist?(SAMPLES_DIR.join("sample.#{format}"))
13
13
  it(format) { skip "sample.#{format} does not exist, skipping" }
14
14
  next
15
15
  end
@@ -49,8 +49,8 @@ describe DragonflyHarfbuzz::Processors::HbView do
49
49
  end
50
50
 
51
51
  describe 'str as unicodes' do
52
- before { processor.call(content, nil, unicodes: "0042,0043", flatten_svg: true) }
53
- it { content.data.must_include "<svg character=\"B\" class=\"character\"" }
54
- it { content.data.must_include "<svg character=\"C\" class=\"character\"" }
52
+ before { processor.call(content, nil, unicodes: '0042,0043', flatten_svg: true) }
53
+ it { content.data.must_include '<svg character="B" class="character"' }
54
+ it { content.data.must_include '<svg character="C" class="character"' }
55
55
  end
56
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonfly_harfbuzz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-19 00:00:00.000000000 Z
11
+ date: 2018-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport