chunky_png 1.3.14 → 1.4.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: 9f1e9dc8ce37f48273c35ab26355ae201c398a4cad9ef6feb9f840a5903b74d0
4
- data.tar.gz: 74ec0f7d356ef55114127a9e92b00f536c85ab0b4fb02ca1ba7bccb8d2a602bb
3
+ metadata.gz: 83fc1d331bcc0afc882b5ff2df1c0601e42f6551cfaff2b7c7ae9d0b4386b122
4
+ data.tar.gz: 1f80013e9aeb9daa25ed0a968b5d82877483113ebd22442226e0e8ee269a3105
5
5
  SHA512:
6
- metadata.gz: 5c4bb42771731024576d6e113dd6dbf9290637c69c9a042927ac6bb5775db1e3724664d014900d52b3a5bc4b0db3d6d9bce4ec117948d16e80aca121de536ff6
7
- data.tar.gz: 222ab95f557e231fc71b648629ea8275a74f3485e0d1589ff33fac316ad96b826a86b2c62d6cde7641abd64b11d4e815309f90b0653849b8a57e350996747aa5
6
+ metadata.gz: 1fcb07937d255014cba405bc018c9889b5fd7cd652e25f0768b21ef58a48f604033551f3fa822329387a3dcecb46263906c1043ecb5a7e0007fba22f90dbeb5f
7
+ data.tar.gz: dd57be8a9ce7db0333dad21f03f9ea056feaed4a785f3e0d21b7a1efb3123bacf6fb58f73cbde9d46f2aa2032b39dd5e06e25a4e48aeb9d5dad993ad99f886e9
@@ -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"
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.4.0"
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.4.0
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-28 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'
450
450
  required_rubygems_version: !ruby/object:Gem::Requirement
451
451
  requirements:
452
452
  - - ">="