aminukano_palindrome 0.1.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dbe31a39b8da40d9b993ba0ccc175ab623c5b0741633d9c2838d37c331e2189
4
- data.tar.gz: 308fc97f216693a4f7e2fc3000e8367bc91c3a09e3e26b25b27f800a62b0c04e
3
+ metadata.gz: 786643b5a50b97f801f64ba543cd178c0ddee281e031403768fa5c1fb6df9b64
4
+ data.tar.gz: 4988832c02af178cdf0cf64e7cded50d19df99df86af8b8d3b4a8bde4de9e343
5
5
  SHA512:
6
- metadata.gz: b4b930b44524f8f627ced11b8c3b4e33a95ea4659044fbf0fd33ac4521b6e84012ef9b81897c475a93ecf18aed2eab7e25401455189dcdc2fdf9bf89a53073c4
7
- data.tar.gz: 04a27a9bac846339c2b95c5c9d03ca3f10764f9597bc74c7dc30173003e46ffb372771bb8664d106395c7cc8149d8dbda1503df615b58c8189cdbaa67f671a3b
6
+ metadata.gz: b64a2dfbb685122de967ced6734ecf43b9cfdf47fe4152981a3cfd9978909a9ca426228e4adbd1f8989d85e2c0f20819f3449da26d84ad3c5c1e8f587059d056
7
+ data.tar.gz: b05f4b5cc535ff6e38e7f4e3ac0d3d6ed1c6ca5b5faf0994f43ce9c8b11ef4763444f95dac7c80d2775861457c6043940107f427506b4e09bab5b054ea35393f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aminukano_palindrome (0.1.0)
4
+ aminukano_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,16 +1,28 @@
1
1
  require "aminukano_palindrome/version"
2
2
 
3
- class String
3
+ module AminukanoPalindrome
4
4
 
5
5
  # Returns true for a palindrome, false otherwise.
6
6
  def palindrome?
7
- processed_content == processed_content.reverse
7
+ if processed_content.empty?
8
+ false
9
+ else
10
+ processed_content == processed_content.reverse
11
+ end
8
12
  end
9
13
 
10
14
  private
11
15
 
12
16
  # Returns content for palindrome testing.
13
17
  def processed_content
14
- self.scan(/[a-z]/i).join.downcase
18
+ self.to_s.scan(/[a-z0-9]/i).join.downcase
15
19
  end
20
+ end
21
+
22
+ class String
23
+ include AminukanoPalindrome
24
+ end
25
+
26
+ class Integer
27
+ include AminukanoPalindrome
16
28
  end
@@ -1,3 +1,3 @@
1
1
  module AminukanoPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aminukano_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aminu Kano