New Upstream Release - ruby-ascii85
Ready changes
Summary
Merged new upstream version: 1.1.0 (was: 1.0.3).
Resulting package
Built on 2023-01-11T14:15 (took 8m39s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases ruby-ascii85
Diff
diff --git a/.travis.yml b/.travis.yml
index 2b86072..2136c09 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,30 @@
language: ruby
rvm:
- - 1.8
- 1.9
+ - 2.0
+ - 2.1
+ - 2.2
+ - 2.3
+ - 2.4
- 2.5
+ - 2.6
+ - 2.7
- ruby-head
- jruby
+ - truffleruby
+env:
+ - RUBYOPT="--enable-frozen-string-literal"
+ - RUBYOPT=""
+matrix:
+ exclude:
+ - rvm: 1.9
+ env: RUBYOPT="--enable-frozen-string-literal"
+ - rvm: 2.0
+ env: RUBYOPT="--enable-frozen-string-literal"
+ - rvm: 2.1
+ env: RUBYOPT="--enable-frozen-string-literal"
+ - rvm: 2.2
+ env: RUBYOPT="--enable-frozen-string-literal"
+ # bundler did not support this back then
+ - rvm: 2.3
+ env: RUBYOPT="--enable-frozen-string-literal"
diff --git a/History.txt b/History.txt
index ac476ad..2654bfd 100644
--- a/History.txt
+++ b/History.txt
@@ -1,3 +1,8 @@
+=== 1.1.0 / 2020-11-11
+
+ * Make use of frozen_string_literal
+ * Update tests to use newer minitest syntax
+
=== 1.0.3 / 2018-01-25
* Updated the gem's metadata
diff --git a/README.md b/README.md
index 4c75952..4e572d8 100644
--- a/README.md
+++ b/README.md
@@ -56,6 +56,13 @@ Encodes or decodes FILE or STDIN using Ascii85 and writes to STDOUT.
```
+## Contributors
+
+Thank you for your contribution!
+
+* [@aliismayilov](https://github.com/aliismayilov) contributed frozen String handling
+
+
## License
Ascii85 is distributed under the MIT License. See the accompanying LICENSE file
diff --git a/bin/ascii85 b/bin/ascii85
index 506a789..a3f2b0e 100755
--- a/bin/ascii85
+++ b/bin/ascii85
@@ -51,7 +51,6 @@ ARGV.options do |opts|
else
abort "Superfluous operand(s): \"#{remaining_args.join('", "')}\""
end
-
end
if @options[:file] == '-'
diff --git a/debian/changelog b/debian/changelog
index 960dd14..2e4372b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-ruby-ascii85 (1.0.3-2) UNRELEASED; urgency=medium
+ruby-ascii85 (1.1.0-1) UNRELEASED; urgency=medium
[ Utkarsh Gupta ]
* Add salsa-ci.yml
@@ -15,8 +15,9 @@ ruby-ascii85 (1.0.3-2) UNRELEASED; urgency=medium
* Update watch file format version to 4.
* Bump debhelper from old 12 to 13.
* Set upstream metadata fields: Bug-Database, Bug-Submit.
+ * New upstream release.
- -- Utkarsh Gupta <guptautkarsh2102@gmail.com> Tue, 13 Aug 2019 03:28:55 +0530
+ -- Utkarsh Gupta <guptautkarsh2102@gmail.com> Wed, 11 Jan 2023 14:07:56 -0000
ruby-ascii85 (1.0.3-1) unstable; urgency=medium
diff --git a/debian/patches/fix_path_in_bin.patch b/debian/patches/fix_path_in_bin.patch
index 13d5c4b..77e6979 100644
--- a/debian/patches/fix_path_in_bin.patch
+++ b/debian/patches/fix_path_in_bin.patch
@@ -6,8 +6,10 @@ Forwarded: no
Last-Update: 2013-05-28
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/bin/ascii85
-+++ b/bin/ascii85
+Index: ruby-ascii85.git/bin/ascii85
+===================================================================
+--- ruby-ascii85.git.orig/bin/ascii85
++++ ruby-ascii85.git/bin/ascii85
@@ -8,7 +8,7 @@
diff --git a/debian/patches/remove_rubygems.patch b/debian/patches/remove_rubygems.patch
index 64ff603..199df27 100644
--- a/debian/patches/remove_rubygems.patch
+++ b/debian/patches/remove_rubygems.patch
@@ -6,8 +6,10 @@ Origin: vendor
Forwarded: not-needed
Last-Update: 2014-10-14
---- a/spec/lib/ascii85_spec.rb
-+++ b/spec/lib/ascii85_spec.rb
+Index: ruby-ascii85.git/spec/lib/ascii85_spec.rb
+===================================================================
+--- ruby-ascii85.git.orig/spec/lib/ascii85_spec.rb
++++ ruby-ascii85.git/spec/lib/ascii85_spec.rb
@@ -1,10 +1,9 @@
# encoding: utf-8
@@ -19,4 +21,4 @@ Last-Update: 2014-10-14
+require "ascii85"
describe Ascii85 do
-
+ UNSUPPORTED_MSG = "This version of Ruby does not support encodings"
diff --git a/lib/Ascii85/version.rb b/lib/Ascii85/version.rb
index 206177e..407a0c6 100644
--- a/lib/Ascii85/version.rb
+++ b/lib/Ascii85/version.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ascii85
- VERSION = "1.0.3"
+ VERSION = "1.1.0"
end
diff --git a/lib/ascii85.rb b/lib/ascii85.rb
index 200d053..38ac74d 100644
--- a/lib/ascii85.rb
+++ b/lib/ascii85.rb
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
#
@@ -15,7 +16,6 @@
module Ascii85
-
#
# Encodes the bytes of the given String as Ascii85.
#
@@ -37,7 +37,6 @@ module Ascii85
#
#
def self.encode(str, wrap_lines = 80)
-
to_encode = str.to_s
return '' if to_encode.empty?
@@ -59,7 +58,7 @@ module Ascii85
if tuple == 0
'z'
else
- tmp = ""
+ tmp = String.new
5.times do
tmp << ((tuple % 85) + 33).chr
tuple /= 85
@@ -82,7 +81,6 @@ module Ascii85
end
# Otherwise we wrap the lines
-
line_length = [2, wrap_lines.to_i].max
wrapped = []
@@ -122,7 +120,6 @@ module Ascii85
# encountered.
#
def self.decode(str)
-
input = str.to_s
opening_delim = '<~'
@@ -134,9 +131,9 @@ module Ascii85
# errors if an especially exotic input encoding is introduced.
# As of Ruby 1.9.2 all non-dummy encodings work fine though.
#
- if opening_delim.respond_to?(:encode!)
- opening_delim.encode!(input.encoding)
- closing_delim.encode!(input.encoding)
+ if opening_delim.respond_to?(:encode)
+ opening_delim = opening_delim.encode(input.encoding)
+ closing_delim = closing_delim.encode(input.encoding)
end
# Get the positions of the opening/closing delimiters. If there is
@@ -153,7 +150,6 @@ module Ascii85
result = []
input.each_byte do |c|
-
case c.chr
when " ", "\t", "\r", "\n", "\f", "\0"
# Ignore whitespace
@@ -189,7 +185,6 @@ module Ascii85
raise(Ascii85::DecodingError,
"Illegal character inside Ascii85: #{c.chr.dump}")
end
-
end
# Convert result into a String
@@ -225,5 +220,4 @@ module Ascii85
# at least two characters.
#
class DecodingError < StandardError; end
-
end
diff --git a/spec/lib/ascii85_spec.rb b/spec/lib/ascii85_spec.rb
index 8a56aa6..5d6c855 100644
--- a/spec/lib/ascii85_spec.rb
+++ b/spec/lib/ascii85_spec.rb
@@ -7,11 +7,9 @@ require 'minitest/autorun'
require File.expand_path('../../../lib/ascii85', __FILE__)
describe Ascii85 do
-
UNSUPPORTED_MSG = "This version of Ruby does not support encodings"
TEST_CASES = {
-
"" => "",
" " => "<~+9~>",
@@ -44,9 +42,8 @@ describe Ascii85 do
}
it "#decode should be the inverse of #encode" do
-
# Generate a random string
- test_str = ""
+ test_str = String.new
(1 + rand(255)).times do
test_str << rand(256).chr
end
@@ -54,14 +51,13 @@ describe Ascii85 do
encoded = Ascii85.encode(test_str)
decoded = Ascii85.decode(encoded)
- decoded.must_equal test_str
+ assert_equal decoded, test_str
end
describe "#encode" do
-
it "should encode all specified test-cases correctly" do
TEST_CASES.each_pair do |input, encoded|
- Ascii85.encode(input).must_equal encoded
+ assert_equal Ascii85.encode(input), encoded
end
end
@@ -73,7 +69,7 @@ describe Ascii85 do
input_EUC_JP = 'どうもありがとうミスターロボット'.encode('EUC-JP')
input_binary = input_EUC_JP.force_encoding('ASCII-8BIT')
- Ascii85.encode(input_EUC_JP).must_equal Ascii85.encode(input_binary)
+ assert_equal Ascii85.encode(input_EUC_JP), Ascii85.encode(input_binary)
end
it "should produce output lines no longer than specified" do
@@ -82,7 +78,7 @@ describe Ascii85 do
#
# No wrap
#
- Ascii85.encode(test_str, false).count("\n").must_equal 0
+ assert_equal Ascii85.encode(test_str, false).count("\n"), 0
#
# x characters per line, except for the last one
@@ -107,23 +103,21 @@ describe Ascii85 do
count_arr.delete_if { |len| len == x }
# Now count_arr should be empty
- count_arr.must_be_empty
+ assert_empty count_arr
end
it "should not split the end-marker to achieve correct line length" do
- Ascii85.encode("\0" * 4, 4).must_equal "<~z\n~>"
+ assert_equal Ascii85.encode("\0" * 4, 4), "<~z\n~>"
end
-
end
describe "#decode" do
-
it "should decode all specified test-cases correctly" do
TEST_CASES.each_pair do |decoded, input|
if String.new.respond_to?(:encoding)
- Ascii85.decode(input).must_equal decoded.dup.force_encoding('ASCII-8BIT')
+ assert_equal Ascii85.decode(input), decoded.dup.force_encoding('ASCII-8BIT')
else
- Ascii85.decode(input).must_equal decoded
+ assert_equal Ascii85.decode(input), decoded
end
end
end
@@ -149,7 +143,7 @@ describe Ascii85 do
begin
to_test = input_ascii85.encode(encoding)
- Ascii85.decode(to_test).force_encoding('UTF-8').must_equal input
+ assert_equal Ascii85.decode(to_test).force_encoding('UTF-8'), input
rescue Encoding::ConverterNotFoundError
# Ignore this encoding
end
@@ -157,19 +151,19 @@ describe Ascii85 do
end
it "should only process data within delimiters" do
- Ascii85.decode("<~~>").must_be_empty
- Ascii85.decode("Doesn't contain delimiters").must_be_empty
- Ascii85.decode("Mismatched ~> delimiters 1").must_be_empty
- Ascii85.decode("Mismatched <~ delimiters 2").must_be_empty
- Ascii85.decode("Mismatched ~><~ delimiters 3").must_be_empty
-
- Ascii85.decode("<~;KZGo~><~z~>").must_equal "Ruby"
- Ascii85.decode("FooBar<~z~>BazQux").must_equal "\0\0\0\0"
+ assert_empty Ascii85.decode("<~~>")
+ assert_empty Ascii85.decode("Doesn't contain delimiters")
+ assert_empty Ascii85.decode("Mismatched ~> delimiters 1")
+ assert_empty Ascii85.decode("Mismatched <~ delimiters 2")
+ assert_empty Ascii85.decode("Mismatched ~><~ delimiters 3")
+
+ assert_equal Ascii85.decode("<~;KZGo~><~z~>"), "Ruby"
+ assert_equal Ascii85.decode("FooBar<~z~>BazQux"), "\0\0\0\0"
end
it "should ignore whitespace" do
decoded = Ascii85.decode("<~6 #LdYA\r\08\n \n\n- *rF*(i\"Ch[s \t(D.RU,@ <-\'jDJ=0\f/~>")
- decoded.must_equal 'Antidisestablishmentarianism'
+ assert_equal decoded, 'Antidisestablishmentarianism'
end
it "should return ASCII-8BIT encoded strings" do
@@ -177,29 +171,25 @@ describe Ascii85 do
skip(UNSUPPORTED_MSG)
end
- Ascii85.decode("<~;KZGo~>").encoding.name.must_equal "ASCII-8BIT"
+ assert_equal Ascii85.decode("<~;KZGo~>").encoding.name, "ASCII-8BIT"
end
describe "Error conditions" do
-
it "should raise DecodingError if it encounters a word >= 2**32" do
- lambda { Ascii85.decode('<~s8W-#~>') }.must_raise(Ascii85::DecodingError)
+ assert_raises(Ascii85::DecodingError) { Ascii85.decode('<~s8W-#~>') }
end
it "should raise DecodingError if it encounters an invalid character" do
- lambda { Ascii85.decode('<~!!y!!~>') }.must_raise(Ascii85::DecodingError)
+ assert_raises(Ascii85::DecodingError) { Ascii85.decode('<~!!y!!~>') }
end
it "should raise DecodingError if the last tuple consists of a single character" do
- lambda { Ascii85.decode('<~!~>') }.must_raise(Ascii85::DecodingError)
+ assert_raises(Ascii85::DecodingError) { Ascii85.decode('<~!~>') }
end
it "should raise DecodingError if a z is found inside a 5-tuple" do
- lambda { Ascii85.decode('<~!!z!!~>') }.must_raise Ascii85::DecodingError
+ assert_raises(Ascii85::DecodingError) { Ascii85.decode('<~!!z!!~>') }
end
-
end
-
end
-
end
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/share/rubygems-integration/all/specifications/Ascii85-1.1.0.gemspec
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/share/rubygems-integration/all/specifications/Ascii85-1.0.3.gemspec
No differences were encountered in the control files