fpop_palindrome 0.1.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 +7 -0
- data/README.md +45 -0
- data/Rakefile +8 -0
- data/lib/fpop_palindrome/version.rb +5 -0
- data/lib/fpop_palindrome.rb +18 -0
- data/sig/fpop_palindrome.rbs +4 -0
- metadata +50 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 966bea610ac094c5525808ca05d548a9aeef1ab20b759f9c255d84b863565ff3
|
4
|
+
data.tar.gz: ce5ba3533836149739d2ba58e02b7ffd1538090138c21e947356139c95f64b8e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 015a591623055ce8b695d5c7347d05598ab33b47cf6b8a54afa8fd777735b78d847735250f271626b14f2dea74dadd64cc07e308913072cbc60835285d36e7d3
|
7
|
+
data.tar.gz: c7780cdfb8f8bedce831307a3e6674493d624564b68590e066b558ebbf1d3525a6de2f3257517bf462d7687356f2fc4adfde1e6c0feed39f3d8697dfb2b1b01c
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Palindrome detector
|
2
|
+
|
3
|
+
`fpop_palindrome` is a sample Ruby gem created in [*Learn Enough Ruby to Be Dangerous*](https://www.learnenough.com/ruby-tutorial) by Michael Hartl.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
To install `fpop_palindrome`, add this line to your application's `Gemfile`:
|
8
|
+
|
9
|
+
```
|
10
|
+
gem 'fpop_palindrome'
|
11
|
+
```
|
12
|
+
|
13
|
+
Then install as follows:
|
14
|
+
|
15
|
+
```
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it directly using `gem`:
|
20
|
+
|
21
|
+
```
|
22
|
+
$ gem install fpop_palindrome
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
`fpop_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
|
28
|
+
|
29
|
+
```
|
30
|
+
$ irb
|
31
|
+
>> require 'fpop_palindrome'
|
32
|
+
>> "honey badger".palindrome?
|
33
|
+
=> false
|
34
|
+
>> "deified".palindrome?
|
35
|
+
=> true
|
36
|
+
>> "Able was I, ere I saw Elba.".palindrome?
|
37
|
+
=> true
|
38
|
+
>> phrase = "Madam, I'm Adam."
|
39
|
+
>> phrase.palindrome?
|
40
|
+
=> true
|
41
|
+
```
|
42
|
+
|
43
|
+
## License
|
44
|
+
|
45
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "fpop_palindrome/version"
|
4
|
+
|
5
|
+
class String
|
6
|
+
|
7
|
+
# Returns true for a palindrome, false otherwise.
|
8
|
+
def palindrome?
|
9
|
+
processed_content == processed_content.reverse
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
# Returns content for palidrome testing.
|
15
|
+
def processed_content
|
16
|
+
scan(/[a-z]/i).join.downcase
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fpop_palindrome
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrew
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-08-09 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Learn Enough Ruby palindrome detector
|
14
|
+
email:
|
15
|
+
- andrew.garcia.2015@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- README.md
|
21
|
+
- Rakefile
|
22
|
+
- lib/fpop_palindrome.rb
|
23
|
+
- lib/fpop_palindrome/version.rb
|
24
|
+
- sig/fpop_palindrome.rbs
|
25
|
+
homepage: https://github.com/Andrew-Garcia/fpop_palindrome
|
26
|
+
licenses: []
|
27
|
+
metadata:
|
28
|
+
allowed_push_host: https://rubygems.org/
|
29
|
+
homepage_uri: https://github.com/Andrew-Garcia/fpop_palindrome
|
30
|
+
source_code_uri: https://github.com/Andrew-Garcia/fpop_palindrome
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 3.2.0
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
requirements: []
|
46
|
+
rubygems_version: 3.4.20
|
47
|
+
signing_key:
|
48
|
+
specification_version: 4
|
49
|
+
summary: Palindrome detector
|
50
|
+
test_files: []
|