spongebobify 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: '0339accdcc932191c228abb667d0e0ee7e0f1a306c0c4556ed2af43ca141bbe2'
4
- data.tar.gz: 9805a57e78bfbbf9fa0baf02d2ec30adf43a1e54a8ae8c8df7e6d1bc3f6631bc
3
+ metadata.gz: 5b1931bc50366b8e1d60e15578ace8336cc8c0ae93c717581cf50e6b935242ed
4
+ data.tar.gz: 6b0417c2598e78e25bea579115bd523962117cbff774739810102d50df48479c
5
5
  SHA512:
6
- metadata.gz: a4e0d965a280ee417a1916ba9f9b4ecbb5fee7152037822770da8e05daf877fb02898b1b5deacc10ab980528a1b2aac3a74519d5d43ba707a39b00ebb1db6a12
7
- data.tar.gz: 69ed1cf7f0f907b222d7e50c29f297bbafe8a59040e1e4e5d74f4fa56cf30468fd5111e702f5dd26173dc0e7361c9d417ca2bde929e79f2fbb65d4d94d2a9b08
6
+ metadata.gz: 4d8caf6abd577efdef86a2048b79e109874b106e2ffa08cd5f643057705e83df433909f17d955010ebd5a11dfc32e92ae8225ebad712aaad1954cf72df425f9b
7
+ data.tar.gz: e8889b9a06540c5dc40f9e6bec070f6d919889e9b02f136204a5e8da99f2a98a75ab5486b00e0d646c619af5b732e59c97720b486c1a878e7e48023994e4b8ed
data/README.md CHANGED
@@ -4,30 +4,34 @@ cOnVeRt nOrMaL PaRlAnCe iNtO WaY MoRe sArCaStIc sPoNgEbOb cLuCkInG ChIcKeN StYlE
4
4
 
5
5
  ## iNsTaLlAtIoN
6
6
 
7
- aDd tHiS LiNe tO YoUr aPpLiCaTiOn's gEmFiLe:
7
+
8
+ iNsTaLl tHe gEm:
8
9
 
9
10
  ```ruby
10
- gem 'spongebobify'
11
+ gem install spongebobify
11
12
  ```
12
13
 
13
- aNd tHeN ExEcUtE:
14
-
15
- $ bundle install
14
+ aNd tHeN AdD SoMeThInG LiKe tHiS To yOuR .zShRc oR EqUiVaLeNt:
16
15
 
17
- oR InStAlL It yOuRsElF As:
18
-
19
- $ gem install spongebobify
16
+ ```
17
+ export PATH=$(ruby -e 'puts Gem.user_dir')/bin:$PATH
18
+ ```
20
19
 
21
20
  ## uSaGe
22
21
 
23
22
  ```
24
- $ bin/spongebobify boring text lacking in sarcasm
23
+ $ spongebobify "boring text lacking in sarcasm"
25
24
  => bOrInG TeXt lAcKiNg iN SaRcAsM
26
25
  ```
27
26
 
28
27
  ```
29
- $ bin/spongebobify < input.txt
30
- => bOrInG TeXt lAcKiNg iN SaRcAsM
28
+ $ spongebobify ./war-and-peace.txt
29
+ => cHaPtEr i
30
+
31
+ "wElL, pRiNcE, sO GeNoA AnD LuCcA ArE NoW JuSt fAmIlY EsTaTeS Of tHe
32
+ bUoNaPaRtEs. BuT I WaRn yOu, If yOu dOn't tElL Me tHaT ThIs mEaNs wAr,
33
+ If yOu sTiLl tRy tO DeFeNd tHe iNfAmIeS AnD HoRrOrS PeRpEtRaTeD By tHaT
34
+ AnTiChRiSt--I ReAlLy bElIeVe hE Is aNtIcHrIsT...
31
35
  ```
32
36
 
33
37
  ## lIcEnSe
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spongebobify
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
data/lib/spongebobify.rb CHANGED
@@ -14,18 +14,18 @@ end
14
14
  module Spongebobify
15
15
  def self.process(input_string)
16
16
  index = 0
17
- new_string = String.new
17
+ byte_array = []
18
18
 
19
19
  input_string.each_byte do |byte|
20
20
  if index % 2 == 0
21
- new_string << (is_uppercase(byte) ? (byte ^ 32).chr : byte.chr)
21
+ byte_array << (is_uppercase(byte) ? (byte ^ 32) : byte)
22
22
  else
23
- new_string << (is_lowercase(byte) ? (byte ^ 32).chr : byte.chr)
23
+ byte_array << (is_lowercase(byte) ? (byte ^ 32) : byte)
24
24
  end
25
25
  index += 1
26
26
  end
27
27
 
28
- new_string
28
+ byte_array.pack('C*')
29
29
  end
30
30
  end
31
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spongebobify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OneNeptune