tdowning_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: 432af43648a719520f71ba12241e0a182613f513ba2242f859201e7de0028f83
4
- data.tar.gz: 6ca09d9a36d36bfeef65242f2a89251df10e8bf32f4a22804281f523863d6543
3
+ metadata.gz: d367bcf9ed3f0f1391e28f244fb0260286732dc0f8bcdabffb75c5c9b8da5f27
4
+ data.tar.gz: efbe694b13bc9c8b1bdf8933cc59670daf08f4be14cb5f427d9749e759ae8551
5
5
  SHA512:
6
- metadata.gz: b554d33a72916112dba635bd97e745d60f1ddab28249a1f48ed1d2f9791114dd105b125455965e2738a9e16328e0e6f7e5d006cfc57c46aa881752edaeca1cb2
7
- data.tar.gz: f53c634db7fc698fa9a0670d7c7b7aaea4a8a4e5d8550f945f6d22b83c7ed13388018bd544a73d58d56c1a29d9a6164a3929ff4dcfc10bb3fe16006ffed08988
6
+ metadata.gz: d8fc8837efec7845b8f0ffb82c22972d35d93e9397eb36de7a9f9fef3aed9063c542fa175dc7dcd0974babf1aa4ea50f5a11a35d5b1075f46798be8cecaa9310
7
+ data.tar.gz: a3d891f7bc2bf666b22456437f019ae492136aa7a48c198d9f77d1b7b1ab39681b51dcd4d179cd9f9ed4da73569972f77388b56f4bb912d20b57a0bbb24b7fb2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tdowning_palindrome (0.1.0)
4
+ tdowning_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TdowningPalindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -1,16 +1,28 @@
1
- require_relative "tdowning_palindrome/version"
1
+ require "tdowning_palindrome/version"
2
2
 
3
- class String
3
+ module TdowningPalindrome
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
- scan(/[a-z]/i).join.downcase
18
+ to_s.scan(/[a-z\d]/i).join.downcase
15
19
  end
20
+ end
21
+
22
+ class String
23
+ include TdowningPalindrome
24
+ end
25
+
26
+ class Integer
27
+ include TdowningPalindrome
16
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdowning_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
  - Timothy Downing