byverbel_palindrome 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -15
- data/lib/byverbel_palindrome/version.rb +1 -1
- data/lib/byverbel_palindrome.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23ac6b65f4017598eba138f9692428caf67f8b7bb8584daf22b6f3ed4c393434
|
4
|
+
data.tar.gz: e07964c771027b8a0be4b051ae9065c6d20f0705574d26628f98352df8db67d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6909d0a9ba3c980efdb740d3e6d541f391f0411c718e6f3fdc2a1d0bd7c65a9aa326c40bcc5d1d688f2376777606b4a43637f4a23166f39e8be128dcfed75eef
|
7
|
+
data.tar.gz: f5fbb8b6a9bf68a8666f174d2f06f9fa63ea5477457495d2e47c09fd77433c2b6e6ec411ae0a37fab5d1f4e18cc16c2a214f26430efc503580878d36dbba9126
|
data/README.md
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# Welcome!
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/byverbel_palindrome`. To experiment with that code, run `bin/console` for an interactive prompt.
|
3
|
+
This is my first gem. A simple one, hope you find it useful!
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
Install the gem and add to the application's Gemfile by executing:
|
7
|
+
Install the gem and add it to your application's Gemfile by executing:
|
12
8
|
|
13
9
|
$ bundle add byverbel_palindrome
|
14
10
|
|
@@ -18,14 +14,10 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
18
14
|
|
19
15
|
## Usage
|
20
16
|
|
21
|
-
|
22
|
-
|
23
|
-
## Development
|
24
|
-
|
25
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
26
|
-
|
27
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
17
|
+
This gem adds an instance method called `palindrome?` for the classes `String` and `Integer`.
|
28
18
|
|
29
19
|
## Contributing
|
30
20
|
|
31
|
-
|
21
|
+
After checking out the repo, you can clone it to contribute! Download it and run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
22
|
+
|
23
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/byverbel/byverbel_palindrome.
|
data/lib/byverbel_palindrome.rb
CHANGED
@@ -6,7 +6,12 @@ require_relative "byverbel_palindrome/version"
|
|
6
6
|
module ByverbelPalindrome
|
7
7
|
# Returns true for a palindrome, false otherwise.
|
8
8
|
def palindrome?
|
9
|
-
processed_content == processed_content.reverse
|
9
|
+
processed_content == processed_content.reverse && content?
|
10
|
+
end
|
11
|
+
|
12
|
+
# Check if string has zero characters like "" or strings with just spaces " ", " ", "\n", "\s", "\t", etc...
|
13
|
+
def content?
|
14
|
+
!processed_content.empty?
|
10
15
|
end
|
11
16
|
|
12
17
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: byverbel_palindrome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sllopezv
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Learn Enough Ruby palindrome detector
|
14
14
|
email:
|