chunky_png 1.3.14 → 1.3.15

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: 9f1e9dc8ce37f48273c35ab26355ae201c398a4cad9ef6feb9f840a5903b74d0
4
- data.tar.gz: 74ec0f7d356ef55114127a9e92b00f536c85ab0b4fb02ca1ba7bccb8d2a602bb
3
+ metadata.gz: 2e1b3725cfd19b4f97dc6064df132f90f7dd68205a6a1b9dee7d516cbe2add90
4
+ data.tar.gz: 9f968c18ab17e1b2f66e9613b5368e0c5afdd368de3448384556c8422620efe6
5
5
  SHA512:
6
- metadata.gz: 5c4bb42771731024576d6e113dd6dbf9290637c69c9a042927ac6bb5775db1e3724664d014900d52b3a5bc4b0db3d6d9bce4ec117948d16e80aca121de536ff6
7
- data.tar.gz: 222ab95f557e231fc71b648629ea8275a74f3485e0d1589ff33fac316ad96b826a86b2c62d6cde7641abd64b11d4e815309f90b0653849b8a57e350996747aa5
6
+ metadata.gz: 9f7ce3e53cf79c7dd34bb6b9c5da6420dd2d0d7814975a3cd35bc563cb95963355a29af0b3823cfa65667408a8d9173e18c1b5f0460b3abdfe5376c1d7cbb932
7
+ data.tar.gz: 9ecf4c44876ddfa9acc9fbfdc0d074abdeee3fb148c2e96036a9d1722f123664ac20bfa5a29f4a3c551961db69c63e9b4ca70e2d1eed857a8f5842b9548707d3
@@ -18,7 +18,7 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  strategy:
20
20
  matrix:
21
- ruby: [ '2.5', '2.6', '2.7' ]
21
+ ruby: [ '2.5', '2.6', '2.7', 'ruby-head' ]
22
22
 
23
23
  steps:
24
24
  - uses: actions/checkout@v2
data/Gemfile CHANGED
@@ -7,10 +7,6 @@ platforms :jruby do
7
7
  gem "jruby-openssl"
8
8
  end
9
9
 
10
- platform :rbx do
11
- gem "rubysl"
12
- end
13
-
14
10
  group :jekyll do
15
11
  gem "jekyll", "~> 3.3"
16
12
  gem "kramdown-parser-gfm"
@@ -50,4 +50,6 @@ Gem::Specification.new do |s|
50
50
 
51
51
  s.files = `git ls-files`.split($/)
52
52
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
53
+
54
+ s.required_ruby_version = ">= 2.0.0"
53
55
  end
@@ -12,7 +12,7 @@ module ChunkyPNG
12
12
  # explicit palette (stores as PLTE & tRNS chunks in a PNG file).
13
13
  #
14
14
  # @see ChunkyPNG::Color
15
- class Palette < SortedSet
15
+ class Palette < Set
16
16
  # Builds a new palette given a set (Enumerable instance) of colors.
17
17
  #
18
18
  # @param enum [Enumerable<Integer>] The set of colors to include in this
@@ -21,8 +21,10 @@ module ChunkyPNG
21
21
  # which they appeared in the palette chunk, so that this array can be
22
22
  # used for decoding.
23
23
  def initialize(enum, decoding_map = nil)
24
- super(enum)
24
+ super(enum.sort.freeze)
25
25
  @decoding_map = decoding_map if decoding_map
26
+ @encoding_map = {}
27
+ freeze
26
28
  end
27
29
 
28
30
  # Builds a palette instance from a PLTE chunk and optionally a tRNS chunk
@@ -135,7 +137,7 @@ module ChunkyPNG
135
137
  # @return [true, false] True if a encoding map was built when this palette
136
138
  # was loaded.
137
139
  def can_encode?
138
- !@encoding_map.nil?
140
+ !@encoding_map.empty?
139
141
  end
140
142
 
141
143
  # Returns a color, given the position in the original palette chunk.
@@ -176,8 +178,8 @@ module ChunkyPNG
176
178
  # @return [ChunkyPNG::Chunk::Palette] The PLTE chunk.
177
179
  # @see ChunkyPNG::Palette#can_encode?
178
180
  def to_plte_chunk
179
- @encoding_map = {}
180
- colors = []
181
+ @encoding_map.clear
182
+ colors = []
181
183
 
182
184
  each_with_index do |color, index|
183
185
  @encoding_map[color] = index
@@ -3,5 +3,5 @@
3
3
  module ChunkyPNG
4
4
  # The current version of ChunkyPNG.
5
5
  # Set it and commit the change this before running rake release.
6
- VERSION = "1.3.14"
6
+ VERSION = "1.3.15"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chunky_png
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.14
4
+ version: 1.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-27 00:00:00.000000000 Z
11
+ date: 2020-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -446,7 +446,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
446
446
  requirements:
447
447
  - - ">="
448
448
  - !ruby/object:Gem::Version
449
- version: '0'
449
+ version: 2.0.0
450
450
  required_rubygems_version: !ruby/object:Gem::Requirement
451
451
  requirements:
452
452
  - - ">="