crypt-rot13 1.1.1 → 1.2.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +4 -0
- data/Gemfile +6 -0
- data/MANIFEST +1 -1
- data/README +2 -3
- data/Rakefile +4 -5
- data/crypt-rot13.gemspec +3 -2
- data/lib/crypt/rot13.rb +1 -1
- data/spec/crypt_rot13_spec.rb +67 -0
- metadata +24 -9
- metadata.gz.sig +3 -4
- data/test/test_crypt_rot13.rb +0 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d89dbd27cfc6a99e29403d492f1660a18a63080ce66e2ecddf6bb1f0696a64d1
|
4
|
+
data.tar.gz: 55ecb2f9443f74d364e096d5317aae7ed329ada57c187c181af05a3d9918b572
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd452838ef98f6b29345da766719d3faaf260a0ec4f8e32e8de6c08f29f570143a936d6005dbcec96ad5c0da5fd26df069535a08f9b44fbafbb60371931b6c0f
|
7
|
+
data.tar.gz: 0fc659af9c8c6ca1992e194c4b00c565cb6e506df53903fde63395d3c767c01d87894a6e79f85a8a46b30ab5ad957d94b6b04b1c6602a10939d2d974f265718c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
data/Gemfile
ADDED
data/MANIFEST
CHANGED
data/README
CHANGED
@@ -8,9 +8,8 @@
|
|
8
8
|
|
9
9
|
= Synopsis
|
10
10
|
require 'crypt/rot13'
|
11
|
-
include Crypt
|
12
11
|
|
13
|
-
str = Rot13.new("Hello World", 3) # Caesar cipher
|
12
|
+
str = Crypt::Rot13.new("Hello World", 3) # Caesar cipher
|
14
13
|
puts str # "Khoor Zruog"
|
15
14
|
|
16
15
|
= Notes
|
@@ -32,7 +31,7 @@
|
|
32
31
|
Apache-2.0
|
33
32
|
|
34
33
|
= Copyright
|
35
|
-
(C) 2005-
|
34
|
+
(C) 2005-2020, Daniel J. Berger, All Rights Reserved
|
36
35
|
|
37
36
|
= Warranty
|
38
37
|
This package is provided "as is" and without any express or
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/clean'
|
3
|
-
require '
|
3
|
+
require 'rspec/core/rake_task'
|
4
4
|
|
5
5
|
CLEAN.include("**/*.gem", "**/*.rbc")
|
6
6
|
|
@@ -20,9 +20,8 @@ namespace :gem do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
t.
|
25
|
-
t.verbose = true
|
23
|
+
RSpec::Core::RakeTask.new do |t|
|
24
|
+
t.pattern = 'spec/crypt_rot13_spec.rb'
|
26
25
|
end
|
27
26
|
|
28
|
-
task :default => :
|
27
|
+
task :default => :spec
|
data/crypt-rot13.gemspec
CHANGED
@@ -2,19 +2,20 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'crypt-rot13'
|
5
|
-
spec.version = '1.
|
5
|
+
spec.version = '1.2.0'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
7
|
spec.license = 'Apache-2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
9
9
|
spec.homepage = 'http://github.com/djberg96/crypt-rot13'
|
10
10
|
spec.summary = 'Character rotation encryption, i.e. Caesar Cipher'
|
11
|
-
spec.test_file = '
|
11
|
+
spec.test_file = 'spec/crypt_rot13_spec.rb'
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
spec.cert_chain = Dir['certs/*']
|
14
14
|
|
15
15
|
spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
16
16
|
|
17
17
|
spec.add_development_dependency('rake')
|
18
|
+
spec.add_development_dependency('rspec', '~> 3.9')
|
18
19
|
|
19
20
|
spec.metadata = {
|
20
21
|
'homepage_uri' => 'https://github.com/djberg96/crypt-rot13',
|
data/lib/crypt/rot13.rb
CHANGED
@@ -0,0 +1,67 @@
|
|
1
|
+
########################################################################
|
2
|
+
# crypt_rot13_spec.rb
|
3
|
+
#
|
4
|
+
# Tests for the crypt-rot13 library. You should run this via the
|
5
|
+
# 'rake spec' task (or just 'rake').
|
6
|
+
########################################################################
|
7
|
+
require 'crypt/rot13'
|
8
|
+
require 'rspec'
|
9
|
+
|
10
|
+
RSpec.describe Crypt::Rot13 do
|
11
|
+
before do
|
12
|
+
@r1 = described_class.new('abc')
|
13
|
+
@r2 = described_class.new('ABC')
|
14
|
+
@r3 = described_class.new('xyz')
|
15
|
+
@r4 = described_class.new('XYZ')
|
16
|
+
@r5 = described_class.new('a1b2c3@#$')
|
17
|
+
@r6 = described_class.new('abc', 3)
|
18
|
+
@r7 = described_class.new('ABC', 3)
|
19
|
+
@r8 = described_class.new('xyz', 23)
|
20
|
+
@r9 = described_class.new('XYZ', 23)
|
21
|
+
end
|
22
|
+
|
23
|
+
example "version" do
|
24
|
+
expect(described_class::VERSION).to eq('1.2.0')
|
25
|
+
expect(described_class::VERSION).to be_frozen
|
26
|
+
end
|
27
|
+
|
28
|
+
example "constructor" do
|
29
|
+
expect(described_class).to respond_to(:new)
|
30
|
+
expect{ described_class.new }.not_to raise_error
|
31
|
+
expect{ described_class.new('foo') }.not_to raise_error
|
32
|
+
expect{ described_class.new('foo', 7) }.not_to raise_error
|
33
|
+
end
|
34
|
+
|
35
|
+
example "available_methods" do
|
36
|
+
expect(@r1).to respond_to(:rotate)
|
37
|
+
end
|
38
|
+
|
39
|
+
example "degree" do
|
40
|
+
expect{ described_class.new('foo', 26) }.to raise_error(Crypt::Rot13::Error)
|
41
|
+
expect{ described_class.new('foo', 52) }.to raise_error(Crypt::Rot13::Error)
|
42
|
+
expect{ described_class.new('foo', 25) }.not_to raise_error
|
43
|
+
end
|
44
|
+
|
45
|
+
example "string_class" do
|
46
|
+
expect(@r1).to be_kind_of(String)
|
47
|
+
end
|
48
|
+
|
49
|
+
example "return_value_default_degree" do
|
50
|
+
expect(@r1).to eq('nop')
|
51
|
+
expect(@r2).to eq('NOP')
|
52
|
+
expect(@r3).to eq('klm')
|
53
|
+
expect(@r4).to eq('KLM')
|
54
|
+
expect(@r5).to eq('n1o2p3@#$')
|
55
|
+
end
|
56
|
+
|
57
|
+
example "return_value_custom_degree" do
|
58
|
+
expect(@r6).to eq('def')
|
59
|
+
expect(@r7).to eq('DEF')
|
60
|
+
expect(@r8).to eq('uvw')
|
61
|
+
expect(@r9).to eq('UVW')
|
62
|
+
end
|
63
|
+
|
64
|
+
example "rotate_instance_method" do
|
65
|
+
expect(@r6.rotate(-3)).to eq('abc')
|
66
|
+
end
|
67
|
+
end
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crypt-rot13
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date:
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rake
|
@@ -51,6 +51,20 @@ dependencies:
|
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rspec
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.9'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.9'
|
54
68
|
description: |2
|
55
69
|
The crypt-rot13 library provides an interface for a simple character
|
56
70
|
substitution cipher known as ROT13, a variation on the Caesar cipher.
|
@@ -63,10 +77,10 @@ extra_rdoc_files:
|
|
63
77
|
- MANIFEST
|
64
78
|
files:
|
65
79
|
- LICENSE
|
66
|
-
- test
|
67
|
-
- test/test_crypt_rot13.rb
|
68
80
|
- CHANGES
|
69
81
|
- MANIFEST
|
82
|
+
- spec
|
83
|
+
- spec/crypt_rot13_spec.rb
|
70
84
|
- README
|
71
85
|
- Rakefile
|
72
86
|
- certs
|
@@ -75,6 +89,7 @@ files:
|
|
75
89
|
- lib/crypt
|
76
90
|
- lib/crypt/rot13.rb
|
77
91
|
- lib/crypt-rot13.rb
|
92
|
+
- Gemfile
|
78
93
|
- crypt-rot13.gemspec
|
79
94
|
homepage: http://github.com/djberg96/crypt-rot13
|
80
95
|
licenses:
|
@@ -86,7 +101,7 @@ metadata:
|
|
86
101
|
documentation_uri: https://github.com/djberg96/crypt-rot13/wiki
|
87
102
|
source_code_uri: https://github.com/djberg96/crypt-rot13
|
88
103
|
wiki_uri: https://github.com/djberg96/crypt-rot13/wiki
|
89
|
-
post_install_message:
|
104
|
+
post_install_message:
|
90
105
|
rdoc_options: []
|
91
106
|
require_paths:
|
92
107
|
- lib
|
@@ -101,9 +116,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
116
|
- !ruby/object:Gem::Version
|
102
117
|
version: '0'
|
103
118
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
105
|
-
signing_key:
|
119
|
+
rubygems_version: 3.1.4
|
120
|
+
signing_key:
|
106
121
|
specification_version: 4
|
107
122
|
summary: Character rotation encryption, i.e. Caesar Cipher
|
108
123
|
test_files:
|
109
|
-
-
|
124
|
+
- spec/crypt_rot13_spec.rb
|
metadata.gz.sig
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
��' ���'[�RZ�s��WK�L��`�ޠ@t�h��/��Շ�����P-������P��
|
1
|
+
R�4�u���$���2(i���-~巆����O'8"d2��B>����`��G�7:��
|
2
|
+
��=�D�_����8?�m<�b֜fAsL��|�È)�AE�
|
3
|
+
w4�^�x�p���eTL{c\kn�������O1��d$��C.-��ZA'O"]q�D�B�"
|
data/test/test_crypt_rot13.rb
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
###############################################################
|
2
|
-
# test_crypt_rot13.rb
|
3
|
-
#
|
4
|
-
# Test suite for the crypt-rot13 library. You should run this
|
5
|
-
# test case via the 'rake test' task.
|
6
|
-
###############################################################
|
7
|
-
require 'crypt/rot13'
|
8
|
-
require 'test/unit'
|
9
|
-
include Crypt
|
10
|
-
|
11
|
-
class TC_Rot13 < Test::Unit::TestCase
|
12
|
-
def setup
|
13
|
-
@r1 = Rot13.new('abc')
|
14
|
-
@r2 = Rot13.new('ABC')
|
15
|
-
@r3 = Rot13.new('xyz')
|
16
|
-
@r4 = Rot13.new('XYZ')
|
17
|
-
@r5 = Rot13.new('a1b2c3@#$')
|
18
|
-
@r6 = Rot13.new('abc', 3)
|
19
|
-
@r7 = Rot13.new('ABC', 3)
|
20
|
-
@r8 = Rot13.new('xyz', 23)
|
21
|
-
@r9 = Rot13.new('XYZ', 23)
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_version
|
25
|
-
assert_equal('1.1.1', Rot13::VERSION)
|
26
|
-
assert_true(Rot13::VERSION.frozen?)
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_constructor
|
30
|
-
assert_respond_to(Rot13,:new)
|
31
|
-
assert_nothing_raised{ Rot13.new }
|
32
|
-
assert_nothing_raised{ Rot13.new('foo') }
|
33
|
-
assert_nothing_raised{ Rot13.new('foo', 7) }
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_available_methods
|
37
|
-
assert_respond_to(@r1, :rotate)
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_degree
|
41
|
-
assert_raises(Rot13::Error){ Rot13.new('foo', 26) }
|
42
|
-
assert_raises(Rot13::Error){ Rot13.new('foo', 52) }
|
43
|
-
assert_nothing_raised{ Rot13.new('foo', 25) }
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_string_class
|
47
|
-
assert_kind_of(String, @r1)
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_return_value_default_degree
|
51
|
-
assert_equal('nop', @r1)
|
52
|
-
assert_equal('NOP', @r2)
|
53
|
-
assert_equal('klm', @r3)
|
54
|
-
assert_equal('KLM', @r4)
|
55
|
-
assert_equal('n1o2p3@#$', @r5)
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_return_value_custom_degree
|
59
|
-
assert_equal('def', @r6)
|
60
|
-
assert_equal('DEF', @r7)
|
61
|
-
assert_equal('uvw', @r8)
|
62
|
-
assert_equal('UVW', @r9)
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_rotate_instance_method
|
66
|
-
assert_equal('abc', @r6.rotate(-3))
|
67
|
-
end
|
68
|
-
|
69
|
-
def teardown
|
70
|
-
@r1 = nil
|
71
|
-
@r2 = nil
|
72
|
-
@r3 = nil
|
73
|
-
@r4 = nil
|
74
|
-
@r5 = nil
|
75
|
-
@r6 = nil
|
76
|
-
@r7 = nil
|
77
|
-
@r8 = nil
|
78
|
-
@r9 = nil
|
79
|
-
end
|
80
|
-
end
|