greybutton_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: 808fab43687c20c76c18048f95eb61c859d0bbe09a87432db53f43f4f44ea3d0
4
- data.tar.gz: a2c3ee4bd9bcbb591f4800585ab002785a020c75346920cedb13bc8a6a00064f
3
+ metadata.gz: 6c645a0f171aa5084f00b357bceac9de3d82a14c0dfce8ab08559dc9fc2af2e0
4
+ data.tar.gz: 33d69a06c86ca1c4b47e5d307edc03314b719254846a3377e0e1f16b96e512bd
5
5
  SHA512:
6
- metadata.gz: bf755baf5d478e9467db86af93f0d7562f89237d7fee44034aee3658842dedd32859796198478e0afba8e64b4cb9f572ef2c776c79ba3d15325792caea872b9c
7
- data.tar.gz: bf688291b84b7f418bc57906af9a2b6e9ad58016c3244ec9c70dfd9a228e1eda47303921027fa5e2395fc42ab90057fab7c37bc90a589773e94322f586a54237
6
+ metadata.gz: eb56b9f9c9fa3da50d8e9fe0d1294f62adb1d6d97a77f09ce2c926293b7a6a7776647d65c8fa4fa5814a917ea02cb03017a4580179a61f34a233cb423aeab1e1
7
+ data.tar.gz: 9f7d0e81d6b69e93cf88813e67787563d49b0f7c84edda0b138c56fdd9583b99241d11415b2e7204ec74e11fd75711a32fe9e80d4c0bcc738c1f6e992c355bf7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- greybutton_palindrome (0.1.0)
4
+ greybutton_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,15 +1,27 @@
1
1
  require "greybutton_palindrome/version"
2
2
 
3
- class String
3
+ module GreybuttonPalindrome
4
4
  # Returns true for a palindrome, false otherwise.
5
5
  def palindrome?
6
- processed_content == processed_content.reverse
6
+ if processed_content.empty?
7
+ false
8
+ else
9
+ processed_content == processed_content.reverse
10
+ end
7
11
  end
8
12
 
9
13
  private
10
14
 
11
15
  # Returns content for palindrome testing.
12
16
  def processed_content
13
- scan(/[a-z]/i).join.downcase
17
+ to_s.scan(/[a-z0-9]/i).join.downcase
14
18
  end
15
19
  end
20
+
21
+ class String
22
+ include GreybuttonPalindrome
23
+ end
24
+
25
+ class Integer
26
+ include GreybuttonPalindrome
27
+ end
@@ -1,3 +1,3 @@
1
1
  module GreybuttonPalindrome
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: greybutton_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
  - Sergej Tabb