binascii 1.0.0 → 1.0.1

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: f3e19a8aa182b270cc304d659d9ad8d8decea96ec2e1bec4fd4cdcd81f9af34f
4
- data.tar.gz: cd5d28e6e1bae4c736edbba2ba85ccdb9eea43c1e7255cc78c403007da8ea355
3
+ metadata.gz: 16bf16d0e2998067e88943c9d4ecafa20154f34a1418a0986d7b88710743447d
4
+ data.tar.gz: 5b67c17bf48d3878653dd7837ca84379272a312f483de9524c4b968762715b7a
5
5
  SHA512:
6
- metadata.gz: deeb040eb021c8fb261d03146fbfea27103317b978b040826d28f3b39e9ed976bf1dd038489c4b27183c416239c11c15ba7a405985a5a0c0a2e478662f7b2528
7
- data.tar.gz: 62cbff23f40de4a92434259d074b60198b4f2dd80f97554b741b737e26ee1211a527776ec13c711e34cb6a689450a86927a05701b0f09d058f10e6e86e90ff97
6
+ metadata.gz: 99e887a56ac928a86add1c2c33aab53091994a28de28196c388d015eeb67f691b62480a02de3268202935908716d0b7e3299d1392c114f46011b6f9c79515431
7
+ data.tar.gz: 9b443b8d7bf27e5483c46b8e6be8f95e13cea1ca3891f08f9b31dd5bffcf6aa570f4d066a1d361ef83d7bb8bd034bd3ab9c5650c099c271e82b4dd0b89b93df3
@@ -1,2 +1,5 @@
1
+ ## 1.0.1
2
+ * Fix issue causing `.b2a_base64` to error on empty strings.
3
+
1
4
  ## 1.0.0
2
5
  * Birthday!
@@ -5,7 +5,8 @@ module Binascii
5
5
  end
6
6
 
7
7
  def b2a_base64(data, newline: true)
8
- result = [data].pack('m').gsub!("\n", '')
8
+ result = [data].pack('m')
9
+ result.gsub!("\n", '')
9
10
  result << "\n" if newline
10
11
  result
11
12
  end
@@ -1,3 +1,3 @@
1
1
  module Binascii
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ describe Binascii do
4
+ describe '#a2b_base64' do
5
+ it 'decodes correctly' do
6
+ expect(described_class.a2b_base64("Zm9vYmFyYmF6\n")).to eq('foobarbaz')
7
+ end
8
+ end
9
+
10
+ describe '#b2a_base64' do
11
+ it 'encodes correctly' do
12
+ expect(described_class.b2a_base64('foobarbaz')).to eq("Zm9vYmFyYmF6\n")
13
+ end
14
+
15
+ it 'does not include line breaks' do
16
+ str = 'The majestic green albatross flitters in the moonlight'
17
+ expect(described_class.b2a_base64(str).strip).to_not include("\n")
18
+ end
19
+
20
+ it 'does not include a trailing newline if requested' do
21
+ expect(described_class.b2a_base64('foobarbaz', newline: false)).to eq('Zm9vYmFyYmF6')
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binascii
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-16 00:00:00.000000000 Z
11
+ date: 2019-07-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby version of Python's binascii module
14
14
  email:
@@ -31,6 +31,7 @@ files:
31
31
  - lib/binascii/utils.rb
32
32
  - lib/binascii/uu.rb
33
33
  - lib/binascii/version.rb
34
+ - spec/base64_spec.rb
34
35
  - spec/crc32_spec.rb
35
36
  - spec/hex_spec.rb
36
37
  - spec/hqx_spec.rb
@@ -56,8 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  - !ruby/object:Gem::Version
57
58
  version: '0'
58
59
  requirements: []
59
- rubyforge_project:
60
- rubygems_version: 2.7.6
60
+ rubygems_version: 3.0.4
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: A Ruby version of Python's binascii module