test_palindrome_gem 0.1.1 → 0.3

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: 8e4562d5c6fd2d84316535416014a5febb46fbe9b21ca21a348d79af0e1147d2
4
- data.tar.gz: a8e00e7e2a444e2b8fac46d731e2cbe64760e252feba86596b0741f4d4d960ea
3
+ metadata.gz: a2757bc4d4c75be26dc66203d4baabbd597741264f0786bf893da71e1ff4b12b
4
+ data.tar.gz: c700fd236c537fcca14adaf6ae8a2fb8a83751700520bba570d487472bb133b0
5
5
  SHA512:
6
- metadata.gz: 6334beebec3ef009bf30170547c443074b312e22201a40fde2de59f5c681ab49278b648383f25e20f7ae94b1d9adb3e5db472229623ef8f99d4ad7eea9417476
7
- data.tar.gz: 131c95568d8772ffe798d05d854034c2c21ca87e3aed8f36458ba274d24755cb7b03f489be7b748ac959406b0dcea1c54d61ada5b7d40e4cfd36b1ac488d11fc
6
+ metadata.gz: f993dfffcf732cb2f72ff3b7224cc78373f4e8a5667fae68c0654ad3d13074a433b334203620d7c3d26a10745b0c8ffde8401df13ff1fe3f4e4ad4f3e3657365
7
+ data.tar.gz: 73710996857072afb27f76981c36b9d11b503272ac16e9a46c2199c38682c1854183b7fc773604dbc2aacd72fa148d0d55c7025ac5f8bc469f56ad114cd43931
data/CHANGELOG.md CHANGED
@@ -2,4 +2,8 @@
2
2
 
3
3
  ## [0.1.0] - 2024-09-17
4
4
 
5
- - Initial release
5
+ - Initial release. Works for strings.
6
+
7
+ ## [0.2.0]
8
+
9
+ - Adds functionality for integers.
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
+ [![Gem Version](https://badge.fury.io/rb/test_palindrome_gem.svg)](https://badge.fury.io/rb/test_palindrome_gem)
2
+
1
3
  # TestPalindromeGem
2
4
 
3
- Tests for palindromes, as in <code>"Yes".palindrome?</code>.
5
+ Tests for palindromes, as in <code>"Yes".palindrome?</code>. Works for strings and integers.
4
6
 
5
7
  ## Installation
6
8
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TestPalindromeGem
4
- VERSION = "0.1.1"
4
+ VERSION = "0.3"
5
5
  end
@@ -2,15 +2,18 @@
2
2
 
3
3
  require_relative "test_palindrome_gem/version"
4
4
 
5
- class String
6
5
 
6
+ module TestPalindromeGem
7
7
  def palindrome?
8
- processed_content == processed_content.reverse
8
+ if processed_content.empty?
9
+ false
10
+ else
11
+ processed_content == processed_content.reverse
12
+ end
9
13
  end
10
14
 
11
- # Return only the letters
12
15
  def letters
13
- self.scan(/[a-z]/i).join
16
+ self.to_s.scan(/[a-z\d]/i).join
14
17
  end
15
18
 
16
19
  private
@@ -19,3 +22,11 @@ class String
19
22
  self.letters.downcase
20
23
  end
21
24
  end
25
+
26
+ class String
27
+ include TestPalindromeGem
28
+ end
29
+
30
+ class Integer
31
+ include TestPalindromeGem
32
+ end
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_palindrome_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Labern
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-18 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Allows for "Racecar".palindrome?, returning true. Works for strings of
14
- upper, lower, mixed, and punctuated contents.
13
+ description: Allows for "Racecar".palindrome? for strings, returning true. Works for
14
+ strings of upper, lower, mixed, and punctuated contents. Also works for integers,
15
+ so that 1234321.palindrome? returns true. Uses mixins.
15
16
  email:
16
17
  - lukelabern@gmail.com
17
18
  executables: []
@@ -52,5 +53,5 @@ requirements: []
52
53
  rubygems_version: 3.5.18
53
54
  signing_key:
54
55
  specification_version: 4
55
- summary: Adds palindrome? functionality to strings.
56
+ summary: Adds palindrome? functionality to strings and integers.
56
57
  test_files: []