rotn 1.0.4 → 1.0.5

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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +1 -1
  3. data.tar.gz.sig +0 -0
  4. data/bin/rotn +20 -3
  5. metadata +1 -1
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c1bc96fead67dcaa137946de08d3886aae5fdd9
4
- data.tar.gz: 45c58a717526062f353e61365ffcc45a524fc2c0
3
+ metadata.gz: 30b15c62d65fb4fd2e75c703ceef40024e97342b
4
+ data.tar.gz: 66d0a7fdc065279bb5583033aaa8d473851d2913
5
5
  SHA512:
6
- metadata.gz: 125dac7f429e11e094e7d05f426343646af4820fb8d9b824a9463d06930ddc718d2f4518bb2519d2d49ace8d378a97e6c623ce833dbdd712948dcaa329f0ff4a
7
- data.tar.gz: f95e85b5b10fb9ac069e447fd48311aac3850845fc279b15b2a4c2ed90c18b4d5d11b941edde87801993556d2701ab7341e861b29bfb37a8c2693d5d9b1532a0
6
+ metadata.gz: 43c08ab9aa77cb678e761c783787f095d14968f2fcd90ad788ee3c310ca0e7d555561b267a489eab81b8fac84a54492314fae8e5e5c116bbb0371255ee3e208f
7
+ data.tar.gz: c737b52ab782e3dada5410c22312982a1f03aba4926a0a750736b6dd42eb24091d01524ac232d699cf758efce934711f0f1f380015cc4591afdba5bd8c440ef1
@@ -1 +1 @@
1
- 2�*} ��~�T6��},��z9,�YK(�,���\ݶ�2׭~/�-i7���pH6����>��O������}cX�����Њ馘�?&MNg��z�:��$����i�C�~���@GMΣ3�����l5>�sN�xr��<(���c]B<FC�\,��M;,}!��d���"P2EJFMG�f��hBT��(UdM��� mO����\,�̆#��l9�4�\Ƙq+3�od'��)�N�1%����x5KlI
1
+ x�~�E��~U���DE�w�K2 ��#(X"w�����E�~:K��pk�>���6qg'3 |�Cf�q1 ��S�����ڢ�C���ug��0��`1�z����5�M����*66yƨ��UuJ~w !l;���.Sc�<�tN�� ����R��K��V��^Z5;���\�vL%ʚ+k<�1������̄l/Ye����ũn�ѕ>oĚ�/���a�}�Mp߄�K^�!b~H��$"~`�fp;@we8��W
data.tar.gz.sig CHANGED
Binary file
data/bin/rotn CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'rotn'
3
3
  require 'optparse'
4
+ require 'pathname'
4
5
 
5
6
  options = {}
6
7
  OptionParser.new do |o|
@@ -27,14 +28,14 @@ OptionParser.new do |o|
27
28
  end
28
29
  end.parse!
29
30
 
30
- if ARGV.length == 0
31
+ if options.length == 0
31
32
  puts "rotn: missing options"
32
33
  puts "Try --help for more information"
33
34
  exit
34
35
  end
35
36
 
36
37
  if options.has_key? :help
37
- puts "Usage: rotn -aNUMBER [-nNUMBER] STRING"
38
+ puts "Usage: rotn -aNUMBER [-nNUMBER] STRING|FILE"
38
39
  puts " -a, --alphabetic=NUMBER\tSet the number to shift alphabetic symbols (a-zA-Z)."
39
40
  puts " -d, --decode\t\tSet the mode to decode."
40
41
  puts " -e, --encode\t\tSet the mode to encode (default)."
@@ -43,7 +44,23 @@ if options.has_key? :help
43
44
  exit
44
45
  end
45
46
 
46
- str = ARGV.join(" ")
47
+ e = false
48
+ ARGV.each do |i|
49
+ if Pathname.new(i).file?
50
+ e = true
51
+ next
52
+ end
53
+ e = false
54
+ break
55
+ end
56
+
57
+ if e
58
+ str = ARGF.read
59
+ elsif ARGV.length > 0
60
+ str = ARGV.join(" ")
61
+ else
62
+ str = STDIN.read
63
+ end
47
64
 
48
65
  n = options[:numeric].to_i if options.has_key? :numeric
49
66
  a = options[:alphabetic].to_i if options.has_key? :alphabetic
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
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Black
metadata.gz.sig CHANGED
Binary file