msurfas_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: f00483e1acf1cdc11770afc60e810a8b22f55d8e9f6c5c7ca3a5c037ac322dc3
4
+ data.tar.gz: 7b10c7d08d608defa68117a340f04dc16ca2cfc91160d7a5e7fad6e45f4eb866
5
+ SHA512:
6
+ metadata.gz: 9c00f14292107fe438299f37bc78212ea48a8da4be61df5dfa8581f203a2db351976261728edca19aba27f13b36cca3d7b8a6b83df5767e880b7ac85506a347b
7
+ data.tar.gz: 99142e0dc7a17962699a5307f809b08506934789085ecafb6e85f7ffc589491a01a4421f0267d367943660bbc23c3eb96cc868f11f9a6e97b0e5592595cf2a81
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,33 @@
1
+ # MsurfasPalindrome
2
+
3
+ #version 0.2.0 - now handling integer palindromes
4
+
5
+ TODO: Delete this and the text below, and describe your gem
6
+
7
+ 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/msurfas_palindrome`. To experiment with that code, run `bin/console` for an interactive prompt.
8
+
9
+ ## Installation
10
+
11
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_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.
12
+
13
+ Install the gem and add to the application's Gemfile by executing:
14
+
15
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
16
+
17
+ If bundler is not being used to manage dependencies, install the gem by executing:
18
+
19
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ 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.
28
+
29
+ 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).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/msurfas_palindrome.
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MsurfasPalindrome
4
+ VERSION = "0.2.0"
5
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "msurfas_palindrome/version"
4
+
5
+ module MsurfasPalindrome
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 palindrome testing.
15
+ def processed_content
16
+ self.to_s.scan(/[a-z\d]/i).join.downcase
17
+ end
18
+ end
19
+
20
+ class String
21
+ include MsurfasPalindrome
22
+ end
23
+
24
+ class Integer
25
+ include MsurfasPalindrome
26
+ end
@@ -0,0 +1,4 @@
1
+ module MsurfasPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: msurfas_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Mark Surfas
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-11-11 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Learn Enough Ruby palindrome detector
14
+ email:
15
+ - 1173598+MarkSurfas@users.noreply.github.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rubocop.yml"
21
+ - README.md
22
+ - Rakefile
23
+ - lib/msurfas_palindrome.rb
24
+ - lib/msurfas_palindrome/version.rb
25
+ - sig/msurfas_palindrome.rbs
26
+ homepage: https://github.com/MarkSurfas/msurfas_palindrome
27
+ licenses: []
28
+ metadata:
29
+ allowed_push_host: https://rubygems.org
30
+ homepage_uri: https://github.com/MarkSurfas/msurfas_palindrome
31
+ source_code_uri: https://example.com
32
+ changelog_uri: https://example.com
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 2.6.0
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubygems_version: 3.3.3
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: palindrome discovery
52
+ test_files: []