spongebobify 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +6 -2
- data/README.md +17 -22
- data/bin/spongebobify +1 -1
- data/exe/spongebobify +8 -0
- data/lib/spongebobify/cli.rb +26 -0
- data/lib/spongebobify/version.rb +1 -1
- data/lib/spongebobify.rb +19 -6
- 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: '0339accdcc932191c228abb667d0e0ee7e0f1a306c0c4556ed2af43ca141bbe2'
|
4
|
+
data.tar.gz: 9805a57e78bfbbf9fa0baf02d2ec30adf43a1e54a8ae8c8df7e6d1bc3f6631bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4e0d965a280ee417a1916ba9f9b4ecbb5fee7152037822770da8e05daf877fb02898b1b5deacc10ab980528a1b2aac3a74519d5d43ba707a39b00ebb1db6a12
|
7
|
+
data.tar.gz: 69ed1cf7f0f907b222d7e50c29f297bbafe8a59040e1e4e5d74f4fa56cf30468fd5111e702f5dd26173dc0e7361c9d417ca2bde929e79f2fbb65d4d94d2a9b08
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,19 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
spongebobify (0.1.
|
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
@@ -1,40 +1,35 @@
|
|
1
|
-
#
|
1
|
+
# sPoNgEbObIfY
|
2
2
|
|
3
|
-
|
3
|
+
cOnVeRt nOrMaL PaRlAnCe iNtO WaY MoRe sArCaStIc sPoNgEbOb cLuCkInG ChIcKeN StYlE.
|
4
4
|
|
5
|
-
|
5
|
+
## iNsTaLlAtIoN
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
7
|
+
aDd tHiS LiNe tO YoUr aPpLiCaTiOn's gEmFiLe:
|
10
8
|
|
11
9
|
```ruby
|
12
10
|
gem 'spongebobify'
|
13
11
|
```
|
14
12
|
|
15
|
-
|
13
|
+
aNd tHeN ExEcUtE:
|
16
14
|
|
17
15
|
$ bundle install
|
18
16
|
|
19
|
-
|
17
|
+
oR InStAlL It yOuRsElF As:
|
20
18
|
|
21
19
|
$ gem install spongebobify
|
22
20
|
|
23
|
-
##
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
21
|
+
## uSaGe
|
32
22
|
|
33
|
-
|
34
|
-
|
35
|
-
|
23
|
+
```
|
24
|
+
$ bin/spongebobify boring text lacking in sarcasm
|
25
|
+
=> bOrInG TeXt lAcKiNg iN SaRcAsM
|
26
|
+
```
|
36
27
|
|
28
|
+
```
|
29
|
+
$ bin/spongebobify < input.txt
|
30
|
+
=> bOrInG TeXt lAcKiNg iN SaRcAsM
|
31
|
+
```
|
37
32
|
|
38
|
-
##
|
33
|
+
## lIcEnSe
|
39
34
|
|
40
|
-
|
35
|
+
tHe gEm iS AvAiLaBlE As oPeN SoUrCe uNdEr tHe tErMs oF ThE [MiT LiCeNsE](https://opensource.org/licenses/MIT).
|
data/bin/spongebobify
CHANGED
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,15 +1,28 @@
|
|
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
|
+
new_string = String.new
|
11
18
|
|
12
|
-
|
19
|
+
input_string.each_byte do |byte|
|
20
|
+
if index % 2 == 0
|
21
|
+
new_string << (is_uppercase(byte) ? (byte ^ 32).chr : byte.chr)
|
22
|
+
else
|
23
|
+
new_string << (is_lowercase(byte) ? (byte ^ 32).chr : byte.chr)
|
24
|
+
end
|
25
|
+
index += 1
|
13
26
|
end
|
14
27
|
|
15
28
|
new_string
|
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.2
|
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: []
|