aurisimo_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: 4d3d13a70678864be83d6e7ad1d6da6d9fcbfcb11cf7c28c46db8176cffe8160
4
- data.tar.gz: 834e31e2d97e5a7f8796cf4b068765527c84cb4c92be300c74dc90107ea63c30
3
+ metadata.gz: 6c4649395669b0c1b283a7677690712ff78f61ef702bc5987129b9e368c198f5
4
+ data.tar.gz: 537806564c7d370e40b3f8c1d09c8d9e2baa3f3c244d30e9091d33b91bc8ef41
5
5
  SHA512:
6
- metadata.gz: 8512cfb6735e152577c93f25b426aa588d9d9ecf055bf815d48e869ba394353fe47f867981f489ae8a835de55bcceea42533ba84307da2a0a890be2458d79324
7
- data.tar.gz: d27de2966e8e3ad01571389e544506445d10fdf89f26c670dfb4b002d1f512b7de16200ca14408214622ff6beb9398cfcee1ab525b581c7d631c3045d43b139d
6
+ metadata.gz: 442dbb1bfbf05bafface4994d34a0e2461b91b26c2d8c381ff1213f73458da3e6cbeb83679de42eba748043cc2d32f2903b8b2d94a2cc231c586092c7f986ac8
7
+ data.tar.gz: cdc2f1ccc1c7ca615aeff2337fe1b8b805d9a9e57ed7654d43f43d5eba2c7d6820897cc2fe790dee6182e2c0b5a982c6c9f2bdccd5c18aa1facff8a6193d7efc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aurisimo_palindrome (0.1.0)
4
+ aurisimo_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,6 +1,6 @@
1
1
  require "aurisimo_palindrome/version"
2
2
 
3
- class String
3
+ module AurisimoPalindrome
4
4
  # Returns true for a palindrome, false otherwise.
5
5
  def palindrome?
6
6
  processed_content == processed_content.reverse
@@ -10,7 +10,14 @@ class String
10
10
 
11
11
  # Returns content for palindrome testing.
12
12
  def processed_content
13
- gsub(/\W/, "").downcase
13
+ to_s.gsub(/[^a-z0-9]/i, "").downcase
14
14
  end
15
15
  end
16
-
16
+
17
+ class String
18
+ include AurisimoPalindrome
19
+ end
20
+
21
+ class Integer
22
+ include AurisimoPalindrome
23
+ end
@@ -1,3 +1,3 @@
1
1
  module AurisimoPalindrome
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: aurisimo_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
  - Aurelijus Lape