crashmat_palindrome 0.1.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: 76b6fa6ae9a12e2abc779aa34686c9ee843217826c8293c612fbe6248cecfa4c
4
+ data.tar.gz: 2ef00430ee48ae13f41c008f809a2227664fa82f82d3e616785cab443cd43378
5
+ SHA512:
6
+ metadata.gz: b08fb52de91d021d546e8e6a7f22b7ac8e340067b3dd84d0c490f1269239df2e55200bbd707de0d2f8bb57c4a71053d15a0d50d4c4c64aa9ba2d8643fd7e3395
7
+ data.tar.gz: 179270dc52c34a5722649fadd30c1e12ecdd977326ca31364a94849dc9b5d449a3014cbd15ff83fce4e14368148a0e57ce36263492e391b664c23e9995ae7ed3
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.1
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: double_quotes
6
+
7
+ Style/StringLiteralsInInterpolation:
8
+ EnforcedStyle: double_quotes
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # CrashmatPalindrome
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/crashmat_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
+ ```bash
14
+ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
15
+ ```
16
+
17
+ If bundler is not being used to manage dependencies, install the gem by executing:
18
+
19
+ ```bash
20
+ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ 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.
30
+
31
+ 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).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/crashmat_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 CrashmatPalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "crashmat_palindrome/version"
4
+
5
+ class String
6
+
7
+ # Returns true for a palindrome, false otherwise.
8
+ def palindrome?
9
+ processed_content == processed_content.reverse
10
+ end
11
+
12
+ # Returns the letters of a string
13
+ def letters
14
+ the_letters = []
15
+ for i in 0..self.length - 1
16
+ if self[i].match(/[a-zA-Z]/)
17
+ the_letters << self[i]
18
+ end
19
+ end
20
+ the_letters.join
21
+ end
22
+
23
+ private
24
+
25
+ # Returns content for palindrome testing.
26
+ def processed_content
27
+ self.letters.downcase
28
+ end
29
+ end
@@ -0,0 +1,4 @@
1
+ module CrashmatPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crashmat_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - crashmat
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 2025-03-29 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: "%q{Learn Enough Ruby plaindrome detector}"
13
+ email:
14
+ - higgs.json@owasp.org
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - ".rubocop.yml"
20
+ - README.md
21
+ - Rakefile
22
+ - lib/crashmat_palindrome.rb
23
+ - lib/crashmat_palindrome/version.rb
24
+ - sig/crashmat_palindrome.rbs
25
+ homepage: https://github.com/devsecmatt/crashmat_palindrome
26
+ licenses: []
27
+ metadata:
28
+ allowed_push_host: https://rubygems.org/
29
+ homepage_uri: https://github.com/devsecmatt/crashmat_palindrome
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: 3.1.0
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubygems_version: 3.6.2
45
+ specification_version: 4
46
+ summary: "%q{Palindrom detector}"
47
+ test_files: []