spoonerize 0.0.7 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b87634fd09d0a168098bb2c91ee8ffd978e2d1bfd6fe1783ebce28e64617fbb
4
- data.tar.gz: b852745fc0fe8a2ecbb95181275de0642d2975380f79b29f6cac3252116d9901
3
+ metadata.gz: b0f1daa53f868c8a070b13e93c3132093fbd1d1b41346d818b74fe5a8dcf60e2
4
+ data.tar.gz: 766a582290c12dbbf4820aeed2773f5b7bea86e468febe788bb87c8d861a4df6
5
5
  SHA512:
6
- metadata.gz: c2f178fbed34dceed86b76bdc1c97d6d5f0aa23daeb73b6d5cc233a9a9c2292bd4fd83bb671a1a0e009d28fda6a71b221378d161927852b43b9f47b985b847ee
7
- data.tar.gz: e92bfa5bd30bdeee7515bda37cd58a112552ece8709d515468b5c3f2497527f15ac87eaa9c71f3f09eeb71dff4b7b0572749d6faf75e086d32b548017292061c
6
+ metadata.gz: 16491fb8f0ac3461d88e0c189f5798aadcf19b35fb74388a9c6e3a012b20962bb75e36aec3679bf97f199b4a1b64e693740754922961144d2ecc024b50909f99
7
+ data.tar.gz: 8460931c110bef005aed7f1173622fcc94998bef589a67b033aef5ce0175ffeac58793f16c3ba88ccf00eed08ce230ad2851cf7a6af6a230e23bc88050c71511
data/Gemfile.lock ADDED
@@ -0,0 +1,23 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ spoonerize (0.0.7)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ power_assert (2.0.0)
10
+ rake (13.0.3)
11
+ test-unit (3.4.1)
12
+ power_assert
13
+
14
+ PLATFORMS
15
+ x86_64-darwin-20
16
+
17
+ DEPENDENCIES
18
+ rake (~> 13.0, >= 13.0.1)
19
+ spoonerize!
20
+ test-unit (~> 3.3, >= 3.3.5)
21
+
22
+ BUNDLED WITH
23
+ 2.2.16
data/README.md CHANGED
@@ -10,17 +10,6 @@ View on [Github](https://github.com/evanthegrayt/spoonerize) |
10
10
  [Github Pages](https://evanthegrayt.github.io/spoonerize/) |
11
11
  [RubyGems](https://rubygems.org/gems/spoonerize)
12
12
 
13
- ## Table of Contents
14
- - [About](#about)
15
- - [Installation](#installation)
16
- - [Automated](#automated)
17
- - [Manual](#manual)
18
- - [Command Line Usage](#command-line-usage)
19
- - [Config file](#config-file)
20
- - [API](#api)
21
- - [Documentation](https://evanthegrayt.github.io/spoonerize/doc/index.html)
22
- - [Self-Promotion](#self-promotion)
23
-
24
13
  ## About
25
14
  We've all done it; someone says a phrase, and you flip the first few letters
26
15
  around, and sometimes, it makes an even funnier phrase. For example:
data/doc/README_md.html CHANGED
@@ -61,7 +61,6 @@
61
61
 
62
62
  <ul class="link-list" role="directory">
63
63
  <li><a href="#label-Welcome+to+Spoonerize+--+a+word+game.">Welcome to Spoonerize – a word game.</a>
64
- <li><a href="#label-Table+of+Contents">Table of Contents</a>
65
64
  <li><a href="#label-About">About</a>
66
65
  <li><a href="#label-Installation">Installation</a>
67
66
  <li><a href="#label-Automated">Automated</a>
@@ -100,27 +99,6 @@
100
99
 
101
100
  <p>View on <a href="https://github.com/evanthegrayt/spoonerize">Github</a> | <a href="https://evanthegrayt.github.io/spoonerize/">Github Pages</a> | <a href="https://rubygems.org/gems/spoonerize">RubyGems</a></p>
102
101
 
103
- <h2 id="label-Table+of+Contents">Table of Contents<span><a href="#label-Table+of+Contents">&para;</a> <a href="#top">&uarr;</a></span></h2>
104
- <ul><li>
105
- <p><a href="#about">About</a></p>
106
- </li><li>
107
- <p><a href="#installation">Installation</a></p>
108
- </li><li>
109
- <p><a href="#automated">Automated</a></p>
110
- </li><li>
111
- <p><a href="#manual">Manual</a></p>
112
- </li><li>
113
- <p><a href="#command-line-usage">Command Line Usage</a></p>
114
- </li><li>
115
- <p><a href="#config-file">Config file</a></p>
116
- </li><li>
117
- <p><a href="#api">API</a></p>
118
- </li><li>
119
- <p><a href="https://evanthegrayt.github.io/spoonerize/doc/index.html">Documentation</a></p>
120
- </li><li>
121
- <p><a href="#self-promotion">Self-Promotion</a></p>
122
- </li></ul>
123
-
124
102
  <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
125
103
 
126
104
  <p>We&#39;ve all done it; someone says a phrase, and you flip the first few letters around, and sometimes, it makes an even funnier phrase. For example: “Tomb Raider” becomes “Romb Taider”. Well, when I was in high school, we took it further – probably too far – and made a rule set. This gem, which includes a command-line executable, follows those rules, which are:</p>
data/doc/created.rid CHANGED
@@ -1,8 +1,8 @@
1
- Sun, 03 May 2020 21:49:14 -0500
2
- README.md Sun, 03 May 2020 21:42:49 -0500
1
+ Mon, 12 Apr 2021 21:54:26 -0500
2
+ README.md Mon, 12 Apr 2021 21:54:18 -0500
3
3
  lib/spoonerize.rb Sat, 02 May 2020 22:24:00 -0500
4
4
  lib/spoonerize/bumper.rb Sat, 02 May 2020 22:24:00 -0500
5
5
  lib/spoonerize/cli.rb Sun, 03 May 2020 21:34:21 -0500
6
6
  lib/spoonerize/log.rb Sat, 02 May 2020 22:24:00 -0500
7
7
  lib/spoonerize/spoonerism.rb Sun, 03 May 2020 21:49:09 -0500
8
- lib/spoonerize/version.rb Sun, 03 May 2020 21:34:21 -0500
8
+ lib/spoonerize/version.rb Sat, 04 Jul 2020 20:32:58 -0500
data/doc/index.html CHANGED
@@ -101,27 +101,6 @@
101
101
 
102
102
  <p>View on <a href="https://github.com/evanthegrayt/spoonerize">Github</a> | <a href="https://evanthegrayt.github.io/spoonerize/">Github Pages</a> | <a href="https://rubygems.org/gems/spoonerize">RubyGems</a></p>
103
103
 
104
- <h2 id="label-Table+of+Contents">Table of Contents<span><a href="#label-Table+of+Contents">&para;</a> <a href="#top">&uarr;</a></span></h2>
105
- <ul><li>
106
- <p><a href="#about">About</a></p>
107
- </li><li>
108
- <p><a href="#installation">Installation</a></p>
109
- </li><li>
110
- <p><a href="#automated">Automated</a></p>
111
- </li><li>
112
- <p><a href="#manual">Manual</a></p>
113
- </li><li>
114
- <p><a href="#command-line-usage">Command Line Usage</a></p>
115
- </li><li>
116
- <p><a href="#config-file">Config file</a></p>
117
- </li><li>
118
- <p><a href="#api">API</a></p>
119
- </li><li>
120
- <p><a href="https://evanthegrayt.github.io/spoonerize/doc/index.html">Documentation</a></p>
121
- </li><li>
122
- <p><a href="#self-promotion">Self-Promotion</a></p>
123
- </li></ul>
124
-
125
104
  <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
126
105
 
127
106
  <p>We&#39;ve all done it; someone says a phrase, and you flip the first few letters around, and sometimes, it makes an even funnier phrase. For example: “Tomb Raider” becomes “Romb Taider”. Well, when I was in high school, we took it further – probably too far – and made a rule set. This gem, which includes a command-line executable, follows those rules, which are:</p>
Binary file
Binary file
Binary file
@@ -39,8 +39,6 @@
39
39
 
40
40
  <li><a href="README_md.html#label-Welcome+to+Spoonerize+--+a+word+game.">Welcome to Spoonerize – a word game.</a>
41
41
 
42
- <li><a href="README_md.html#label-Table+of+Contents">Table of Contents</a>
43
-
44
42
  <li><a href="README_md.html#label-About">About</a>
45
43
 
46
44
  <li><a href="README_md.html#label-Installation">Installation</a>
@@ -129,30 +129,29 @@ module Spoonerize
129
129
  ##
130
130
  # Read in args and set options
131
131
  def get_preferences # :nodoc:
132
- prefs = {}
133
- OptionParser.new do |o|
134
- o.version = ::Spoonerize::VERSION
135
- o.on('-r', '--[no-]reverse', 'Reverse flipping') do |v|
136
- prefs['reverse'] = v
137
- end
138
- o.on('-l', '--[no-]lazy', 'Skip small words') do |v|
139
- prefs['lazy'] = v
140
- end
141
- o.on('-m', '--[no-]map', 'Print words mapping') do |v|
142
- @map = v
143
- end
144
- o.on('-p', '--[no-]print', 'Print all entries in the log') do |v|
145
- @print = v
146
- end
147
- o.on('-s', '--[no-]save', 'Save results in log') do |v|
148
- @save = v
149
- end
150
- o.on('--exclude=WORDS', Array, 'Words to skip') do |v|
151
- prefs['exclude'] = v
152
- end
153
- end.parse!(options)
154
-
155
- prefs
132
+ {}.tap do |prefs|
133
+ OptionParser.new do |o|
134
+ o.version = ::Spoonerize::Version.to_s
135
+ o.on('-r', '--[no-]reverse', 'Reverse flipping') do |v|
136
+ prefs['reverse'] = v
137
+ end
138
+ o.on('-l', '--[no-]lazy', 'Skip small words') do |v|
139
+ prefs['lazy'] = v
140
+ end
141
+ o.on('-m', '--[no-]map', 'Print words mapping') do |v|
142
+ @map = v
143
+ end
144
+ o.on('-p', '--[no-]print', 'Print all entries in the log') do |v|
145
+ @print = v
146
+ end
147
+ o.on('-s', '--[no-]save', 'Save results in log') do |v|
148
+ @save = v
149
+ end
150
+ o.on('--exclude=WORDS', Array, 'Words to skip') do |v|
151
+ prefs['exclude'] = v
152
+ end
153
+ end.parse!(options)
154
+ end
156
155
  end
157
156
  end
158
157
  end
@@ -76,7 +76,6 @@ module Spoonerize
76
76
  # sp.reverse = true
77
77
  # end
78
78
  # s.load_config_file # Would override setting from initialization
79
-
80
79
  def initialize(words, config_file = nil)
81
80
  @config = {}
82
81
  @excluded_words = []
@@ -99,6 +98,7 @@ module Spoonerize
99
98
  # flip_words. Returns results as an array.
100
99
  def spoonerize
101
100
  raise JakPibError, 'Not enough words to flip' unless enough_flippable_words?
101
+
102
102
  words.map.with_index { |word, idx| flip_words(word, idx) }
103
103
  end
104
104
 
@@ -224,12 +224,12 @@ module Spoonerize
224
224
  ##
225
225
  # the options as a string
226
226
  def options # :nodoc:
227
- o = []
228
- o << 'Lazy' if lazy?
229
- o << 'Reverse' if reverse?
230
- o << "Exclude [#{all_excluded_words.join(', ')}]" if excluded_words.any?
231
- o << 'No Options' if o.empty?
232
- o
227
+ [].tap do |o|
228
+ o << 'Lazy' if lazy?
229
+ o << 'Reverse' if reverse?
230
+ o << "Exclude [#{all_excluded_words.join(', ')}]" if excluded_words.any?
231
+ o << 'No Options' if o.empty?
232
+ end
233
233
  end
234
234
  end
235
235
  end
@@ -1,5 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spoonerize
2
4
  ##
3
- # The version of the gem.
4
- VERSION = '0.0.7'
5
+ # Module that contains all gem version information. Follows semantic
6
+ # versioning. Read: https://semver.org/
7
+ module Version
8
+
9
+ ##
10
+ # Major version.
11
+ MAJOR = 0
12
+
13
+ ##
14
+ # Minor version.
15
+ MINOR = 1
16
+
17
+ ##
18
+ # Patch version.
19
+ PATCH = 0
20
+
21
+ ##
22
+ # Version as +MAJOR.MINOR.PATCH+
23
+ def self.to_s
24
+ "#{MAJOR}.#{MINOR}.#{PATCH}"
25
+ end
26
+ end
5
27
  end
data/spoonerize.gemspec CHANGED
@@ -2,7 +2,7 @@ require_relative 'lib/spoonerize/version'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'spoonerize'
5
- spec.version = Spoonerize::VERSION
5
+ spec.version = Spoonerize::Version.to_s
6
6
  spec.authors = ['Evan Gray']
7
7
  spec.email = 'evanthegrayt@vivaldi.net'
8
8
  spec.license = 'MIT'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spoonerize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Gray
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-04 00:00:00.000000000 Z
11
+ date: 2021-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -60,6 +60,7 @@ files:
60
60
  - ".github/workflows/ruby.yml"
61
61
  - ".gitignore"
62
62
  - Gemfile
63
+ - Gemfile.lock
63
64
  - LICENSE
64
65
  - README.md
65
66
  - Rakefile
@@ -131,7 +132,7 @@ metadata:
131
132
  homepage_uri: https://evanthegrayt.github.io/spoonerize/
132
133
  source_code_uri: https://github.com/evanthegrayt/spoonerize
133
134
  documentation_uri: https://evanthegrayt.github.io/spoonerize/doc/index.html
134
- post_install_message:
135
+ post_install_message:
135
136
  rdoc_options: []
136
137
  require_paths:
137
138
  - lib
@@ -146,8 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
147
  - !ruby/object:Gem::Version
147
148
  version: '0'
148
149
  requirements: []
149
- rubygems_version: 3.1.2
150
- signing_key:
150
+ rubygems_version: 3.2.3
151
+ signing_key:
151
152
  specification_version: 4
152
153
  summary: Spoonerize phrases from the command line.
153
154
  test_files: []