jason_lizarraga_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: 3bdd313c8a87fde5ac4ff3c76a0f053df2dfb9b7352c176c5ebc3e0fe6bc3b5d
4
- data.tar.gz: d57f63d2282f23fa9937a91a9c7c2b1739a52964795252e61d04176758dfa7ed
3
+ metadata.gz: 37a6ad45ce2756103f08451cbdb17d8ff12071f4ce53b9180d64f86af285c3bd
4
+ data.tar.gz: 89cdfbefa0edaaf9d3837557d5f0861a47b283ced176ad75d540e570822cc917
5
5
  SHA512:
6
- metadata.gz: 80bd94ad7a2b1a814a64758d05b92530211a1e07108910b590525aa976969f08689bad2f8f939422309e6c14c434dc92526587b7e8093d0467c75045c31e449f
7
- data.tar.gz: 6ac240a6cfb0d6621208c22ff9232f948811240c20789c3793948a44f11fa49fa135c44bff18333b8b838504128cbbcbb0756f8cf0219feadfe96dad6cc933d4
6
+ metadata.gz: 7018e65037e9a3ee54373f38e0408056576bac3116023da95e87be1ea47fcb234da147778e71808e237b63d73a9332c005c4e38ff0b67c87537ba0156048e62f
7
+ data.tar.gz: ac473423ecb949ec40ef53b8a1397609bce13972d886d5def08cd13c41d0a988332c3c0a4342fe2947b29aa054d68711df03d7ccae341e04cb73a352e29bf74e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jason_lizarraga_palindrome (0.1.0)
4
+ jason_lizarraga_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,15 +1,28 @@
1
1
  require 'jason_lizarraga_palindrome/version'
2
2
 
3
- class String
3
+ # Adds palindrome detection for strings
4
+ module JasonLizarragaPalindrome
4
5
  # Returns true for a palindrome, false otherwise.
5
6
  def palindrome?
6
- processed_content == processed_content.reverse
7
+ if processed_content.empty?
8
+ false
9
+ else
10
+ processed_content == processed_content.reverse
11
+ end
7
12
  end
8
13
 
9
14
  private
10
15
 
11
16
  # Returns content for palindrome testing.
12
17
  def processed_content
13
- scan(/[a-z]/i).join.downcase
18
+ to_s.scan(/[a-z]|\d/i).join.downcase
14
19
  end
15
20
  end
21
+
22
+ class String
23
+ include JasonLizarragaPalindrome
24
+ end
25
+
26
+ class Integer
27
+ include JasonLizarragaPalindrome
28
+ end
@@ -1,3 +1,3 @@
1
1
  module JasonLizarragaPalindrome
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: jason_lizarraga_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
  - Jason Lizarraga