rotn 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79a0c34167fbbb653b044a0b2bea5166bd761d22
4
- data.tar.gz: 142ab9cbbbccf120237f85c199b29092984ef758
3
+ metadata.gz: 7c1bc96fead67dcaa137946de08d3886aae5fdd9
4
+ data.tar.gz: 45c58a717526062f353e61365ffcc45a524fc2c0
5
5
  SHA512:
6
- metadata.gz: e2d7b8bc857cdc4aedd3a2b23e2f8a2f7d27c5d8bea664204768022c11bf8d6692fe1e5d89ab35913c4f58833cfe7ead1ce12a212997deade60d861b9b5b3a0e
7
- data.tar.gz: 318a4b1efa9b2e98a55d500eb2393f6185d6dcfcaa218608e6b62fb49a7796b302b6fdf7bfe68edfbf0c74b3e07b31e59bbe8bbad15d1d0af257e97afb07684f
6
+ metadata.gz: 125dac7f429e11e094e7d05f426343646af4820fb8d9b824a9463d06930ddc718d2f4518bb2519d2d49ace8d378a97e6c623ce833dbdd712948dcaa329f0ff4a
7
+ data.tar.gz: f95e85b5b10fb9ac069e447fd48311aac3850845fc279b15b2a4c2ed90c18b4d5d11b941edde87801993556d2701ab7341e861b29bfb37a8c2693d5d9b1532a0
@@ -1 +1 @@
1
- v�|Pf5'��./�$a��,��V! ���I��`�I)���Ȉ�O!�?M/���|���IGL\,��vq��@̼����KS�����1T%��"E�/���X�q&������^.eS���TM4/�|���B��*4�&���|�|}��=�xB�2\���Ғٗ���%_��|P{fqA0�CS=Vv���>�΅��c��j�%8����� �t��_� ���2D*� ��/gG28�%���
1
+ 2�*} ��~�T6��},��z9,�YK(�,���\ݶ�2׭~/�-i7���pH6����>��O������}cX�����Њ馘�?&MNg��z�:��$����iC�~���@GMΣ3�����l5>�sNxr��<(���c]B<FC�\,��M;,}!��d���"P�2EJFMG�f��hBT��(UdM��� mO����\,�̆#��l9�4�\Ƙq+3od'��)N�1%����x5KlI
data.tar.gz.sig CHANGED
Binary file
data/bin/rotn CHANGED
@@ -45,12 +45,12 @@ end
45
45
 
46
46
  str = ARGV.join(" ")
47
47
 
48
- a = options[:alphabetic].to_i
49
- n = options[:numeric].to_i
48
+ n = options[:numeric].to_i if options.has_key? :numeric
49
+ a = options[:alphabetic].to_i if options.has_key? :alphabetic
50
50
 
51
51
  if options.has_key? :decode
52
52
  str.unshift!({:a => a}) if options.has_key? :alphabetic
53
- str.unshift!({:a => n}) if options.has_key? :numeric
53
+ str.unshift!({:n => n}) if options.has_key? :numeric
54
54
  else
55
55
  str.shift!({:a => a}) if options.has_key? :alphabetic
56
56
  str.shift!({:n => n}) if options.has_key? :numeric
@@ -38,8 +38,8 @@ class String
38
38
  # => "Hello World 123"
39
39
  def unshift(map)
40
40
  string = self.dup
41
- string.tr!(Rotn.shift_dictionary(map[:a], :a), "a-zA-Z") if map.has_key? :a
42
- string.tr!(Rotn.shift_dictionary(map[:n], :n), "0-9") if map.has_key? :n
41
+ string.tr!("a-zA-Z", Rotn.shift_dictionary(26 - map[:a], :a)) if map.has_key? :a
42
+ string.tr!("0-9", Rotn.shift_dictionary(10 - map[:n], :n)) if map.has_key? :n
43
43
  return string
44
44
  end
45
45
  # In-place unshift by N symbols
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.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Black
metadata.gz.sig CHANGED
Binary file