wsmyth_palindrome 0.2.0 → 0.3.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/Gemfile.lock +1 -1
- data/lib/wsmyth_palindrome.rb +6 -2
- data/lib/wsmyth_palindrome/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba186906ab38b6fdd27df36855518000dc4614a4e07ddd8039aace367b37c3cf
|
4
|
+
data.tar.gz: 470c10ddafba632db36b9abb4a81e3e96bfcdcb730d2d00102076defa78f12f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 771e4a3fb7907f04da9d5d0ab63b29aaecf333129bb43a3416e5ed68b3a86f6ff91c5c644a69ac664c5da9ce7d2d953e13fc5b536ba0344a67108e89d31aed86
|
7
|
+
data.tar.gz: 4f75570c7869d48339d36646c4017417e512e3a463572edaf089c0e01003f8419b173f47672b08667f572c037accf174841e5816c9ee3443fc39a83245203134
|
data/Gemfile.lock
CHANGED
data/lib/wsmyth_palindrome.rb
CHANGED
@@ -4,7 +4,11 @@ module WsmythPalindrome
|
|
4
4
|
|
5
5
|
# Returns true for a palindrome, false otherwise.
|
6
6
|
def palindrome?
|
7
|
-
|
7
|
+
if processed_content.empty?
|
8
|
+
false
|
9
|
+
else
|
10
|
+
processed_content == processed_content.reverse
|
11
|
+
end
|
8
12
|
end
|
9
13
|
|
10
14
|
|
@@ -12,7 +16,7 @@ module WsmythPalindrome
|
|
12
16
|
|
13
17
|
# Returns content for palindrome testing
|
14
18
|
def processed_content
|
15
|
-
to_s.scan(/[a-z
|
19
|
+
to_s.scan(/[a-z]/i).join.downcase
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wsmyth_palindrome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Warren Smyth
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Learn Enough Ruby palindrome detector
|
14
14
|
email:
|