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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2492f650e9f95cf4d01c76d719fe2e394e5d3be6cc54d5b53b9badc89703fe92
4
- data.tar.gz: f07540d470bf42b02c4431e986bd79a4880e4fef74572cba86807c7da34f3a95
3
+ metadata.gz: 23ac6b65f4017598eba138f9692428caf67f8b7bb8584daf22b6f3ed4c393434
4
+ data.tar.gz: e07964c771027b8a0be4b051ae9065c6d20f0705574d26628f98352df8db67d6
5
5
  SHA512:
6
- metadata.gz: 6ed7caabe1837b0fdde13e4819c3a32575a02c5562cc0de90ce6b4b2a92499dd9a12a85100a317ea03bdc548725e4f44d3e084fc8d65bf1ea7c881e1833621e0
7
- data.tar.gz: 20e59752740c914be573834aa41147fa8299ea1fe65d6fc1183c40681d0d0ef3f098cb02bf19ac9e5066fe0ed4a49eb0d09b23a753d318805ed0385088bd6fe0
6
+ metadata.gz: 6909d0a9ba3c980efdb740d3e6d541f391f0411c718e6f3fdc2a1d0bd7c65a9aa326c40bcc5d1d688f2376777606b4a43637f4a23166f39e8be128dcfed75eef
7
+ data.tar.gz: f5fbb8b6a9bf68a8666f174d2f06f9fa63ea5477457495d2e47c09fd77433c2b6e6ec411ae0a37fab5d1f4e18cc16c2a214f26430efc503580878d36dbba9126
data/README.md CHANGED
@@ -1,14 +1,10 @@
1
- # ByverbelPalindrome
1
+ # Welcome!
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
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
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
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
- TODO: Write usage instructions here
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
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/byverbel_palindrome.
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ByverbelPalindrome
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -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.2.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-04-26 00:00:00.000000000 Z
11
+ date: 2024-05-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Learn Enough Ruby palindrome detector
14
14
  email: