crashmat_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: 76b6fa6ae9a12e2abc779aa34686c9ee843217826c8293c612fbe6248cecfa4c
4
- data.tar.gz: 2ef00430ee48ae13f41c008f809a2227664fa82f82d3e616785cab443cd43378
3
+ metadata.gz: 2d66772e7a10d687c4b3102d633d4bd2e0cb4a9e7483d064721236bd92c07b66
4
+ data.tar.gz: 3578fd607432cb36848d69dc98791ad510e3ded21d8cd03e00a18c1157bfa9ce
5
5
  SHA512:
6
- metadata.gz: b08fb52de91d021d546e8e6a7f22b7ac8e340067b3dd84d0c490f1269239df2e55200bbd707de0d2f8bb57c4a71053d15a0d50d4c4c64aa9ba2d8643fd7e3395
7
- data.tar.gz: 179270dc52c34a5722649fadd30c1e12ecdd977326ca31364a94849dc9b5d449a3014cbd15ff83fce4e14368148a0e57ce36263492e391b664c23e9995ae7ed3
6
+ metadata.gz: 6cfc6b43d1c1443e9ed4142138843602d1e0dc48fee147950a7539f5084336f5aa9a78b2a35a8dc3c7d3c9aa90695414d02e37730aa531e2a74c79cd50a423df
7
+ data.tar.gz: de903315c3c1fd06546c871e55ce0cd64af89b76a366224bb56b87a709eadf4167ff35c5bd668a72198cd858d38cd6dfc93fb37289181654e74d32ec109da725
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CrashmatPalindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -2,28 +2,25 @@
2
2
 
3
3
  require_relative "crashmat_palindrome/version"
4
4
 
5
- class String
5
+ module CrashmatPalindrome
6
6
 
7
7
  # Returns true for a palindrome, false otherwise.
8
8
  def palindrome?
9
9
  processed_content == processed_content.reverse
10
10
  end
11
11
 
12
- # Returns the letters of a string
13
- def letters
14
- the_letters = []
15
- for i in 0..self.length - 1
16
- if self[i].match(/[a-zA-Z]/)
17
- the_letters << self[i]
18
- end
19
- end
20
- the_letters.join
21
- end
22
-
23
12
  private
24
13
 
25
14
  # Returns content for palindrome testing.
26
15
  def processed_content
27
- self.letters.downcase
16
+ to_s.scan(/[a-z\d]/i).join.downcase
28
17
  end
29
18
  end
19
+
20
+ class String
21
+ include CrashmatPalindrome
22
+ end
23
+
24
+ class Integer
25
+ include CrashmatPalindrome
26
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crashmat_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
  - crashmat
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-29 00:00:00.000000000 Z
10
+ date: 2025-03-30 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: "%q{Learn Enough Ruby plaindrome detector}"
13
13
  email: