rotn 1.0.0 → 1.0.1
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/bin/rotn +56 -0
- metadata +4 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 90e66b6e33202754cfc1dac6f7f3bd2b4db93b40
|
|
4
|
+
data.tar.gz: e75d7cceaa3b28ca1aa11f1dbccf5e0518f96952
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a98363898f2bf1148f3b68ed9e213496ffc07398430731f96cd2ed31c00ae14a8b43f1287a1ac0de49dec8064aed72e4ba54001e5066cd62287065de9221a219
|
|
7
|
+
data.tar.gz: 2be480554b6f183a1265ea94e6561ae2149988b452faa203d7a998fc3a9f2ee782b4dd228ac14fcbbf2f62913c2704a85dd94a75c2e910e609e1122f81f4b8bb
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/bin/rotn
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'rotn'
|
|
3
|
+
require 'optparse'
|
|
4
|
+
|
|
5
|
+
options = {}
|
|
6
|
+
OptionParser.new do |o|
|
|
7
|
+
o.banner = "Missing operands.\nTry --help for more options."
|
|
8
|
+
|
|
9
|
+
o.on("-h", "--help", "Print help.") do |h|
|
|
10
|
+
options[:help] = h
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
o.on("-aDECIMALINTEGER", "--alphabetic=DECIMALINTEGER", "Set the number to shift alphabetic symbols (a-zA-Z).") do |a|
|
|
14
|
+
options[:alphabetic] = a
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
o.on("-nDECIMALINTEGER", "--numeric=DECIMALINTEGER", "Set the number to shift numeric symbols (0-9).") do |n|
|
|
18
|
+
options[:numeric] = n
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
o.on("-e", "--encode", "Set the mode to encode.") do |e|
|
|
22
|
+
options[:encode] = e
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
o.on("-d", "--decode", "Set the mode to decode.") do |d|
|
|
26
|
+
options[:decode] = d
|
|
27
|
+
end
|
|
28
|
+
end.parse!
|
|
29
|
+
|
|
30
|
+
if options.has_key? :help
|
|
31
|
+
puts "Usage: rotn -aNUMBER [-nNUMBER] STRING"
|
|
32
|
+
puts " -a, --alphabetic=NUMBER\tSet the number to shift alphabetic symbols (a-zA-Z)."
|
|
33
|
+
puts " -d, --decode\t\tSet the mode to decode."
|
|
34
|
+
puts " -e, --encode\t\tSet the mode to encode (default)."
|
|
35
|
+
puts " -h, --help\t\tPrint this message."
|
|
36
|
+
puts " -n, --numeric=NUMBER\tSet the number to shift numeric symbols (0-9)."
|
|
37
|
+
exit
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
str = ""
|
|
41
|
+
(ARGV.length).times do |i|
|
|
42
|
+
str += ARGV[i]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
a = options[:alphabetic].to_i
|
|
46
|
+
n = options[:numeric].to_i
|
|
47
|
+
|
|
48
|
+
if options.has_key? :decode
|
|
49
|
+
str.unshift!({:a => a]}) if options.has_key? :alphabetic
|
|
50
|
+
str.unshift!({:a => n]}) if options.has_key? :numeric
|
|
51
|
+
else
|
|
52
|
+
str.shift!({:a => options[:alphabetic]}) if options.has_key? :alphabetic
|
|
53
|
+
str.shift!({:n => options[:numeric]}) if options.has_key? :numeric
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
puts str
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rotn
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mark Black
|
|
@@ -34,12 +34,14 @@ date: 2016-08-29 00:00:00.000000000 Z
|
|
|
34
34
|
dependencies: []
|
|
35
35
|
description: A library to perform a Caesar cypher by N symbols
|
|
36
36
|
email: annoying-dog@outlook.com
|
|
37
|
-
executables:
|
|
37
|
+
executables:
|
|
38
|
+
- rotn
|
|
38
39
|
extensions: []
|
|
39
40
|
extra_rdoc_files: []
|
|
40
41
|
files:
|
|
41
42
|
- lib/rotn.rb
|
|
42
43
|
- lib/rotn/local.rb
|
|
44
|
+
- bin/rotn
|
|
43
45
|
homepage: https://github.com/annoying-dog/rotn
|
|
44
46
|
licenses:
|
|
45
47
|
- MIT
|
metadata.gz.sig
CHANGED
|
Binary file
|