spurdo 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 71b31d510a59f0e1e78ab9509a87182857c942b3795bb04ef7ccc652efd5aacf
4
+ data.tar.gz: afcf32109206ffa3b129ca90d5145f9f498e5fb7718fcfd4e86d5f5eb8a6b15a
5
+ SHA512:
6
+ metadata.gz: 04cae3566637bb2344e0966066cf1b44c6feeeb9b807c390f78c7cd867179b47ec185d0be1d4be8be07c092d94811bcee5bc7c55b5617357da8a54c374475f81
7
+ data.tar.gz: b0068af2de5db15daff4556f92a7de04724042f9de1c3156f74e90b50eb57692bfdd95fb3ba83114e998b5d72ef9c1ad9eff9465a7a89c1204f1b7c42839d2b9
@@ -0,0 +1,56 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ # Ignore Byebug command history file.
17
+ .byebug_history
18
+
19
+ ## Specific to RubyMotion:
20
+ .dat*
21
+ .repl_history
22
+ build/
23
+ *.bridgesupport
24
+ build-iPhoneOS/
25
+ build-iPhoneSimulator/
26
+
27
+ ## Specific to RubyMotion (use of CocoaPods):
28
+ #
29
+ # We recommend against adding the Pods directory to your .gitignore. However
30
+ # you should judge for yourself, the pros and cons are mentioned at:
31
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
32
+ #
33
+ # vendor/Pods/
34
+
35
+ ## Documentation cache and generated files:
36
+ /.yardoc/
37
+ /_yardoc/
38
+ /doc/
39
+ /rdoc/
40
+
41
+ ## Environment normalization:
42
+ /.bundle/
43
+ /vendor/bundle
44
+ /lib/bundler/man/
45
+
46
+ # for a library or gem, you might want to ignore these files since the code is
47
+ # intended to run in multiple environments; otherwise, check them in:
48
+ # Gemfile.lock
49
+ # .ruby-version
50
+ # .ruby-gemset
51
+
52
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
53
+ .rvmrc
54
+
55
+ # Used by RuboCop. Remote config files pulled in from inherit_from directive.
56
+ # .rubocop-https?--*
@@ -0,0 +1 @@
1
+ 2.7.0
@@ -0,0 +1 @@
1
+ fix: true
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ cache: bundler
3
+ matrix:
4
+ fast_finish: true
5
+ rvm:
6
+ - 2.1.0
7
+ - 2.2.0
8
+ - 2.3.0
9
+ - 2.4.0
10
+ - 2.5.0
11
+ - 2.6.0
12
+ script: bundle exec rake test
13
+ before_install:
14
+ - gem install bundler -v '< 2'
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ # Hinting at development dependencies
6
+ # Prevents bundler from taking a long-time to resolve
7
+ group :development, :test do
8
+ gem 'pry'
9
+ gem 'standard'
10
+ end
@@ -0,0 +1,47 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ spurdo (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.0)
10
+ coderay (1.1.2)
11
+ jaro_winkler (1.5.4)
12
+ method_source (1.0.0)
13
+ parallel (1.19.1)
14
+ parser (2.7.0.5)
15
+ ast (~> 2.4.0)
16
+ pry (0.13.0)
17
+ coderay (~> 1.1)
18
+ method_source (~> 1.0)
19
+ rainbow (3.0.0)
20
+ rake (13.0.1)
21
+ rubocop (0.79.0)
22
+ jaro_winkler (~> 1.5.1)
23
+ parallel (~> 1.10)
24
+ parser (>= 2.7.0.1)
25
+ rainbow (>= 2.2.2, < 4.0)
26
+ ruby-progressbar (~> 1.7)
27
+ unicode-display_width (>= 1.4.0, < 1.7)
28
+ rubocop-performance (1.5.2)
29
+ rubocop (>= 0.71.0)
30
+ ruby-progressbar (1.10.1)
31
+ standard (0.2.1)
32
+ rubocop (~> 0.79.0)
33
+ rubocop-performance (~> 1.5.1)
34
+ unicode-display_width (1.6.1)
35
+
36
+ PLATFORMS
37
+ ruby
38
+
39
+ DEPENDENCIES
40
+ bundler
41
+ pry
42
+ rake
43
+ spurdo!
44
+ standard
45
+
46
+ BUNDLED WITH
47
+ 2.1.4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 swaggermeister
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,16 @@
1
+ # spurdo
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/spurdo.svg)](https://badge.fury.io/rb/spurdo) [![Build Status](https://travis-ci.org/swaggermeister/spurdo.svg?branch=master)](https://travis-ci.org/swaggermeister/spurdo) [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) ![GitHub stars](https://img.shields.io/github/stars/swaggermeister/spurdo?style=social)
4
+
5
+ ![Spurdo](https://user-images.githubusercontent.com/28652/66000937-7ad7a880-e46e-11e9-9a99-5cf7163665a8.gif)
6
+
7
+ Ruby Gem for English to Spurdo speak :DDD
8
+
9
+ Ruby port of the [Spurdo NPM module](https://www.npmjs.com/package/spurdo).
10
+
11
+ ## Usage
12
+
13
+ ```ruby
14
+ Spurdo.to_spurdo("We the People of the United States.")
15
+ # "We de beoble of de Unided States XDD"
16
+ ```
@@ -0,0 +1,9 @@
1
+ require "rake/testtask"
2
+
3
+ Rake::TestTask.new(:test) do |t|
4
+ t.libs << "test"
5
+ t.libs << "lib"
6
+ t.test_files = FileList["test/**/test_*.rb"]
7
+ end
8
+
9
+ task default: :test
@@ -0,0 +1,81 @@
1
+ class Spurdo
2
+ # define replacements
3
+
4
+ REPLACEMENTS = [
5
+ ["[.]", " :DD"],
6
+ [",", " XDD"],
7
+
8
+ ["epic", "ebin"],
9
+
10
+ ["wh", "w"],
11
+ ["th", "d"],
12
+
13
+ ["af", "ab"],
14
+ ["ap", "ab"],
15
+ ["ca", "ga"],
16
+ ["ck", "gg"],
17
+ ["co", "go"],
18
+ ["ev", "eb"],
19
+ ["ex", "egz"],
20
+ ["et", "ed"],
21
+ ["iv", "ib"],
22
+ ["it", "id"],
23
+ ["ke", "ge"],
24
+ ["nt", "nd"],
25
+ ["op", "ob"],
26
+ ["ot", "od"],
27
+ ["po", "bo"],
28
+ ["pe", "be"],
29
+ ["up", "ub"],
30
+
31
+ ["ck", "gg"],
32
+ ["cr", "gr"],
33
+ ["kn", "gn"],
34
+ ["lt", "ld"],
35
+ ["mm", "m"],
36
+ ["pr", "br"],
37
+ ["ts", "dz"],
38
+ ["tr", "dr"],
39
+
40
+ ["as", "az"],
41
+ ["bs", "bz"],
42
+ ["ds", "dz"],
43
+ ["fs", "fz"],
44
+ ["gs", "gz"],
45
+ ["is", "iz"],
46
+ ["ls", "lz"],
47
+ ["ms", "mz"],
48
+ ["ns", "nz"],
49
+ ["rs", "rz"],
50
+ ["ss", "sz"],
51
+ ["us", "uz"],
52
+ ["ws", "wz"],
53
+ ["ys", "yz"],
54
+
55
+ ["alk", "olk"],
56
+ ["ing", "ign"],
57
+
58
+ ["ic", "ig"],
59
+ ["ng", "nk"]
60
+ ]
61
+
62
+ SPURDO_SMILE_PATTERN = ":D"
63
+ SPURDO_SMILE_APPEND = " :DD"
64
+
65
+ def self.to_spurdo(string)
66
+ # apply replacements
67
+ REPLACEMENTS.each do |filter|
68
+ from = filter[0]
69
+ to = filter[1]
70
+ string = string.gsub(/#{from}/i, to)
71
+ end
72
+
73
+ # append Spurdo smile if not found
74
+ unless string.include?(SPURDO_SMILE_PATTERN)
75
+ string += SPURDO_SMILE_APPEND
76
+ end
77
+
78
+ # return spurdo'd text
79
+ string
80
+ end
81
+ end
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "spurdo"
3
+ s.version = "0.0.1"
4
+ s.platform = Gem::Platform::RUBY
5
+ s.authors = ["swaggermeister"]
6
+ s.description = "Ruby gem to translate English to Spurdo-speak :DDD"
7
+ s.summary = "Ruby gem to translate English to Spurdo-speak :DDD"
8
+ s.homepage = "https://github.com/swaggermeister/spurdo"
9
+ s.license = "MIT"
10
+ s.metadata = {
11
+ "source_code_uri" => "https://github.com/swaggermeister/spurdo"
12
+ }
13
+
14
+ s.files = `git ls-files`.split($/)
15
+ s.test_files = s.files.grep(%r{^(test|spec)/})
16
+ s.require_paths = ["lib"]
17
+
18
+ s.required_ruby_version = ">= 1.9.3"
19
+
20
+ s.add_development_dependency "bundler"
21
+ s.add_development_dependency "rake"
22
+ s.add_development_dependency "pry"
23
+ end
@@ -0,0 +1,214 @@
1
+ require "minitest/autorun"
2
+ require "../lib/spurdo.rb"
3
+
4
+ describe Spurdo do
5
+ it "recites the preamble to the US Constitution" do
6
+ preamble = "We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America."
7
+ expected_text = "We de beoble of de Unided States XDD in Order to form a more berfect Union XDD establizh Juztige XDD inzure domestig dranquilidy XDD brovide for de gomon defence XDD bromode de general Welfare XDD and secure de Bleszignz of Liberty to ourzelves and our bosteridy XDD do ordain and establizh diz gonztidution for de Unided States of Ameriga :DD"
8
+ _(Spurdo.to_spurdo(preamble)).must_equal(expected_text)
9
+ end
10
+
11
+ it "changes periods to :DD smiles" do
12
+ _(Spurdo.to_spurdo("Hi. How are you?")).must_equal("Hi :DD How are you?")
13
+ end
14
+
15
+ it "changes commas in the middle of a sentence to XD smiles" do
16
+ _(Spurdo.to_spurdo("One, two, three")).must_equal("One XDD two XDD dree :DD")
17
+ end
18
+
19
+ it 'no change in "hello"' do
20
+ _(Spurdo.to_spurdo("hello :D")).must_equal("hello :D")
21
+ end
22
+
23
+ it "adds a smile if none" do
24
+ _(Spurdo.to_spurdo("dang")).must_equal("dank :DD")
25
+ end
26
+
27
+ it "keeps the smile if already has one" do
28
+ _(Spurdo.to_spurdo("dang :D")).must_equal("dank :D")
29
+ end
30
+
31
+ it "epic -> ebin" do
32
+ _(Spurdo.to_spurdo("epic :D")).must_equal("ebin :D")
33
+ end
34
+
35
+ it "wh -> w" do
36
+ _(Spurdo.to_spurdo("what :D")).must_equal("wat :D")
37
+ end
38
+
39
+ it "th -> d" do
40
+ _(Spurdo.to_spurdo("that :D")).must_equal("dat :D")
41
+ end
42
+
43
+ it "af -> ab" do
44
+ _(Spurdo.to_spurdo("after :D")).must_equal("abter :D")
45
+ end
46
+
47
+ it "ap -> ab" do
48
+ _(Spurdo.to_spurdo("apple :D")).must_equal("abple :D")
49
+ end
50
+
51
+ it "ca -> ga" do
52
+ _(Spurdo.to_spurdo("cake :D")).must_equal("gage :D")
53
+ end
54
+
55
+ it "ck -> g" do
56
+ _(Spurdo.to_spurdo("clock :D")).must_equal("clogg :D")
57
+ end
58
+
59
+ it "co -> go" do
60
+ _(Spurdo.to_spurdo("cool :D")).must_equal("gool :D")
61
+ end
62
+
63
+ it "ev -> eb" do
64
+ _(Spurdo.to_spurdo("even :D")).must_equal("eben :D")
65
+ end
66
+
67
+ it "ex -> egz" do
68
+ _(Spurdo.to_spurdo("excel :D")).must_equal("egzcel :D")
69
+ end
70
+
71
+ it "et -> ed" do
72
+ _(Spurdo.to_spurdo("poet :D")).must_equal("boed :D")
73
+ end
74
+
75
+ it "iv -> ib" do
76
+ _(Spurdo.to_spurdo("live :D")).must_equal("libe :D")
77
+ end
78
+
79
+ it "it -> id" do
80
+ _(Spurdo.to_spurdo("slit :D")).must_equal("slid :D")
81
+ end
82
+
83
+ it "ke -> ge" do
84
+ _(Spurdo.to_spurdo("kernel :D")).must_equal("gernel :D")
85
+ end
86
+
87
+ it "nt -> nd" do
88
+ _(Spurdo.to_spurdo("mint :D")).must_equal("mind :D")
89
+ end
90
+
91
+ it "op -> ob" do
92
+ _(Spurdo.to_spurdo("open :D")).must_equal("oben :D")
93
+ end
94
+
95
+ it "ot -> od" do
96
+ _(Spurdo.to_spurdo("otter :D")).must_equal("odter :D")
97
+ end
98
+
99
+ it "po -> bo" do
100
+ _(Spurdo.to_spurdo("power :D")).must_equal("bower :D")
101
+ end
102
+
103
+ it "pe -> be" do
104
+ _(Spurdo.to_spurdo("pen :D")).must_equal("ben :D")
105
+ end
106
+
107
+ it "up -> ub" do
108
+ _(Spurdo.to_spurdo("super :D")).must_equal("suber :D")
109
+ end
110
+
111
+ it "ck -> gg" do
112
+ _(Spurdo.to_spurdo("click :D")).must_equal("cligg :D")
113
+ end
114
+
115
+ it "cr -> gr" do
116
+ _(Spurdo.to_spurdo("croak :D")).must_equal("groak :D")
117
+ end
118
+
119
+ it "kn -> gn" do
120
+ _(Spurdo.to_spurdo("know :D")).must_equal("gnow :D")
121
+ end
122
+
123
+ it "lt -> ld" do
124
+ _(Spurdo.to_spurdo("wilt :D")).must_equal("wild :D")
125
+ end
126
+
127
+ it "mm -> m" do
128
+ _(Spurdo.to_spurdo("summer :D")).must_equal("sumer :D")
129
+ end
130
+
131
+ it "pr -> br" do
132
+ _(Spurdo.to_spurdo("prong :D")).must_equal("bronk :D")
133
+ end
134
+
135
+ it "ts -> dz" do
136
+ _(Spurdo.to_spurdo("hits :D")).must_equal("hidz :D")
137
+ end
138
+
139
+ it "tr -> dr" do
140
+ _(Spurdo.to_spurdo("truck :D")).must_equal("drugg :D")
141
+ end
142
+
143
+ it "as -> az" do
144
+ _(Spurdo.to_spurdo("gas :D")).must_equal("gaz :D")
145
+ end
146
+
147
+ it "bs -> bz" do
148
+ _(Spurdo.to_spurdo("dibs :D")).must_equal("dibz :D")
149
+ end
150
+
151
+ it "ds -> dz" do
152
+ _(Spurdo.to_spurdo("duds :D")).must_equal("dudz :D")
153
+ end
154
+
155
+ it "fs -> fz" do
156
+ _(Spurdo.to_spurdo("gifs :D")).must_equal("gifz :D")
157
+ end
158
+
159
+ it "gs -> gz" do
160
+ _(Spurdo.to_spurdo("figs :D")).must_equal("figz :D")
161
+ end
162
+
163
+ it "is -> iz" do
164
+ _(Spurdo.to_spurdo("foolish :D")).must_equal("foolizh :D")
165
+ end
166
+
167
+ it "ls -> lz" do
168
+ _(Spurdo.to_spurdo("kills :D")).must_equal("killz :D")
169
+ end
170
+
171
+ it "ms -> mz" do
172
+ _(Spurdo.to_spurdo("yams :D")).must_equal("yamz :D")
173
+ end
174
+
175
+ it "ns -> nz" do
176
+ _(Spurdo.to_spurdo("buns :D")).must_equal("bunz :D")
177
+ end
178
+
179
+ it "rs -> rz" do
180
+ _(Spurdo.to_spurdo("towers :D")).must_equal("towerz :D")
181
+ end
182
+
183
+ it "ss -> sz" do
184
+ _(Spurdo.to_spurdo("moss :D")).must_equal("mosz :D")
185
+ end
186
+
187
+ it "us -> uz" do
188
+ _(Spurdo.to_spurdo("thus :D")).must_equal("duz :D")
189
+ end
190
+
191
+ it "ws -> wz" do
192
+ _(Spurdo.to_spurdo("skews :D")).must_equal("sgewz :D")
193
+ end
194
+
195
+ it "ys -> yz" do
196
+ _(Spurdo.to_spurdo("lays :D")).must_equal("layz :D")
197
+ end
198
+
199
+ it "alk -> olk" do
200
+ _(Spurdo.to_spurdo("chalk :D")).must_equal("cholk :D")
201
+ end
202
+
203
+ it "ing -> ign" do
204
+ _(Spurdo.to_spurdo("happening :D")).must_equal("habbenign :D")
205
+ end
206
+
207
+ it "ic -> ig" do
208
+ _(Spurdo.to_spurdo("plastic :D")).must_equal("plaztig :D")
209
+ end
210
+
211
+ it "ng -> nk" do
212
+ _(Spurdo.to_spurdo("rang :D")).must_equal("rank :D")
213
+ end
214
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spurdo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - swaggermeister
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-03-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Ruby gem to translate English to Spurdo-speak :DDD
56
+ email:
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - ".gitignore"
62
+ - ".ruby-version"
63
+ - ".standard.yml"
64
+ - ".travis.yml"
65
+ - Gemfile
66
+ - Gemfile.lock
67
+ - LICENSE
68
+ - README.md
69
+ - Rakefile
70
+ - lib/spurdo.rb
71
+ - spurdo.gemspec
72
+ - test/test_spurdo.rb
73
+ homepage: https://github.com/swaggermeister/spurdo
74
+ licenses:
75
+ - MIT
76
+ metadata:
77
+ source_code_uri: https://github.com/swaggermeister/spurdo
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 1.9.3
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.1.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Ruby gem to translate English to Spurdo-speak :DDD
97
+ test_files:
98
+ - test/test_spurdo.rb