my_palindrome 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: be3e564dc9078ca8294fc64c80e0e136010c5d050c514aa6bef45737dd01676b
4
+ data.tar.gz: de1fd034d4dc1c6913f104f6e6991d62b8ecde2957f699ef609b6b46f132b74d
5
+ SHA512:
6
+ metadata.gz: d5b67acbc017d7723bcb7e968072cc0c0a42ab26324e7a741459fc8516d003f3c642be8104c841aa3c1932457c26c3d0e874c295f75d0eb0c1a1bcb6e1eb54a0
7
+ data.tar.gz: b76548929b5579c82d61f0e5446a2ac5c1a212936cb598734d36ca98b92282602b8eee2b0399b1447e5bef966033ed12aee15f7821785ac2e2fd89454b10ab73
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # MyPalindrome
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/my_palindrome`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
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:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
18
+
19
+ ## Usage
20
+
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).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/my_palindrome.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[test rubocop]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MyPalindrome
4
+ VERSION = "0.2.0"
5
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "my_palindrome/version"
4
+
5
+ module MyPalindrome
6
+ # Returns true for a palindrome, false otherwise.
7
+ def palindrome?
8
+ processed_content == processed_content.reverse
9
+ end
10
+
11
+ private
12
+
13
+ # Returns content for palindrome testing.
14
+ def processed_content
15
+ self.to_s.scan(/[a-z\d]/i).join.downcase
16
+ end
17
+ end
18
+
19
+ class String
20
+ include MyPalindrome
21
+ end
22
+
23
+ class Integer
24
+ include MyPalindrome
25
+ end
@@ -0,0 +1,4 @@
1
+ module MyPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: my_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Folahanmi Kolawole
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Learn Enough Ruby palindrome detector
14
+ email:
15
+ - emmanuelkolawole4@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rubocop.yml"
21
+ - README.md
22
+ - Rakefile
23
+ - lib/my_palindrome.rb
24
+ - lib/my_palindrome/version.rb
25
+ - sig/my_palindrome.rbs
26
+ homepage: https://github.com/emmanuelkolawole4/my_learn_enough_ruby_palindrome
27
+ licenses: []
28
+ metadata:
29
+ allowed_push_host: https://rubygems.org/
30
+ homepage_uri: https://github.com/emmanuelkolawole4/my_learn_enough_ruby_palindrome
31
+ source_code_uri: https://github.com/emmanuelkolawole4/my_learn_enough_ruby_palindrome
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.6.0
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubygems_version: 3.2.3
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: Palindrome detector
51
+ test_files: []