hroulston_palindrome 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6aecba267297ec3009d660f81ca02bf7a73caf849993213b798f374e6e4ea726
4
+ data.tar.gz: 2fdeee69aeb26a4a13a9c9006895b8c7f4e167447c1e761cfe21f3bc4d059a3a
5
+ SHA512:
6
+ metadata.gz: 8ad756a943b0727dd9ccb204ece5cb4548b5d041b38fe843a200df99ff16dc53fe0c97f7abc14e261c0923ba9dac6bc1d97565d96cf2206ac979640a0fbf7f45
7
+ data.tar.gz: e13c241e4a2faa1f502e3f37e761bebe049e1a4ac169b27a48c6a77508bfd355abaff4c54a46a693e7b4fac9fed7f683accbf5bc1d333098e78d28f0fe84888c
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/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in hroulston_palindrome.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+
12
+ gem "rubocop", "~> 1.21"
13
+
14
+ gem "minitest-reporters", "1.2.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ hroulston_palindrome (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ansi (1.5.0)
10
+ ast (2.4.2)
11
+ builder (3.2.4)
12
+ json (2.6.3)
13
+ minitest (5.18.0)
14
+ minitest-reporters (1.2.0)
15
+ ansi
16
+ builder
17
+ minitest (>= 5.0)
18
+ ruby-progressbar
19
+ parallel (1.23.0)
20
+ parser (3.2.2.1)
21
+ ast (~> 2.4.1)
22
+ rainbow (3.1.1)
23
+ rake (13.0.6)
24
+ regexp_parser (2.8.0)
25
+ rexml (3.2.5)
26
+ rubocop (1.51.0)
27
+ json (~> 2.3)
28
+ parallel (~> 1.10)
29
+ parser (>= 3.2.0.0)
30
+ rainbow (>= 2.2.2, < 4.0)
31
+ regexp_parser (>= 1.8, < 3.0)
32
+ rexml (>= 3.2.5, < 4.0)
33
+ rubocop-ast (>= 1.28.0, < 2.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (>= 2.4.0, < 3.0)
36
+ rubocop-ast (1.28.1)
37
+ parser (>= 3.2.1.0)
38
+ ruby-progressbar (1.13.0)
39
+ unicode-display_width (2.4.2)
40
+
41
+ PLATFORMS
42
+ arm64-darwin-21
43
+ x86_64-linux
44
+
45
+ DEPENDENCIES
46
+ hroulston_palindrome!
47
+ minitest (~> 5.0)
48
+ minitest-reporters (= 1.2.0)
49
+ rake (~> 13.0)
50
+ rubocop (~> 1.21)
51
+
52
+ BUNDLED WITH
53
+ 2.4.10
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # HroulstonPalindrome
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/hroulston_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_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.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_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_PRIOR_TO_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]/hroulston_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 HroulstonPalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "hroulston_palindrome/version"
4
+
5
+ class String
6
+ def palindrome?
7
+ processed_content == processed_content.reverse
8
+ end
9
+
10
+ #Method should return the letters from a string
11
+ #Completely refactored method
12
+ #Can actually delete method and go further creating
13
+ #the pattern matching in processed content.
14
+ # def letters
15
+ # chars.select { |c| c.match(/[a-z]/i) }.join
16
+ # end
17
+
18
+ private
19
+
20
+ def processed_content
21
+ self.scan(/[a-z]/i).join.downcase
22
+ end
23
+ end
@@ -0,0 +1,4 @@
1
+ module HroulstonPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hroulston_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - hroulston
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-06-01 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Learn Enough Ruby Palindrome detector
14
+ email:
15
+ - 'h_roulston@live.com
16
+
17
+ '
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".rubocop.yml"
23
+ - Gemfile
24
+ - Gemfile.lock
25
+ - README.md
26
+ - Rakefile
27
+ - lib/hroulston_palindrome.rb
28
+ - lib/hroulston_palindrome/version.rb
29
+ - sig/hroulston_palindrome.rbs
30
+ homepage: https://github.com/hroulston/hroulston_palindrome
31
+ licenses: []
32
+ metadata:
33
+ allowed_push_host: https://rubygems.org
34
+ homepage_uri: https://github.com/hroulston/hroulston_palindrome
35
+ source_code_uri: https://github.com/hroulston/hroulston_palindrome
36
+ changelog_uri: https://github.com/hroulston/hroulston_palindrome
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 2.6.0
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubygems_version: 3.4.10
53
+ signing_key:
54
+ specification_version: 4
55
+ summary: Palindrome Detector
56
+ test_files: []