quintus_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: ab08fd26d46b8af060f78ff52a4e4f7fd14845968f0c07c368eeb2e0da6fffa9
4
- data.tar.gz: af9a4f4784b92a05dd84754b3291980a23d966d23e2f1cfa19cd38622ea4f8d4
3
+ metadata.gz: 1fb15b3d8f6099f3961ffd14f3dee3542a00f5234a25d1789164dcefb1225d32
4
+ data.tar.gz: eb21a186c60d0f5e315fe342cbc07c4e1dc72141b1628f01816542a5a7abf9bf
5
5
  SHA512:
6
- metadata.gz: e1e223d27fb8aaecc70d259adf7a80b82bbefb8ef204382f92acf959d4448505f89148c7dc5ff7cf364b08462f8ad99981825597e95511649bdedf02985e6a6d
7
- data.tar.gz: 61ae914b3066592700688de2d31d62f756501c5535e3dc091d77617b806a8a0a8614c68b665ba41f5985c171ab6e543538f7686b41c8d4c6a331e4f2173fead6
6
+ metadata.gz: 39495de5020db0c89d3adf62b56a450a2393664dfdc5d593a9c1ef6963e86f4598fbaa7e84db31a6c65f8045f90fb3f2a143ceaf82c97dccf396bf831a252b8e
7
+ data.tar.gz: 8cf08a85433face70595ad49015735ede89109db65c33e29a1426b4706d0eeac43fcd906b8406bd356eed7d5dfd8a8e576eed8c17441081e2fb754763dd56541
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quintus_palindrome (0.1.0)
4
+ quintus_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 QuintusPalindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -2,17 +2,29 @@
2
2
 
3
3
  require_relative "quintus_palindrome/version"
4
4
 
5
- class String
5
+ module QuintusPalindrome
6
6
 
7
7
  # Returns true for a palindrome, false otherwise.
8
8
  def palindrome?
9
- processed_content == processed_content.reverse
9
+ if processed_content.empty?
10
+ false
11
+ else
12
+ processed_content == processed_content.reverse
13
+ end
10
14
  end
11
15
 
12
16
  private
13
17
 
14
18
  # Returns content for palindrome testing.
15
19
  def processed_content
16
- scan(/[a-z]/i).join.downcase
20
+ to_s.scan(/[a-z\d]/i).join.downcase
17
21
  end
18
22
  end
23
+
24
+ class String
25
+ include QuintusPalindrome
26
+ end
27
+
28
+ class Integer
29
+ include QuintusPalindrome
30
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quintus_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
  - quintus-st