spoonerize 0.1.2 → 0.2.0
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/.github/workflows/ruby.yml +27 -12
- data/Gemfile.lock +21 -5
- data/README.md +35 -32
- data/Rakefile +58 -10
- data/lib/spoonerize/bumper.rb +3 -2
- data/lib/spoonerize/cli.rb +31 -35
- data/lib/spoonerize/config.rb +50 -0
- data/lib/spoonerize/log.rb +7 -6
- data/lib/spoonerize/spoonerism.rb +41 -140
- data/lib/spoonerize/version.rb +36 -5
- data/lib/spoonerize.rb +59 -13
- data/spoonerize.gemspec +22 -25
- metadata +32 -7
- data/lib/config/lazy_words.yml +0 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 932ce6e7e6441c787ded513aebed0b3e0b83fa6afa83790abe8da66c9314e96b
|
|
4
|
+
data.tar.gz: 6a5dedc04324853f1bfbc63e6317b17737eab6fb10b89ae11136b598438a4f08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b579d2925471dca724865574a82a827a5f0d31229991d1746db4890a0d4c250141daa536bbc932c829fd9d7e8f5af63e89b85846a788d23eca766219c2a60681
|
|
7
|
+
data.tar.gz: 1531172c418c2cf00e155ca5e56c888218888af9c8b6694ff7a9b3195dbda173c122058e7ac46c4705c311d7951a8c6f773aa09d4571a447da7f4781ca425168
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
# .github/workflows/ruby.yml
|
|
2
|
+
name: Ruby CI
|
|
2
3
|
|
|
3
4
|
on:
|
|
4
5
|
push:
|
|
@@ -8,17 +9,31 @@ on:
|
|
|
8
9
|
|
|
9
10
|
jobs:
|
|
10
11
|
test:
|
|
12
|
+
runs-on: ubuntu-22.04
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
ruby-version: ['3.2', '3.3', '4.0']
|
|
13
18
|
|
|
14
19
|
steps:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ruby-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
- uses: actions/checkout@v3
|
|
21
|
+
|
|
22
|
+
# Set up Ruby and Bundler
|
|
23
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
24
|
+
uses: ruby/setup-ruby@v1
|
|
25
|
+
with:
|
|
26
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
27
|
+
bundler: ${{ matrix.ruby-version == '4.0' && '4.0.9' || '2.4.13' }}
|
|
28
|
+
bundler-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Print Ruby and Bundler versions
|
|
31
|
+
run: |
|
|
32
|
+
ruby -v
|
|
33
|
+
bundle -v
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: bundle install --jobs 4 --retry 3
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: bundle exec rake
|
data/Gemfile.lock
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
spoonerize (0.
|
|
4
|
+
spoonerize (0.2.0)
|
|
5
|
+
csv
|
|
5
6
|
|
|
6
7
|
GEM
|
|
7
8
|
remote: https://rubygems.org/
|
|
8
9
|
specs:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
csv (3.3.5)
|
|
11
|
+
date (3.5.1)
|
|
12
|
+
erb (6.0.4)
|
|
13
|
+
power_assert (3.0.1)
|
|
14
|
+
psych (5.4.0)
|
|
15
|
+
date
|
|
16
|
+
stringio
|
|
17
|
+
rake (13.4.2)
|
|
18
|
+
rdoc (7.2.0)
|
|
19
|
+
erb
|
|
20
|
+
psych (>= 4.0.0)
|
|
21
|
+
tsort
|
|
22
|
+
stringio (3.2.0)
|
|
23
|
+
test-unit (3.7.8)
|
|
12
24
|
power_assert
|
|
25
|
+
tsort (0.2.0)
|
|
13
26
|
|
|
14
27
|
PLATFORMS
|
|
28
|
+
arm64-darwin-25
|
|
15
29
|
x86_64-darwin-20
|
|
30
|
+
x86_64-linux
|
|
16
31
|
|
|
17
32
|
DEPENDENCIES
|
|
18
33
|
rake (~> 13.0, >= 13.0.1)
|
|
34
|
+
rdoc
|
|
19
35
|
spoonerize!
|
|
20
36
|
test-unit (~> 3.3, >= 3.3.5)
|
|
21
37
|
|
|
22
38
|
BUNDLED WITH
|
|
23
|
-
|
|
39
|
+
4.0.10
|
data/README.md
CHANGED
|
@@ -104,19 +104,20 @@ Here is a list of all available options:
|
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
### Config File
|
|
107
|
-
You can create a config file called `~/.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
You can create a Ruby config file called `~/.spoonerizerc`. The CLI loads this
|
|
108
|
+
file automatically before it parses command-line options, so options set in the
|
|
109
|
+
file can still be overridden at runtime by executable flags.
|
|
110
|
+
|
|
111
|
+
```ruby
|
|
112
|
+
Spoonerize.configure do |config|
|
|
113
|
+
config.excluded_words = []
|
|
114
|
+
config.lazy = false
|
|
115
|
+
config.reverse = false
|
|
116
|
+
config.logfile_name = File.expand_path("~/.cache/spoonerize/spoonerize.csv")
|
|
117
|
+
end
|
|
116
118
|
```
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
executable's flags.
|
|
120
|
+
Because the file is Ruby, you can set only the values you want to change.
|
|
120
121
|
|
|
121
122
|
## API
|
|
122
123
|
The API is [fully
|
|
@@ -126,39 +127,41 @@ are some quick examples of how you could use this in your ruby code.
|
|
|
126
127
|
```ruby
|
|
127
128
|
require 'spoonerize'
|
|
128
129
|
|
|
129
|
-
spoonerism = Spoonerize::Spoonerism.new(%w[not too shabby])
|
|
130
|
-
|
|
130
|
+
spoonerism = Spoonerize::Spoonerism.new(%w[not too shabby])
|
|
131
|
+
|
|
132
|
+
spoonerism.to_s
|
|
133
|
+
# => tot shoo nabby
|
|
134
|
+
|
|
135
|
+
Spoonerize.configure do |config|
|
|
136
|
+
config.reverse = true
|
|
131
137
|
end
|
|
132
138
|
|
|
133
|
-
spoonerism.
|
|
139
|
+
spoonerism.to_s
|
|
134
140
|
# => shot noo tabby
|
|
135
141
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
spoonerism.logfile_name = '~/.cache/spoonerize/spoonerize.csv'
|
|
142
|
+
Spoonerize.configure do |config|
|
|
143
|
+
config.logfile_name = File.expand_path("~/.cache/spoonerize/spoonerize.csv")
|
|
144
|
+
end
|
|
141
145
|
spoonerism.save
|
|
142
146
|
```
|
|
143
147
|
|
|
144
|
-
You can also
|
|
145
|
-
initialization, or via the setter. The config file will be automatically loaded
|
|
146
|
-
if passed at initialization, before the instance is yielded so you can still
|
|
147
|
-
change the values via the block. If set via the setter, you must call
|
|
148
|
-
`#load_config_file`.
|
|
148
|
+
You can also configure Spoonerize in Ruby before creating a spoonerism:
|
|
149
149
|
|
|
150
150
|
```ruby
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
sp.reverse = true
|
|
151
|
+
Spoonerize.configure do |config|
|
|
152
|
+
config.reverse = true
|
|
154
153
|
end
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
s
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
s = Spoonerize::Spoonerism.new(%w[not too shabby])
|
|
156
|
+
s.spoonerize
|
|
157
|
+
# => shot noo tabby
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Or load a config file manually:
|
|
160
161
|
|
|
161
|
-
|
|
162
|
+
```ruby
|
|
163
|
+
Spoonerize.load_config_file("~/.spoonerizerc")
|
|
164
|
+
s = Spoonerize::Spoonerism.new(%w[not too shabby])
|
|
162
165
|
```
|
|
163
166
|
|
|
164
167
|
## Self Promotion
|
data/Rakefile
CHANGED
|
@@ -1,19 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
require
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/spoonerize"
|
|
4
|
+
require "bundler/gem_tasks"
|
|
5
|
+
require "rdoc/task"
|
|
6
|
+
require "rake/testtask"
|
|
5
7
|
|
|
6
8
|
Rake::TestTask.new do |t|
|
|
7
|
-
t.libs = [
|
|
9
|
+
t.libs = ["lib"]
|
|
8
10
|
t.warning = true
|
|
9
11
|
t.verbose = true
|
|
10
|
-
t.test_files = FileList[
|
|
12
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
|
11
13
|
end
|
|
12
14
|
|
|
13
15
|
RDoc::Task.new do |rdoc|
|
|
14
|
-
rdoc.main =
|
|
15
|
-
rdoc.rdoc_dir =
|
|
16
|
-
rdoc.rdoc_files.include(
|
|
16
|
+
rdoc.main = "README.md"
|
|
17
|
+
rdoc.rdoc_dir = "docs"
|
|
18
|
+
rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
task default: :test
|
|
22
|
+
|
|
23
|
+
namespace :version do
|
|
24
|
+
desc "Print the current version from the version.rb file"
|
|
25
|
+
task :current do
|
|
26
|
+
puts Spoonerize::VERSION
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
namespace :increment do
|
|
30
|
+
desc "Increment the version's PATCH level"
|
|
31
|
+
task :patch do
|
|
32
|
+
File.join(__dir__, "lib", "spoonerize", "version.rb").then do |version_file|
|
|
33
|
+
File.write(
|
|
34
|
+
version_file,
|
|
35
|
+
File.read(version_file).sub(/(PATCH\s=\s)(\d+)/) { "#{$1}#{$2.next}" }
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
system("bundle lock")
|
|
39
|
+
end
|
|
40
|
+
desc "Increment the version's MINOR level"
|
|
41
|
+
task :minor do
|
|
42
|
+
File.join(__dir__, "lib", "spoonerize", "version.rb").then do |version_file|
|
|
43
|
+
File.write(
|
|
44
|
+
version_file,
|
|
45
|
+
File.read(version_file)
|
|
46
|
+
.sub(/(PATCH\s=\s)(\d+)/) { "#{$1}0" }
|
|
47
|
+
.sub(/(MINOR\s=\s)(\d+)/) { "#{$1}#{$2.next}" }
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
system("bundle lock")
|
|
51
|
+
end
|
|
52
|
+
desc "Increment the version's MAJOR level"
|
|
53
|
+
task :major do
|
|
54
|
+
File.join(__dir__, "lib", "spoonerize", "version.rb").then do |version_file|
|
|
55
|
+
File.write(
|
|
56
|
+
version_file,
|
|
57
|
+
File.read(version_file)
|
|
58
|
+
.sub(/(PATCH\s=\s)(\d+)/) { "#{$1}0" }
|
|
59
|
+
.sub(/(MINOR\s=\s)(\d+)/) { "#{$1}0" }
|
|
60
|
+
.sub(/(MAJOR\s=\s)(\d+)/) { "#{$1}#{$2.next}" }
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
system("bundle lock")
|
|
64
|
+
end
|
|
65
|
+
end
|
|
17
66
|
end
|
|
18
67
|
|
|
19
|
-
task :default => :test
|
data/lib/spoonerize/bumper.rb
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Spoonerize
|
|
2
4
|
##
|
|
3
5
|
# Class that handles bumping an index.
|
|
4
6
|
class Bumper
|
|
5
|
-
|
|
6
7
|
##
|
|
7
8
|
# The number after being bumped.
|
|
8
9
|
#
|
|
@@ -55,7 +56,7 @@ module Spoonerize
|
|
|
55
56
|
|
|
56
57
|
def bump_value(val) # :nodoc:
|
|
57
58
|
return val - 1 if @reverse
|
|
58
|
-
val + 1 == @max_value ? 0 : val + 1
|
|
59
|
+
(val + 1 == @max_value) ? 0 : val + 1
|
|
59
60
|
end
|
|
60
61
|
end
|
|
61
62
|
end
|
data/lib/spoonerize/cli.rb
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "optparse"
|
|
3
4
|
|
|
4
5
|
module Spoonerize
|
|
5
6
|
##
|
|
6
7
|
# The class for handling the command-line interface.
|
|
7
8
|
class Cli
|
|
8
|
-
|
|
9
9
|
##
|
|
10
|
-
# The
|
|
10
|
+
# The config file the user can create to change default runtime options.
|
|
11
11
|
#
|
|
12
12
|
# @return [String]
|
|
13
|
-
|
|
14
|
-
File.expand_path(File.join(ENV['HOME'], '.spoonerize.yml')).freeze
|
|
13
|
+
CONFIG_FILE = File.expand_path(File.join(ENV["HOME"], ".spoonerizerc"))
|
|
15
14
|
|
|
16
15
|
##
|
|
17
16
|
# Creates an instance of +Spoonerism+ and runs what the user requested.
|
|
@@ -20,12 +19,12 @@ module Spoonerize
|
|
|
20
19
|
def self.execute(options = [])
|
|
21
20
|
exe = new(options)
|
|
22
21
|
|
|
23
|
-
if exe.
|
|
22
|
+
if exe.print_log?
|
|
24
23
|
exe.print_log
|
|
25
24
|
return
|
|
26
25
|
end
|
|
27
26
|
|
|
28
|
-
puts exe.spoonerism
|
|
27
|
+
puts exe.spoonerism
|
|
29
28
|
exe.print_mappings if exe.map?
|
|
30
29
|
|
|
31
30
|
if exe.save?
|
|
@@ -53,23 +52,20 @@ module Spoonerize
|
|
|
53
52
|
#
|
|
54
53
|
# @return [self]
|
|
55
54
|
def initialize(options)
|
|
56
|
-
|
|
57
|
-
@
|
|
58
|
-
@
|
|
59
|
-
@
|
|
55
|
+
Spoonerize.load_config_file(CONFIG_FILE) if File.file?(CONFIG_FILE)
|
|
56
|
+
@map = false
|
|
57
|
+
@save = false
|
|
58
|
+
@print_log = false
|
|
59
|
+
@options = options
|
|
60
60
|
@preferences = get_preferences
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
##
|
|
64
|
-
# Sets up an instance of +Spoonerize::Spoonerism+
|
|
65
|
-
# preferences.
|
|
64
|
+
# Sets up an instance of +Spoonerize::Spoonerism+
|
|
66
65
|
#
|
|
67
66
|
# @return [Spoonerize::Spoonerism]
|
|
68
67
|
def spoonerism
|
|
69
|
-
|
|
70
|
-
@spoonerism ||= Spoonerism.new(options, pf) do |s|
|
|
71
|
-
preferences.each { |k, v| s.send("#{k}=", v) }
|
|
72
|
-
end
|
|
68
|
+
@spoonerism ||= Spoonerism.new(options)
|
|
73
69
|
end
|
|
74
70
|
|
|
75
71
|
##
|
|
@@ -92,8 +88,8 @@ module Spoonerize
|
|
|
92
88
|
# Should we print to the command line?
|
|
93
89
|
#
|
|
94
90
|
# @return [Boolean]
|
|
95
|
-
def
|
|
96
|
-
@
|
|
91
|
+
def print_log?
|
|
92
|
+
@print_log
|
|
97
93
|
end
|
|
98
94
|
|
|
99
95
|
##
|
|
@@ -101,8 +97,7 @@ module Spoonerize
|
|
|
101
97
|
#
|
|
102
98
|
# @return [Integer]
|
|
103
99
|
def longest_word_length
|
|
104
|
-
@longest_word_length ||=
|
|
105
|
-
spoonerism.spoonerize.group_by(&:size).max.first.size
|
|
100
|
+
@longest_word_length ||= spoonerism.spoonerize.max_by(&:size).size
|
|
106
101
|
end
|
|
107
102
|
|
|
108
103
|
##
|
|
@@ -110,8 +105,9 @@ module Spoonerize
|
|
|
110
105
|
#
|
|
111
106
|
# @return [nil]
|
|
112
107
|
def print_log
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
Spoonerize::Log.new(Spoonerize.config.logfile_name).each do |row|
|
|
109
|
+
puts row.join(" | ")
|
|
110
|
+
end
|
|
115
111
|
end
|
|
116
112
|
|
|
117
113
|
##
|
|
@@ -120,7 +116,7 @@ module Spoonerize
|
|
|
120
116
|
# @return [nil]
|
|
121
117
|
def print_mappings
|
|
122
118
|
spoonerism.to_h.each do |k, v|
|
|
123
|
-
|
|
119
|
+
printf("%-#{longest_word_length + 1}s => %s\n", k, v)
|
|
124
120
|
end
|
|
125
121
|
end
|
|
126
122
|
|
|
@@ -132,23 +128,23 @@ module Spoonerize
|
|
|
132
128
|
{}.tap do |prefs|
|
|
133
129
|
OptionParser.new do |o|
|
|
134
130
|
o.version = ::Spoonerize::Version.to_s
|
|
135
|
-
o.on(
|
|
136
|
-
|
|
131
|
+
o.on("-r", "--[no-]reverse", "Reverse flipping") do |v|
|
|
132
|
+
Spoonerize.config.reverse = v
|
|
137
133
|
end
|
|
138
|
-
o.on(
|
|
139
|
-
|
|
134
|
+
o.on("-l", "--[no-]lazy", "Skip small words") do |v|
|
|
135
|
+
Spoonerize.config.lazy = v
|
|
140
136
|
end
|
|
141
|
-
o.on(
|
|
137
|
+
o.on("-m", "--[no-]map", "Print words mapping") do |v|
|
|
142
138
|
@map = v
|
|
143
139
|
end
|
|
144
|
-
o.on(
|
|
145
|
-
@
|
|
140
|
+
o.on("-p", "--[no-]print-log", "Print all entries in the log") do |v|
|
|
141
|
+
@print_log = v
|
|
146
142
|
end
|
|
147
|
-
o.on(
|
|
143
|
+
o.on("-s", "--[no-]save", "Save results in log") do |v|
|
|
148
144
|
@save = v
|
|
149
145
|
end
|
|
150
|
-
o.on(
|
|
151
|
-
|
|
146
|
+
o.on("--exclude=WORD", Array, "Words to skip") do |v|
|
|
147
|
+
Spoonerize.config.excluded_words = v
|
|
152
148
|
end
|
|
153
149
|
end.parse!(options)
|
|
154
150
|
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Spoonerize
|
|
4
|
+
class Config
|
|
5
|
+
##
|
|
6
|
+
# Lazy mode. If true, words in +lazy_words+ will not be altered.
|
|
7
|
+
#
|
|
8
|
+
# @return [Boolean]
|
|
9
|
+
attr_accessor :lazy
|
|
10
|
+
|
|
11
|
+
##
|
|
12
|
+
# Words to skip when +lazy+ is true.
|
|
13
|
+
#
|
|
14
|
+
# @return [Array]
|
|
15
|
+
attr_accessor :lazy_words
|
|
16
|
+
|
|
17
|
+
##
|
|
18
|
+
# Words that should not be altered.
|
|
19
|
+
#
|
|
20
|
+
# @return [Array]
|
|
21
|
+
attr_accessor :excluded_words
|
|
22
|
+
|
|
23
|
+
##
|
|
24
|
+
# When true, reverse the order of the flipping. Only makes a difference
|
|
25
|
+
# when there are more than two flip-able words.
|
|
26
|
+
#
|
|
27
|
+
# @return [Boolean]
|
|
28
|
+
attr_accessor :reverse
|
|
29
|
+
|
|
30
|
+
##
|
|
31
|
+
# Name of the log file. Should be a fully-qualified file path.
|
|
32
|
+
#
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :logfile_name
|
|
35
|
+
|
|
36
|
+
##
|
|
37
|
+
# Create instance of Config.
|
|
38
|
+
#
|
|
39
|
+
# @return [Spoonerize::Config]
|
|
40
|
+
def initialize
|
|
41
|
+
@lazy = false
|
|
42
|
+
@lazy_words = %w[i a an and in of the my your his her him hers to is]
|
|
43
|
+
@excluded_words = []
|
|
44
|
+
@reverse = false
|
|
45
|
+
@logfile_name = File.expand_path(
|
|
46
|
+
File.join(ENV["HOME"], ".cache", "spoonerize", "spoonerize.csv")
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
data/lib/spoonerize/log.rb
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "csv"
|
|
4
|
+
require "fileutils"
|
|
3
5
|
|
|
4
6
|
module Spoonerize
|
|
5
7
|
##
|
|
6
|
-
# Class that handles reading/writing logs.
|
|
8
|
+
# Class that handles reading/writing logs. Log file is stored as a simple CSV.
|
|
7
9
|
class Log
|
|
8
|
-
|
|
9
10
|
##
|
|
10
11
|
# The file name to use.
|
|
11
12
|
#
|
|
@@ -46,13 +47,13 @@ module Spoonerize
|
|
|
46
47
|
#
|
|
47
48
|
# @return [Array]
|
|
48
49
|
def write(row)
|
|
49
|
-
::CSV.open(file,
|
|
50
|
+
::CSV.open(file, "a") { |csv| csv << row }
|
|
50
51
|
end
|
|
51
52
|
|
|
52
53
|
##
|
|
53
54
|
# Iterate through each line of the file.
|
|
54
55
|
#
|
|
55
|
-
# @return [
|
|
56
|
+
# @return [Enumerable]
|
|
56
57
|
def each
|
|
57
58
|
contents.each { |row| yield row }
|
|
58
59
|
end
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Spoonerize
|
|
2
4
|
##
|
|
3
5
|
# The main word-flipper.
|
|
4
6
|
class Spoonerism
|
|
5
|
-
|
|
6
7
|
##
|
|
7
8
|
# The words originally passed at initialization.
|
|
8
9
|
#
|
|
@@ -10,178 +11,76 @@ module Spoonerize
|
|
|
10
11
|
attr_reader :words
|
|
11
12
|
|
|
12
13
|
##
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
# @param [Boolean] true if should be lazy.
|
|
16
|
-
#
|
|
17
|
-
# @return [Boolean]
|
|
18
|
-
attr_writer :lazy
|
|
19
|
-
|
|
20
|
-
##
|
|
21
|
-
# This boolean determines if flipping should be reversed.
|
|
22
|
-
#
|
|
23
|
-
# @param [Boolean] true if should be reversed.
|
|
24
|
-
#
|
|
25
|
-
# @return [Boolean]
|
|
26
|
-
attr_writer :reverse
|
|
27
|
-
|
|
28
|
-
##
|
|
29
|
-
# The full path to the log file.
|
|
30
|
-
#
|
|
31
|
-
# @param [String] file
|
|
32
|
-
#
|
|
33
|
-
# @return [String]
|
|
34
|
-
attr_accessor :logfile_name
|
|
35
|
-
|
|
36
|
-
##
|
|
37
|
-
# The words that are to be excluded.
|
|
14
|
+
# Initialize instance.
|
|
38
15
|
#
|
|
39
16
|
# @param [Array] words
|
|
40
17
|
#
|
|
41
|
-
# @return [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
##
|
|
45
|
-
# The configuration file. Default is +nil+. If set to a string, and the file
|
|
46
|
-
# exists, it is used to set options.
|
|
47
|
-
#
|
|
48
|
-
# @return [String] file path
|
|
49
|
-
attr_reader :config_file
|
|
50
|
-
|
|
51
|
-
##
|
|
52
|
-
# The options from +config_file+ as a hash.
|
|
53
|
-
#
|
|
54
|
-
# @return [Hash] Options from +config_file+
|
|
55
|
-
attr_reader :config
|
|
56
|
-
|
|
57
|
-
##
|
|
58
|
-
# Initialize instance. You can also use the +config_file+ either by passing
|
|
59
|
-
# it at initialization, or via the setter. The config file will be
|
|
60
|
-
# automatically loaded if passed at initialization, before the instance is
|
|
61
|
-
# yielded so you can still change the values via the block. If set via the
|
|
62
|
-
# setter, you must call `#load_config_file`.
|
|
63
|
-
#
|
|
64
|
-
# @param [Array] words
|
|
65
|
-
#
|
|
66
|
-
# @param [String] config_file
|
|
67
|
-
#
|
|
68
|
-
# @example
|
|
69
|
-
# # Config file would be automatically loaded before block is executed.
|
|
70
|
-
# s = Spoonerise::Spoonerism.new(%w[not too shabby], '~/.spoonerize.yml') do |sp|
|
|
71
|
-
# sp.reverse = true # Would override setting from config file
|
|
72
|
-
# end
|
|
73
|
-
# # Config file would need to be manually loaded.
|
|
74
|
-
# s = Spoonerise::Spoonerism.new(%w[not too shabby]) do |sp|
|
|
75
|
-
# sp.config_file = '~/.spoonerize.yml'
|
|
76
|
-
# sp.reverse = true
|
|
77
|
-
# end
|
|
78
|
-
# s.load_config_file # Would override setting from initialization
|
|
79
|
-
def initialize(words, config_file = nil)
|
|
80
|
-
@config = {}
|
|
81
|
-
@excluded_words = []
|
|
18
|
+
# @return [Spoonerize::Spoonerism]
|
|
19
|
+
def initialize(words)
|
|
82
20
|
@words = words.map(&:downcase)
|
|
83
|
-
@lazy = false
|
|
84
|
-
@reverse = false
|
|
85
|
-
@config_file = config_file && File.expand_path(config_file)
|
|
86
|
-
@config_file_loaded = false
|
|
87
|
-
@logfile_name = File.expand_path(
|
|
88
|
-
File.join(ENV['HOME'], '.cache', 'spoonerize', 'spoonerize.csv')
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
load_config_file if config_file
|
|
92
|
-
|
|
93
|
-
yield self if block_given?
|
|
94
21
|
end
|
|
95
22
|
|
|
96
23
|
##
|
|
97
24
|
# Iterates through words array, and maps its elements to the output of
|
|
98
|
-
# flip_words.
|
|
25
|
+
# flip_words.
|
|
26
|
+
#
|
|
27
|
+
# @return [Array]
|
|
99
28
|
def spoonerize
|
|
100
|
-
raise
|
|
29
|
+
raise "Not enough words to flip" unless enough_flippable_words?
|
|
101
30
|
|
|
102
31
|
words.map.with_index { |word, idx| flip_words(word, idx) }
|
|
103
32
|
end
|
|
104
33
|
|
|
105
34
|
##
|
|
106
|
-
#
|
|
35
|
+
# Spoonerized results as a joined string.
|
|
36
|
+
#
|
|
37
|
+
# @return [String]
|
|
107
38
|
def to_s
|
|
108
|
-
spoonerize.join(
|
|
39
|
+
spoonerize.join(" ")
|
|
109
40
|
end
|
|
110
41
|
|
|
111
42
|
##
|
|
112
|
-
#
|
|
43
|
+
# Spoonerized results as a joined hash.
|
|
44
|
+
#
|
|
45
|
+
# @return [Hash]
|
|
113
46
|
def to_h
|
|
114
|
-
|
|
47
|
+
words.zip(spoonerize).to_h
|
|
115
48
|
end
|
|
116
49
|
|
|
117
50
|
##
|
|
118
51
|
# Same as to_h, but as json.
|
|
52
|
+
#
|
|
53
|
+
# @return [String]
|
|
119
54
|
def to_json
|
|
120
55
|
to_h.to_json
|
|
121
56
|
end
|
|
122
57
|
|
|
123
58
|
##
|
|
124
|
-
#
|
|
59
|
+
# True if there are more than one non-excluded word to flip
|
|
125
60
|
#
|
|
126
61
|
# @return [Boolean]
|
|
127
|
-
def config_file_loaded?
|
|
128
|
-
@config_file_loaded
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
##
|
|
132
|
-
# Returns true if there are more than one non-excluded word to flip
|
|
133
62
|
def enough_flippable_words?
|
|
134
63
|
(words - all_excluded_words).size > 1
|
|
135
64
|
end
|
|
136
65
|
|
|
137
|
-
##
|
|
138
|
-
# Should the lazy words be excluded?
|
|
139
|
-
def lazy?
|
|
140
|
-
@lazy
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
##
|
|
144
|
-
# Should the words flip the other direction?
|
|
145
|
-
def reverse?
|
|
146
|
-
@reverse
|
|
147
|
-
end
|
|
148
|
-
|
|
149
66
|
##
|
|
150
67
|
# Saves the flipped words to the log file, along with the options
|
|
151
|
-
def save
|
|
152
|
-
log.write([words.join(' '), to_s, options.join(', ')])
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
##
|
|
156
|
-
# Returns an array of words to exclude by combining three arrays:
|
|
157
|
-
# * Any word in the passed arguments that's only one character
|
|
158
|
-
# * Any user-passed words, stored in +excluded_words+
|
|
159
|
-
# * If lazy-mode, the LAZY_WORDS from yaml file are added
|
|
160
|
-
def all_excluded_words
|
|
161
|
-
(excluded_words + (lazy? ? LAZY_WORDS : [])).map(&:downcase)
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
##
|
|
165
|
-
# Setter for +config_file+. Must be expanded in case the user uses `~` for
|
|
166
|
-
# home.
|
|
167
|
-
#
|
|
168
|
-
# @param [String] file
|
|
169
68
|
#
|
|
170
|
-
# @return [
|
|
171
|
-
def
|
|
172
|
-
|
|
69
|
+
# @return [Array]
|
|
70
|
+
def save
|
|
71
|
+
log.write([words.join(" "), to_s, options.join(", ")])
|
|
173
72
|
end
|
|
174
73
|
|
|
175
74
|
##
|
|
176
|
-
#
|
|
75
|
+
# Array of words to exclude by combining two arrays:
|
|
76
|
+
# * Any user-passed words, stored in +Spoonerize.config.excluded_words+
|
|
77
|
+
# * Any lazy words, if lazy mode is true
|
|
177
78
|
#
|
|
178
|
-
# @return [
|
|
179
|
-
def
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
@config_file_loaded = true
|
|
184
|
-
@config.each { |k, v| send("#{k}=", v) }
|
|
79
|
+
# @return [Array]
|
|
80
|
+
def all_excluded_words
|
|
81
|
+
(Spoonerize.config.excluded_words + (
|
|
82
|
+
Spoonerize.config.lazy ? Spoonerize.config.lazy_words : []
|
|
83
|
+
)).map(&:downcase)
|
|
185
84
|
end
|
|
186
85
|
|
|
187
86
|
private
|
|
@@ -192,8 +91,8 @@ module Spoonerize
|
|
|
192
91
|
# through the end of the word.
|
|
193
92
|
def flip_words(word, idx) # :nodoc:
|
|
194
93
|
return word if excluded?(idx)
|
|
195
|
-
bumper = Bumper.new(idx, words.size, reverse
|
|
196
|
-
bumper.bump
|
|
94
|
+
bumper = Bumper.new(idx, words.size, Spoonerize.config.reverse)
|
|
95
|
+
bumper.bump while excluded?(bumper.value)
|
|
197
96
|
words[bumper.value].match(consonants).to_s + word.match(vowels).to_s
|
|
198
97
|
end
|
|
199
98
|
|
|
@@ -218,17 +117,19 @@ module Spoonerize
|
|
|
218
117
|
##
|
|
219
118
|
# Creates and memoizes instance of the log file.
|
|
220
119
|
def log # :nodoc:
|
|
221
|
-
@log ||= Spoonerize::Log.new(logfile_name)
|
|
120
|
+
@log ||= Spoonerize::Log.new(Spoonerize.config.logfile_name)
|
|
222
121
|
end
|
|
223
122
|
|
|
224
123
|
##
|
|
225
|
-
#
|
|
124
|
+
# The options that were passed at runtime as a string
|
|
226
125
|
def options # :nodoc:
|
|
227
126
|
[].tap do |o|
|
|
228
|
-
o <<
|
|
229
|
-
o <<
|
|
230
|
-
|
|
231
|
-
|
|
127
|
+
o << "Lazy" if Spoonerize.config.lazy
|
|
128
|
+
o << "Reverse" if Spoonerize.config.reverse
|
|
129
|
+
if Spoonerize.config.excluded_words.any?
|
|
130
|
+
o << "Exclude [#{Spoonerize.config.excluded_words.join(", ")}]"
|
|
131
|
+
end
|
|
132
|
+
o << "No Options" if o.empty?
|
|
232
133
|
end
|
|
233
134
|
end
|
|
234
135
|
end
|
data/lib/spoonerize/version.rb
CHANGED
|
@@ -5,23 +5,54 @@ module Spoonerize
|
|
|
5
5
|
# Module that contains all gem version information. Follows semantic
|
|
6
6
|
# versioning. Read: https://semver.org/
|
|
7
7
|
module Version
|
|
8
|
-
|
|
9
8
|
##
|
|
10
9
|
# Major version.
|
|
10
|
+
#
|
|
11
|
+
# @return [Integer]
|
|
11
12
|
MAJOR = 0
|
|
12
13
|
|
|
13
14
|
##
|
|
14
15
|
# Minor version.
|
|
15
|
-
|
|
16
|
+
#
|
|
17
|
+
# @return [Integer]
|
|
18
|
+
MINOR = 2
|
|
16
19
|
|
|
17
20
|
##
|
|
18
21
|
# Patch version.
|
|
19
|
-
|
|
22
|
+
#
|
|
23
|
+
# @return [Integer]
|
|
24
|
+
PATCH = 0
|
|
25
|
+
|
|
26
|
+
module_function
|
|
27
|
+
|
|
28
|
+
##
|
|
29
|
+
# Version as +[MAJOR, MINOR, PATCH]+
|
|
30
|
+
#
|
|
31
|
+
# @return [Array<Integer>]
|
|
32
|
+
def to_a
|
|
33
|
+
[MAJOR, MINOR, PATCH]
|
|
34
|
+
end
|
|
20
35
|
|
|
21
36
|
##
|
|
22
37
|
# Version as +MAJOR.MINOR.PATCH+
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
#
|
|
39
|
+
# @return [String]
|
|
40
|
+
def to_s
|
|
41
|
+
to_a.join(".")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
##
|
|
45
|
+
# Version as +{major: MAJOR, minor: MINOR, patch: PATCH}+
|
|
46
|
+
#
|
|
47
|
+
# @return [Hash]
|
|
48
|
+
def to_h
|
|
49
|
+
%i[major minor patch].zip(to_a).to_h
|
|
25
50
|
end
|
|
26
51
|
end
|
|
52
|
+
|
|
53
|
+
##
|
|
54
|
+
# The version, as a string.
|
|
55
|
+
#
|
|
56
|
+
# @return [String]
|
|
57
|
+
VERSION = Version.to_s
|
|
27
58
|
end
|
data/lib/spoonerize.rb
CHANGED
|
@@ -1,21 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require_relative
|
|
4
|
-
require_relative
|
|
5
|
-
require_relative
|
|
6
|
-
require_relative
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "spoonerize/config"
|
|
4
|
+
require_relative "spoonerize/spoonerism"
|
|
5
|
+
require_relative "spoonerize/bumper"
|
|
6
|
+
require_relative "spoonerize/version"
|
|
7
|
+
require_relative "spoonerize/log"
|
|
8
|
+
require_relative "spoonerize/cli"
|
|
7
9
|
|
|
8
10
|
##
|
|
9
11
|
# The main namespace for the gem.
|
|
10
12
|
module Spoonerize
|
|
11
13
|
##
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
+
# Has the config file been loaded?
|
|
15
|
+
@config_file_loaded = false
|
|
16
|
+
|
|
17
|
+
module_function
|
|
14
18
|
|
|
15
19
|
##
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
# Method for accessing the configuration.
|
|
21
|
+
#
|
|
22
|
+
# @return [Spoonerize::Config]
|
|
23
|
+
def config
|
|
24
|
+
@config || reset_config
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
##
|
|
28
|
+
# Reset all configuration values to their defaults.
|
|
29
|
+
#
|
|
30
|
+
# @return [Spoonerize::Config]
|
|
31
|
+
def reset_config
|
|
32
|
+
@config_file_loaded = false
|
|
33
|
+
@config = Spoonerize::Config.new
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
##
|
|
37
|
+
# Allows for configuration via a block. Useful when making config files.
|
|
38
|
+
#
|
|
39
|
+
# @example
|
|
40
|
+
# Spoonerize.configure { |s| s.lazy = true }
|
|
41
|
+
def configure
|
|
42
|
+
yield config
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
##
|
|
46
|
+
# Has a config file been loaded?
|
|
47
|
+
#
|
|
48
|
+
# @return [Boolean]
|
|
49
|
+
def config_file_loaded?
|
|
50
|
+
@config_file_loaded
|
|
51
|
+
end
|
|
21
52
|
|
|
53
|
+
##
|
|
54
|
+
# Loads a config file.
|
|
55
|
+
#
|
|
56
|
+
# @param [String] file
|
|
57
|
+
#
|
|
58
|
+
# @return [String] file
|
|
59
|
+
def load_config_file(config_file)
|
|
60
|
+
::File.expand_path(config_file).tap do |file|
|
|
61
|
+
raise "File #{file} does not exist." unless ::File.file?(file)
|
|
62
|
+
|
|
63
|
+
@config_file_loaded = true
|
|
64
|
+
load file
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
data/spoonerize.gemspec
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
require_relative
|
|
1
|
+
require_relative "lib/spoonerize/version"
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
|
-
spec.name
|
|
5
|
-
spec.version
|
|
6
|
-
spec.authors
|
|
7
|
-
spec.email
|
|
8
|
-
spec.license
|
|
9
|
-
spec.date = Time.now.strftime('%Y-%m-%d')
|
|
4
|
+
spec.name = "spoonerize"
|
|
5
|
+
spec.version = Spoonerize::VERSION
|
|
6
|
+
spec.authors = ["Evan Gray"]
|
|
7
|
+
spec.email = "evanthegrayt@vivaldi.net"
|
|
8
|
+
spec.license = "MIT"
|
|
10
9
|
|
|
11
|
-
spec.summary
|
|
12
|
-
spec.description
|
|
13
|
-
spec.homepage
|
|
10
|
+
spec.summary = %(Spoonerize phrases from the command line.)
|
|
11
|
+
spec.description = %(Spoonerize phrases from the command line. Comes with an API)
|
|
12
|
+
spec.homepage = "https://evanthegrayt.github.io/spoonerize/"
|
|
14
13
|
|
|
15
14
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
16
15
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
17
16
|
if spec.respond_to?(:metadata)
|
|
18
|
-
spec.metadata[
|
|
17
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
|
19
18
|
|
|
20
|
-
spec.metadata[
|
|
21
|
-
spec.metadata[
|
|
22
|
-
spec.metadata[
|
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/evanthegrayt/spoonerize"
|
|
21
|
+
spec.metadata["documentation_uri"] = "https://evanthegrayt.github.io/spoonerize/"
|
|
23
22
|
else
|
|
24
|
-
raise
|
|
23
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
|
25
24
|
end
|
|
26
25
|
|
|
27
26
|
# Specify which files should be added to the gem when it is released.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
spec.
|
|
33
|
-
spec.
|
|
34
|
-
spec.
|
|
35
|
-
spec.
|
|
36
|
-
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
|
|
37
|
-
spec.add_development_dependency 'test-unit', '~> 3.3', '>= 3.3.5'
|
|
27
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
28
|
+
spec.bindir = "bin"
|
|
29
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
30
|
+
spec.require_paths = ["lib"]
|
|
31
|
+
spec.add_dependency "csv"
|
|
32
|
+
spec.add_development_dependency "rdoc"
|
|
33
|
+
spec.add_development_dependency "rake", "~> 13.0", ">= 13.0.1"
|
|
34
|
+
spec.add_development_dependency "test-unit", "~> 3.3", ">= 3.3.5"
|
|
38
35
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spoonerize
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Evan Gray
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: csv
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rdoc
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
13
40
|
- !ruby/object:Gem::Dependency
|
|
14
41
|
name: rake
|
|
15
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,10 +93,10 @@ files:
|
|
|
66
93
|
- Rakefile
|
|
67
94
|
- _config.yml
|
|
68
95
|
- bin/spoonerize
|
|
69
|
-
- lib/config/lazy_words.yml
|
|
70
96
|
- lib/spoonerize.rb
|
|
71
97
|
- lib/spoonerize/bumper.rb
|
|
72
98
|
- lib/spoonerize/cli.rb
|
|
99
|
+
- lib/spoonerize/config.rb
|
|
73
100
|
- lib/spoonerize/log.rb
|
|
74
101
|
- lib/spoonerize/spoonerism.rb
|
|
75
102
|
- lib/spoonerize/version.rb
|
|
@@ -82,7 +109,6 @@ metadata:
|
|
|
82
109
|
homepage_uri: https://evanthegrayt.github.io/spoonerize/
|
|
83
110
|
source_code_uri: https://github.com/evanthegrayt/spoonerize
|
|
84
111
|
documentation_uri: https://evanthegrayt.github.io/spoonerize/
|
|
85
|
-
post_install_message:
|
|
86
112
|
rdoc_options: []
|
|
87
113
|
require_paths:
|
|
88
114
|
- lib
|
|
@@ -97,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
97
123
|
- !ruby/object:Gem::Version
|
|
98
124
|
version: '0'
|
|
99
125
|
requirements: []
|
|
100
|
-
rubygems_version:
|
|
101
|
-
signing_key:
|
|
126
|
+
rubygems_version: 4.0.10
|
|
102
127
|
specification_version: 4
|
|
103
128
|
summary: Spoonerize phrases from the command line.
|
|
104
129
|
test_files: []
|
data/lib/config/lazy_words.yml
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#=================================================================#
|
|
2
|
-
# File: lazy_words.yml #
|
|
3
|
-
# Description: Words to be excluded when "lazy" mode is enabled #
|
|
4
|
-
# #
|
|
5
|
-
# Author: Evan Gray #
|
|
6
|
-
#=================================================================#
|
|
7
|
-
|
|
8
|
-
- i
|
|
9
|
-
- a
|
|
10
|
-
- an
|
|
11
|
-
- and
|
|
12
|
-
- in
|
|
13
|
-
- of
|
|
14
|
-
- the
|
|
15
|
-
- my
|
|
16
|
-
- your
|
|
17
|
-
- his
|
|
18
|
-
- her
|
|
19
|
-
- him
|
|
20
|
-
- hers
|
|
21
|
-
- to
|
|
22
|
-
- is
|