chapmanchri_palindrome 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: c8dbe018e393d1af08c393f6e3e255ea3d6b99d3
4
- data.tar.gz: 4868ab8df7efc67b1931c056fef0cdf1a644ea47
3
+ metadata.gz: f02043a1032c523bd49f1b45a363d55022b50d55
4
+ data.tar.gz: 148bf1f9b9eac2b49796c50748e515d60efe3740
5
5
  SHA512:
6
- metadata.gz: ed9ba634ac95b5c6c2a44204b3bf5797b0587f44ebe5ee9f8f34b46bef65cd335b4cea65426d619aea66b5edf7805192f123e5fda4c35bc1a9923d3de5a899f4
7
- data.tar.gz: a913784fff439fd00fe125c61c6cf563edc465586b4280f70b18b2807df2c059b8469ad6d06eab715305e1c04702c44698ef931963795abd1a9667d21d60106b
6
+ metadata.gz: 62cf61082c6ed839d96d5ded6f58c4c038cc27b9c828d73949b80d743580ae16f74a7a885802b395c8a9dc5f66af9966ca985d756fc63cd8a9412aaaa2de60d6
7
+ data.tar.gz: 60a0e65ae49e47f2fa38a2ffff54bb821c5a7525e1395e53eb48085457f9b0eab8496f6b272588b14b89e9dbc23604b146fb67663f6643a469d9e5c40ae4ecc1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chapmanchri_palindrome (0.1.0)
4
+ chapmanchri_palindrome (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module ChapmanchriPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,20 +1,26 @@
1
1
  require "chapmanchri_palindrome/version"
2
2
 
3
- class String
3
+ module ChapmanchriPalindrome
4
4
 
5
5
  # Returns true for palindrome, false otherwise.
6
6
  def palindrome?
7
- processed_content == processed_content.reverse
8
- end
9
-
10
- # Returns content for palindrome testing.
11
- def processed_content
12
- self.letters.downcase
13
- end
7
+ if processed_content.empty?
8
+ false
9
+ else
10
+ processed_content == processed_content.reverse
11
+ end
12
+
13
+ private
14
14
 
15
- # Returns string with all non-letters removed
16
- def letters
17
- self.scan(/[a-z]/i).join.downcase
15
+ # Returns content for palindrome testing.
16
+ def processed_content
17
+ self.to_s.scan('[a-z]i').join.downcase
18
+ end
19
+
18
20
  end
19
21
 
22
+ class String
23
+ include ChapmanchriPalindrome
24
+ end
25
+
20
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chapmanchri_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Chapman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-19 00:00:00.000000000 Z
11
+ date: 2019-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler