chap8_ex_gem_palindrome 0.2.0 → 0.2.1

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: cf407c47a83f51a42319dfd84dee08216ebbda73a38209792ee9b6b3ba847806
4
- data.tar.gz: 57de3b43ee352ea96e31a63a0f6fac35493a369048ff604a15ce20d267d4f08c
3
+ metadata.gz: 1786ac8e9766be3749b2dba55abe2c5cfc670dca24968dd18c33993e8ee50456
4
+ data.tar.gz: a4c44a30a8da0b5a94e63c4b6cf9410c6b45a90db9dc5d4858d069634503a6e4
5
5
  SHA512:
6
- metadata.gz: 877eb2f100abc30973a31063e4caa41d713f199d9d2d2d5ec6028ce7741ab84318593cd7e2c2e5a78cd461448c9bdc9464a26134eac91f427b9c5f543be45f1f
7
- data.tar.gz: d1465fe63439df2de746879d458b8d6afe73a305c418d653f59174057c56348fe86c5007af74122f34afaf2a21d159ab84790b45673dcb00aed119d7dd09f638
6
+ metadata.gz: 6de3ebc6949a1c2d83b751a99ffca5c646520df106e0ae8a76534aa245ace9e5751010b8b792a0a45a1ff713eb5b089aa3c438e75b1afa6ca1f1f8cf619eefce
7
+ data.tar.gz: 2bf8f847a73717162fda823ff2f12bc165d21eb182ae347d4006a7264e8a6eff8553863f8a116595b1c9ce6f3753a38c809561181c2b45d817e5155725346ea2
data/Gemfile CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
7
  # Specify your gem's dependencies in chap8_ex_gem_palindrome.gemspec
8
8
  gemspec
@@ -13,4 +13,4 @@ gem "minitest", "~> 5.0"
13
13
 
14
14
  gem "rubocop", "~> 1.21"
15
15
 
16
- gem 'minitest-reporters', '1.2.0'
16
+ gem "minitest-reporters", "1.2.0"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chap8_ex_gem_palindrome (0.2.0)
4
+ chap8_ex_gem_palindrome (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -8,13 +8,11 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Xeniouska"]
9
9
  spec.email = ["115425494+Xeniouska@users.noreply.github.com"]
10
10
 
11
- spec.summary = %q{Palindrome detector}
12
- spec.description = %q{Learn Enough Ruby palindrome detector}
11
+ spec.summary = "Palindrome detector"
12
+ spec.description = "Learn Enough Ruby palindrome detector"
13
13
  spec.homepage = "https://github.com/mhartl/mhartl_palindrome"
14
14
  spec.required_ruby_version = ">= 2.6.0"
15
15
 
16
-
17
-
18
16
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the
19
17
  # 'allowed_push_host'
20
18
  # to allow pushing to a single host or delete this section to allow pushing to
@@ -32,8 +30,6 @@ Gem::Specification.new do |spec|
32
30
  # spec.metadata["source_code_uri"] = spec.homepage
33
31
  # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
34
32
 
35
-
36
-
37
33
  # Specify which files should be added to the gem when it is released.
38
34
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
39
35
  spec.files = Dir.chdir(__dir__) do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chap8ExGemPalindrome
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -1,28 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Version 0.2.0
3
+ # Version 0.2.1
4
4
 
5
5
  require_relative "chap8_ex_gem_palindrome/version"
6
6
 
7
+ # Test for palindroms
7
8
  module Chap8ExGemPalindrome
8
-
9
9
  # Returns true for a palindrome, false otherwise.
10
10
  def palindrome?
11
- processed_content == processed_content.reverse
11
+ if processed_content.empty?
12
+ false
13
+ else
14
+ processed_content == processed_content.reverse
15
+ end
12
16
  end
13
17
 
14
18
  private
15
19
 
16
- # Returns content for palindrome testing.
17
- def processed_content
18
- scan(/[a-z0-9]/i).join.downcase
19
- end
20
+ # Returns content for palindrome testing.
21
+ def processed_content
22
+ scan(/[a-z0-9]/i).join.downcase
23
+ end
20
24
  end
21
25
 
22
26
  class String
23
27
  include Chap8ExGemPalindrome
24
28
  end
25
29
 
30
+ class Integer
31
+ include Chap8ExGemPalindrome
32
+ end
33
+
26
34
  # class String
27
35
 
28
36
  # # Returns true for a palindrome, false otherwise.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chap8_ex_gem_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xeniouska
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-24 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Learn Enough Ruby palindrome detector
14
14
  email: