cipher_word 1.0.3 → 1.0.4
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
- data/lib/cipher_word.rb +2 -2
- data/lib/cipher_word/version.rb +1 -1
- data/test/test_cipher_word.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fd9888c4bd4e6a59b4c2d58bfcb244cbfdef049
|
4
|
+
data.tar.gz: e12854d68b987c012e1d75baed32ad2782534470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdd7e823b68ea7c31a39fd56a1b10adffce6dc418ef94ebba72ae72b9f2f94c7ccf6ad8f0a02f28c6212b5460fadcc4d562f53c0397ddabb3e3f83831f8bcf1f
|
7
|
+
data.tar.gz: dbf3a4c9c1d33d2489800fc7ba726dedbf18c72f0fd77746ac489c70eb3bf81047815c215a57d57f84fff23c7122f5a704ece8b6c7ebd3830bde727a0e3581a9
|
data/lib/cipher_word.rb
CHANGED
@@ -7,7 +7,7 @@ module CipherWord
|
|
7
7
|
(0...a).each { |i|
|
8
8
|
word_b = word[i].ord
|
9
9
|
word_b += 1
|
10
|
-
word_a += word_b.chr
|
10
|
+
word_a += word_b.chr Encoding::UTF_8
|
11
11
|
}
|
12
12
|
word_a
|
13
13
|
end
|
@@ -18,7 +18,7 @@ module CipherWord
|
|
18
18
|
(0...a).each { |i|
|
19
19
|
word_b = word[i].ord
|
20
20
|
word_b -= 1
|
21
|
-
word_a += word_b.chr
|
21
|
+
word_a += word_b.chr Encoding::UTF_8
|
22
22
|
}
|
23
23
|
word_a
|
24
24
|
end
|
data/lib/cipher_word/version.rb
CHANGED
data/test/test_cipher_word.rb
CHANGED
@@ -8,11 +8,13 @@ class TestCipherWord < MiniTest::Test
|
|
8
8
|
assert_equal CipherWord.cipher('Jean Valjean'), 'Kfbo!Wbmkfbo'
|
9
9
|
assert_equal CipherWord.cipher('Bishop Myriel'), 'Cjtipq!Nzsjfm'
|
10
10
|
assert_equal CipherWord.cipher('Cosette'), 'Dptfuuf'
|
11
|
+
assert_equal CipherWord.cipher('テスト①'), 'デズド②'
|
11
12
|
end
|
12
13
|
|
13
14
|
def test_decoding
|
14
15
|
assert_equal CipherWord.decoding('Kfbo!Wbmkfbo'), 'Jean Valjean'
|
15
16
|
assert_equal CipherWord.decoding('Cjtipq!Nzsjfm'), 'Bishop Myriel'
|
16
17
|
assert_equal CipherWord.decoding('Dptfuuf'), 'Cosette'
|
18
|
+
assert_equal CipherWord.decoding('デズド②'), 'テスト①'
|
17
19
|
end
|
18
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cipher_word
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yutainoue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|