spoonerize 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/.github/workflows/ruby.yml +27 -12
- data/Gemfile.lock +21 -5
- data/Rakefile +58 -10
- data/lib/spoonerize/bumper.rb +1 -2
- data/lib/spoonerize/cli.rb +20 -21
- data/lib/spoonerize/log.rb +3 -4
- data/lib/spoonerize/spoonerism.rb +13 -14
- data/lib/spoonerize/version.rb +35 -4
- data/lib/spoonerize.rb +7 -8
- data/spoonerize.gemspec +22 -25
- metadata +31 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb11ac34b545af8dd6a68950c95de9617c0b54995e5fb9b0ae55f3613d18be22
|
|
4
|
+
data.tar.gz: 5b60db2501c97458406205884f985e2b07a93a5e7a78b891daedcda45c687d33
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b9c899c14a35ae01d4aaa857f174427acaf91dbdad28a913c57b8e542e7fa33756f5e991c76cf5c978334280b2cd3217c32ef4749e52b2acfc5ed5f9de65cf6
|
|
7
|
+
data.tar.gz: 0e6c20e84abfb81cd4098f42ee9e5f1907e11c5e62827340885106cce38717dc770acdf21df087da9fcc81235e78bee60f4da05cffbdb3ee07a0b5395f4b7e9a
|
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.1.3)
|
|
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/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
|
@@ -2,7 +2,6 @@ module Spoonerize
|
|
|
2
2
|
##
|
|
3
3
|
# Class that handles bumping an index.
|
|
4
4
|
class Bumper
|
|
5
|
-
|
|
6
5
|
##
|
|
7
6
|
# The number after being bumped.
|
|
8
7
|
#
|
|
@@ -55,7 +54,7 @@ module Spoonerize
|
|
|
55
54
|
|
|
56
55
|
def bump_value(val) # :nodoc:
|
|
57
56
|
return val - 1 if @reverse
|
|
58
|
-
val + 1 == @max_value ? 0 : val + 1
|
|
57
|
+
(val + 1 == @max_value) ? 0 : val + 1
|
|
59
58
|
end
|
|
60
59
|
end
|
|
61
60
|
end
|
data/lib/spoonerize/cli.rb
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
1
|
+
require "optparse"
|
|
2
|
+
require "yaml"
|
|
3
3
|
|
|
4
4
|
module Spoonerize
|
|
5
5
|
##
|
|
6
6
|
# The class for handling the command-line interface.
|
|
7
7
|
class Cli
|
|
8
|
-
|
|
9
8
|
##
|
|
10
9
|
# The preferences file the user can create to change runtime options.
|
|
11
10
|
#
|
|
12
11
|
# @return [String]
|
|
13
12
|
PREFERENCE_FILE =
|
|
14
|
-
File.expand_path(File.join(ENV[
|
|
13
|
+
File.expand_path(File.join(ENV["HOME"], ".spoonerize.yml")).freeze
|
|
15
14
|
|
|
16
15
|
##
|
|
17
16
|
# Creates an instance of +Spoonerism+ and runs what the user requested.
|
|
@@ -25,7 +24,7 @@ module Spoonerize
|
|
|
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,10 +52,10 @@ module Spoonerize
|
|
|
53
52
|
#
|
|
54
53
|
# @return [self]
|
|
55
54
|
def initialize(options)
|
|
56
|
-
@map
|
|
57
|
-
@save
|
|
58
|
-
@print
|
|
59
|
-
@options
|
|
55
|
+
@map = false
|
|
56
|
+
@save = false
|
|
57
|
+
@print = false
|
|
58
|
+
@options = options
|
|
60
59
|
@preferences = get_preferences
|
|
61
60
|
end
|
|
62
61
|
|
|
@@ -68,7 +67,7 @@ module Spoonerize
|
|
|
68
67
|
def spoonerism
|
|
69
68
|
pf = File.file?(PREFERENCE_FILE) ? PREFERENCE_FILE : nil
|
|
70
69
|
@spoonerism ||= Spoonerism.new(options, pf) do |s|
|
|
71
|
-
preferences.each { |k, v| s.send("#{k}=", v) }
|
|
70
|
+
preferences.each { |k, v| s.send(:"#{k}=", v) }
|
|
72
71
|
end
|
|
73
72
|
end
|
|
74
73
|
|
|
@@ -111,7 +110,7 @@ module Spoonerize
|
|
|
111
110
|
# @return [nil]
|
|
112
111
|
def print_log
|
|
113
112
|
s = Spoonerize::Log.new(spoonerism.logfile_name)
|
|
114
|
-
s.each { |row| print row.join(
|
|
113
|
+
s.each { |row| print row.join(" | ") + "\n" }
|
|
115
114
|
end
|
|
116
115
|
|
|
117
116
|
##
|
|
@@ -120,7 +119,7 @@ module Spoonerize
|
|
|
120
119
|
# @return [nil]
|
|
121
120
|
def print_mappings
|
|
122
121
|
spoonerism.to_h.each do |k, v|
|
|
123
|
-
|
|
122
|
+
printf("%-#{longest_word_length}s => %s\n", k, v)
|
|
124
123
|
end
|
|
125
124
|
end
|
|
126
125
|
|
|
@@ -132,23 +131,23 @@ module Spoonerize
|
|
|
132
131
|
{}.tap do |prefs|
|
|
133
132
|
OptionParser.new do |o|
|
|
134
133
|
o.version = ::Spoonerize::Version.to_s
|
|
135
|
-
o.on(
|
|
136
|
-
prefs[
|
|
134
|
+
o.on("-r", "--[no-]reverse", "Reverse flipping") do |v|
|
|
135
|
+
prefs["reverse"] = v
|
|
137
136
|
end
|
|
138
|
-
o.on(
|
|
139
|
-
prefs[
|
|
137
|
+
o.on("-l", "--[no-]lazy", "Skip small words") do |v|
|
|
138
|
+
prefs["lazy"] = v
|
|
140
139
|
end
|
|
141
|
-
o.on(
|
|
140
|
+
o.on("-m", "--[no-]map", "Print words mapping") do |v|
|
|
142
141
|
@map = v
|
|
143
142
|
end
|
|
144
|
-
o.on(
|
|
143
|
+
o.on("-p", "--[no-]print", "Print all entries in the log") do |v|
|
|
145
144
|
@print = v
|
|
146
145
|
end
|
|
147
|
-
o.on(
|
|
146
|
+
o.on("-s", "--[no-]save", "Save results in log") do |v|
|
|
148
147
|
@save = v
|
|
149
148
|
end
|
|
150
|
-
o.on(
|
|
151
|
-
prefs[
|
|
149
|
+
o.on("--exclude=WORD", Array, "Words to skip") do |v|
|
|
150
|
+
prefs["exclude"] = v
|
|
152
151
|
end
|
|
153
152
|
end.parse!(options)
|
|
154
153
|
end
|
data/lib/spoonerize/log.rb
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
1
|
+
require "csv"
|
|
2
|
+
require "fileutils"
|
|
3
3
|
|
|
4
4
|
module Spoonerize
|
|
5
5
|
##
|
|
6
6
|
# Class that handles reading/writing logs.
|
|
7
7
|
class Log
|
|
8
|
-
|
|
9
8
|
##
|
|
10
9
|
# The file name to use.
|
|
11
10
|
#
|
|
@@ -46,7 +45,7 @@ module Spoonerize
|
|
|
46
45
|
#
|
|
47
46
|
# @return [Array]
|
|
48
47
|
def write(row)
|
|
49
|
-
::CSV.open(file,
|
|
48
|
+
::CSV.open(file, "a") { |csv| csv << row }
|
|
50
49
|
end
|
|
51
50
|
|
|
52
51
|
##
|
|
@@ -2,7 +2,6 @@ module Spoonerize
|
|
|
2
2
|
##
|
|
3
3
|
# The main word-flipper.
|
|
4
4
|
class Spoonerism
|
|
5
|
-
|
|
6
5
|
##
|
|
7
6
|
# The words originally passed at initialization.
|
|
8
7
|
#
|
|
@@ -85,7 +84,7 @@ module Spoonerize
|
|
|
85
84
|
@config_file = config_file && File.expand_path(config_file)
|
|
86
85
|
@config_file_loaded = false
|
|
87
86
|
@logfile_name = File.expand_path(
|
|
88
|
-
File.join(ENV[
|
|
87
|
+
File.join(ENV["HOME"], ".cache", "spoonerize", "spoonerize.csv")
|
|
89
88
|
)
|
|
90
89
|
|
|
91
90
|
load_config_file if config_file
|
|
@@ -97,7 +96,7 @@ module Spoonerize
|
|
|
97
96
|
# Iterates through words array, and maps its elements to the output of
|
|
98
97
|
# flip_words. Returns results as an array.
|
|
99
98
|
def spoonerize
|
|
100
|
-
raise JakPibError,
|
|
99
|
+
raise JakPibError, "Not enough words to flip" unless enough_flippable_words?
|
|
101
100
|
|
|
102
101
|
words.map.with_index { |word, idx| flip_words(word, idx) }
|
|
103
102
|
end
|
|
@@ -105,13 +104,13 @@ module Spoonerize
|
|
|
105
104
|
##
|
|
106
105
|
# Returns spoonerize array as a joined string.
|
|
107
106
|
def to_s
|
|
108
|
-
spoonerize.join(
|
|
107
|
+
spoonerize.join(" ")
|
|
109
108
|
end
|
|
110
109
|
|
|
111
110
|
##
|
|
112
111
|
# Returns hash of the original words mapped to their flipped counterparts.
|
|
113
112
|
def to_h
|
|
114
|
-
|
|
113
|
+
words.zip(spoonerize).to_h
|
|
115
114
|
end
|
|
116
115
|
|
|
117
116
|
##
|
|
@@ -149,7 +148,7 @@ module Spoonerize
|
|
|
149
148
|
##
|
|
150
149
|
# Saves the flipped words to the log file, along with the options
|
|
151
150
|
def save
|
|
152
|
-
log.write([words.join(
|
|
151
|
+
log.write([words.join(" "), to_s, options.join(", ")])
|
|
153
152
|
end
|
|
154
153
|
|
|
155
154
|
##
|
|
@@ -177,11 +176,11 @@ module Spoonerize
|
|
|
177
176
|
#
|
|
178
177
|
# @return [Hash] The config options
|
|
179
178
|
def load_config_file
|
|
180
|
-
raise
|
|
179
|
+
raise "No config file set" if config_file.nil?
|
|
181
180
|
raise "File #{config_file} does not exist" unless File.file?(config_file)
|
|
182
|
-
@config = YAML
|
|
181
|
+
@config = YAML.load_file(config_file)
|
|
183
182
|
@config_file_loaded = true
|
|
184
|
-
@config.each { |k, v| send("#{k}=", v) }
|
|
183
|
+
@config.each { |k, v| send(:"#{k}=", v) }
|
|
185
184
|
end
|
|
186
185
|
|
|
187
186
|
private
|
|
@@ -193,7 +192,7 @@ module Spoonerize
|
|
|
193
192
|
def flip_words(word, idx) # :nodoc:
|
|
194
193
|
return word if excluded?(idx)
|
|
195
194
|
bumper = Bumper.new(idx, words.size, reverse?)
|
|
196
|
-
bumper.bump
|
|
195
|
+
bumper.bump while excluded?(bumper.value)
|
|
197
196
|
words[bumper.value].match(consonants).to_s + word.match(vowels).to_s
|
|
198
197
|
end
|
|
199
198
|
|
|
@@ -225,10 +224,10 @@ module Spoonerize
|
|
|
225
224
|
# the options as a string
|
|
226
225
|
def options # :nodoc:
|
|
227
226
|
[].tap do |o|
|
|
228
|
-
o <<
|
|
229
|
-
o <<
|
|
230
|
-
o << "Exclude [#{all_excluded_words.join(
|
|
231
|
-
o <<
|
|
227
|
+
o << "Lazy" if lazy?
|
|
228
|
+
o << "Reverse" if reverse?
|
|
229
|
+
o << "Exclude [#{all_excluded_words.join(", ")}]" if excluded_words.any?
|
|
230
|
+
o << "No Options" if o.empty?
|
|
232
231
|
end
|
|
233
232
|
end
|
|
234
233
|
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.
|
|
16
|
+
#
|
|
17
|
+
# @return [Integer]
|
|
15
18
|
MINOR = 1
|
|
16
19
|
|
|
17
20
|
##
|
|
18
21
|
# Patch version.
|
|
19
|
-
|
|
22
|
+
#
|
|
23
|
+
# @return [Integer]
|
|
24
|
+
PATCH = 3
|
|
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,9 +1,9 @@
|
|
|
1
|
-
require
|
|
2
|
-
require_relative
|
|
3
|
-
require_relative
|
|
4
|
-
require_relative
|
|
5
|
-
require_relative
|
|
6
|
-
require_relative
|
|
1
|
+
require "yaml"
|
|
2
|
+
require_relative "spoonerize/spoonerism"
|
|
3
|
+
require_relative "spoonerize/bumper"
|
|
4
|
+
require_relative "spoonerize/version"
|
|
5
|
+
require_relative "spoonerize/log"
|
|
6
|
+
require_relative "spoonerize/cli"
|
|
7
7
|
|
|
8
8
|
##
|
|
9
9
|
# The main namespace for the gem.
|
|
@@ -15,7 +15,6 @@ module Spoonerize
|
|
|
15
15
|
##
|
|
16
16
|
# Excluded words from config files.
|
|
17
17
|
LAZY_WORDS = YAML.load_file(
|
|
18
|
-
File.join(File.dirname(__FILE__),
|
|
18
|
+
File.join(File.dirname(__FILE__), "config", "lazy_words.yml")
|
|
19
19
|
).freeze
|
|
20
20
|
end
|
|
21
|
-
|
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.1.
|
|
4
|
+
version: 0.1.3
|
|
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
|
|
@@ -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: []
|