spongebobify 0.1.1 → 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 +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +5 -1
- data/README.md +15 -11
- data/exe/spongebobify +8 -0
- data/lib/spongebobify/cli.rb +26 -0
- data/lib/spongebobify/version.rb +1 -1
- data/lib/spongebobify.rb +20 -7
- data/spongebobify.gemspec +3 -0
- metadata +25 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b1931bc50366b8e1d60e15578ace8336cc8c0ae93c717581cf50e6b935242ed
|
4
|
+
data.tar.gz: 6b0417c2598e78e25bea579115bd523962117cbff774739810102d50df48479c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d8caf6abd577efdef86a2048b79e109874b106e2ffa08cd5f643057705e83df433909f17d955010ebd5a11dfc32e92ae8225ebad712aaad1954cf72df425f9b
|
7
|
+
data.tar.gz: e8889b9a06540c5dc40f9e6bec070f6d919889e9b02f136204a5e8da99f2a98a75ab5486b00e0d646c619af5b732e59c97720b486c1a878e7e48023994e4b8ed
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,18 +2,22 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
spongebobify (0.1.1)
|
5
|
+
thor (~> 1.0)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
9
10
|
rake (12.3.3)
|
11
|
+
thor (1.3.1)
|
10
12
|
|
11
13
|
PLATFORMS
|
14
|
+
arm64-darwin-22
|
12
15
|
ruby
|
13
16
|
|
14
17
|
DEPENDENCIES
|
15
18
|
rake (~> 12.0)
|
16
19
|
spongebobify!
|
20
|
+
thor
|
17
21
|
|
18
22
|
BUNDLED WITH
|
19
|
-
|
23
|
+
2.5.11
|
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
|
-
|
7
|
+
|
8
|
+
iNsTaLl tHe gEm:
|
8
9
|
|
9
10
|
```ruby
|
10
|
-
gem
|
11
|
+
gem install spongebobify
|
11
12
|
```
|
12
13
|
|
13
|
-
aNd tHeN
|
14
|
-
|
15
|
-
$ bundle install
|
14
|
+
aNd tHeN AdD SoMeThInG LiKe tHiS To yOuR .zShRc oR EqUiVaLeNt:
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
```
|
17
|
+
export PATH=$(ruby -e 'puts Gem.user_dir')/bin:$PATH
|
18
|
+
```
|
20
19
|
|
21
20
|
## uSaGe
|
22
21
|
|
23
22
|
```
|
24
|
-
$
|
23
|
+
$ spongebobify "boring text lacking in sarcasm"
|
25
24
|
=> bOrInG TeXt lAcKiNg iN SaRcAsM
|
26
25
|
```
|
27
26
|
|
28
27
|
```
|
29
|
-
$
|
30
|
-
=>
|
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
|
data/exe/spongebobify
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
require 'spongebobify'
|
5
|
+
|
6
|
+
module Spongebobify
|
7
|
+
class CLI < Thor
|
8
|
+
desc "spongebobify [TEXT|FILE]", "Converts TEXT or contents of FILE to spongebob case"
|
9
|
+
def spongebobify(input = nil)
|
10
|
+
if input.nil? && $stdin.tty?
|
11
|
+
puts "No input provided. Use 'spongebobify \"some text\"' or 'spongebobify ./path_to_file.txt'"
|
12
|
+
exit 1
|
13
|
+
end
|
14
|
+
|
15
|
+
if File.exist?(input)
|
16
|
+
text = File.read(input)
|
17
|
+
else
|
18
|
+
text = input
|
19
|
+
end
|
20
|
+
|
21
|
+
puts Spongebobify.process(text)
|
22
|
+
end
|
23
|
+
|
24
|
+
default_task :spongebobify
|
25
|
+
end
|
26
|
+
end
|
data/lib/spongebobify/version.rb
CHANGED
data/lib/spongebobify.rb
CHANGED
@@ -1,18 +1,31 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'spongebobify/version'
|
4
|
+
require 'spongebobify/cli'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
def is_lowercase(byte)
|
7
|
+
byte >= 97 && byte <= 122
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
def is_uppercase(byte)
|
11
|
+
byte >= 65 && byte <= 90
|
12
|
+
end
|
13
|
+
|
14
|
+
module Spongebobify
|
15
|
+
def self.process(input_string)
|
16
|
+
index = 0
|
17
|
+
byte_array = []
|
11
18
|
|
12
|
-
|
19
|
+
input_string.each_byte do |byte|
|
20
|
+
if index % 2 == 0
|
21
|
+
byte_array << (is_uppercase(byte) ? (byte ^ 32) : byte)
|
22
|
+
else
|
23
|
+
byte_array << (is_lowercase(byte) ? (byte ^ 32) : byte)
|
24
|
+
end
|
25
|
+
index += 1
|
13
26
|
end
|
14
27
|
|
15
|
-
|
28
|
+
byte_array.pack('C*')
|
16
29
|
end
|
17
30
|
end
|
18
31
|
|
data/spongebobify.gemspec
CHANGED
@@ -23,7 +23,10 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
24
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
25
|
end
|
26
|
+
|
26
27
|
spec.bindir = 'exe'
|
27
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
29
|
spec.require_paths = ['lib']
|
30
|
+
|
31
|
+
spec.add_runtime_dependency 'thor', '~> 1.0'
|
29
32
|
end
|
metadata
CHANGED
@@ -1,20 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spongebobify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OneNeptune
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2024-05-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
13
27
|
description: Convert normal parlance into way more sarcastic SpongeBob clucking chicken
|
14
28
|
style.
|
15
29
|
email:
|
16
30
|
- michael@michaelbennett.nyc
|
17
|
-
executables:
|
31
|
+
executables:
|
32
|
+
- spongebobify
|
18
33
|
extensions: []
|
19
34
|
extra_rdoc_files: []
|
20
35
|
files:
|
@@ -27,7 +42,9 @@ files:
|
|
27
42
|
- bin/console
|
28
43
|
- bin/setup
|
29
44
|
- bin/spongebobify
|
45
|
+
- exe/spongebobify
|
30
46
|
- lib/spongebobify.rb
|
47
|
+
- lib/spongebobify/cli.rb
|
31
48
|
- lib/spongebobify/version.rb
|
32
49
|
- spongebobify.gemspec
|
33
50
|
homepage: https://www.github.com/OneNeptune/spongebobify
|
@@ -36,7 +53,7 @@ licenses:
|
|
36
53
|
metadata:
|
37
54
|
homepage_uri: https://www.github.com/OneNeptune/spongebobify
|
38
55
|
source_code_uri: https://www.github.com/OneNeptune/spongebobify
|
39
|
-
post_install_message:
|
56
|
+
post_install_message:
|
40
57
|
rdoc_options: []
|
41
58
|
require_paths:
|
42
59
|
- lib
|
@@ -51,8 +68,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
68
|
- !ruby/object:Gem::Version
|
52
69
|
version: '0'
|
53
70
|
requirements: []
|
54
|
-
rubygems_version: 3.
|
55
|
-
signing_key:
|
71
|
+
rubygems_version: 3.4.10
|
72
|
+
signing_key:
|
56
73
|
specification_version: 4
|
57
74
|
summary: Transform input text to sPoNgEbOb cAsE
|
58
75
|
test_files: []
|