frabr_palindrome 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e8644b6742fde945b29edea5a4980ba3943e0b3529758bbd6ec47e2db091dc8
4
- data.tar.gz: 0ea5688f0b3cc696f3015e3f4efeb0b51c451fa7ae56e6e3278e72037900b2c8
3
+ metadata.gz: a945050cebfae5f245177d1168a5b149cbd397b1bef5a4da8084cb980d05df19
4
+ data.tar.gz: 979faf452f629578c4ceafd2f52a795f6c7064247587570fe5219d6f86261caf
5
5
  SHA512:
6
- metadata.gz: b0d70b32afbc7708763a68a9dbfad197bafea1af6381ddbc08fc465b50a62b89b47441836ebcedd63ae4af754e4d680aace10ebade98ee1d47361612ae239b28
7
- data.tar.gz: 6d2f32122b00ce7075f2984e6135fbeb854e5fa4a705962dbccc587eb26587471882673150d4e5b8360c59a5a66af17b6dc5d2567b797eb42bd38a8f02461990
6
+ metadata.gz: 324753c5ed56a04d9a0ef692ecb639e2d3d5a1ceefa07ea8c4adf77d08a8221b545e2acf6445df36fb6f38ca1a3c7bcbfbc26fc5cb4e29c9bee07dc29631508d
7
+ data.tar.gz: f6600897cf0b650325eef19395d2ab46432808651113358c5c9c392a58514f89a747ca730d9bd3ee2ba2e0e09afad494e2a87915b2a0a174c4a4424b720ea560
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- frabr_palindrome (0.1.0)
4
+ frabr_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,17 +1,29 @@
1
1
  require "frabr_palindrome/version"
2
2
 
3
- class String
3
+
4
+ module FrabrPalindrome
4
5
 
5
6
  # Returns true for a palindrome, false otherwise.
6
7
  def palindrome?
7
- processed_content == processed_content.reverse
8
+ if processed_content.empty?
9
+ false
10
+ else
11
+ processed_content == processed_content.reverse
12
+ end
8
13
  end
9
14
 
10
-
11
15
  private
12
16
 
13
17
  # Returns content for palindrome testing.
14
18
  def processed_content
15
- self.scan(/[a-z]/i).join.downcase
19
+ self.to_s.scan(/[a-z0-9]/i).join.downcase
16
20
  end
17
21
  end
22
+
23
+ class String
24
+ include FrabrPalindrome
25
+ end
26
+
27
+ class Integer
28
+ include FrabrPalindrome
29
+ end
@@ -1,3 +1,3 @@
1
1
  module FrabrPalindrome
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: frabr_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
  - frabr