albopunkaldi_palindrome 0.1.0 → 0.2.1

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: 5d0f06df2f3b3e3cc58ee6c7621f3dff901aad7bd83888560e01c7db4703fa54
4
- data.tar.gz: e5253cfee3dcf48d319bf27db3c80abe4da66ae1ca5ecc224dde5ac65e572536
3
+ metadata.gz: ce2b6e182bd7806a6f9042b81eb17ed3918f2825cb87c779627bd1aaac49e08c
4
+ data.tar.gz: 11071d4446838090099d43135b5351e3fdd79bad036662c171908459eb9f31d4
5
5
  SHA512:
6
- metadata.gz: 588704fbb75250d459e8e187033edbcff5fa055ee0bf2e3ff4aa75b20f74af5a7ce9dde6c13214e18c39c6d037ef6b42be8c7dc1cfe5cf944852c89dfb21d976
7
- data.tar.gz: b649ec4bcd02e9db5ff8c7ba8163356bcc3bb5b83468ea078d7e7c1eabd4fbcf14c99e1816f99c519a326f8c453e5368e0ede8cbe9500b59e8b4af37f3679f30
6
+ metadata.gz: '010155295fd65b59ee5549043904fb663cc7f13d7c5d17d8457665b9bec0f8ac710e13353e0a1c0824750dd7c87f8f850e7746598f9ede5330f49729327e230f'
7
+ data.tar.gz: dbca6c434e3fbbc7c9c906e92091de153ecee6cda4f6d39840fcbbb5ecd6c05f4236504edb0bc148a95beaf1d08d71f393486aa49315811802d8403f79f0384f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- albopunkaldi_palindrome (0.1.0)
4
+ albopunkaldi_palindrome (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  `albopunkaldi_palindrome` is a sample Ruby gem created in [*Learn Enough Ruby to Be Dangerous*](https://www.learnenough.com/ruby-tutorial) by Alberto Pancaldi.
4
4
 
5
- The purpose of this gem is to detect if a text is whether or not a palindrome.
5
+ The purpose of this gem is to detect if strings or integer are palindrome or not.
6
6
 
7
7
  ## Installation
8
8
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AlbopunkaldiPalindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -2,10 +2,11 @@
2
2
 
3
3
  require_relative "albopunkaldi_palindrome/version"
4
4
 
5
- class String
5
+ module AlboPunkaldiPalindrome
6
6
 
7
7
  # Returns true for a palindrome, false otherwise.
8
8
  def palindrome?
9
+ !processed_content.empty? &&
9
10
  processed_content == processed_content.reverse
10
11
  end
11
12
 
@@ -13,6 +14,14 @@ class String
13
14
 
14
15
  # Returns content for palindrome testing.
15
16
  def processed_content
16
- scan(/[a-z]/i).join.downcase
17
+ to_s.scan(/[a-z\d]/i).join.downcase
17
18
  end
18
19
  end
20
+
21
+ class String
22
+ include AlboPunkaldiPalindrome
23
+ end
24
+
25
+ class Integer
26
+ include AlboPunkaldiPalindrome
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albopunkaldi_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Pancaldi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-03 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Learn Enough Ruby palindrome detector
14
14
  email: