pasternak_video_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: a1d616ced84affc1c4d894b5ee8b8c62f8bac03e87ed06efd381979a7afc2730
4
+ data.tar.gz: c915a9bb4950f897b363c2e030c898d507e4df5d3e59f9ef0dd398aeb7576666
5
+ SHA512:
6
+ metadata.gz: ea56d5f2613874121764554e437566d54ad7a5cb581ad57dd1c5f1202c18d97b17dd01e51e5d2d909adf7745a19e39907269e3854e3ce75c2225901602b14be5
7
+ data.tar.gz: 9c2167a06997178d1d5f9bb8be8da93f87990afc5428159b89611c7eacd0c83f8367aa3e3c9f373eb17a10eb19c1bd9ddc8ff513111b3f02ccc49f2833aeb2d5
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in pasternak_video_palindrome.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+
12
+ gem 'minitest-reporters', '1.2.0'
data/Gemfile.lock ADDED
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pasternak_video_palindrome (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ansi (1.5.0)
10
+ builder (3.2.4)
11
+ minitest (5.18.0)
12
+ minitest-reporters (1.2.0)
13
+ ansi
14
+ builder
15
+ minitest (>= 5.0)
16
+ ruby-progressbar
17
+ rake (13.0.6)
18
+ ruby-progressbar (1.13.0)
19
+
20
+ PLATFORMS
21
+ x86_64-darwin-22
22
+
23
+ DEPENDENCIES
24
+ minitest (~> 5.0)
25
+ minitest-reporters (= 1.2.0)
26
+ pasternak_video_palindrome!
27
+ rake (~> 13.0)
28
+
29
+ BUNDLED WITH
30
+ 2.3.10
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Palindrome dectector
2
+ `palindrome` is a sample Ruby gem created in [*Learn Enough Ruby to be Dangerous*](https://www.learnenough.com/ruby-tutorial) by Michael Hartl.
3
+
4
+ ## Installation
5
+
6
+ To install 'palindrome', add this line to your application's `Gemfile`:
7
+ ```
8
+ gem 'palindrome'
9
+ ```
10
+ Then install as follows:
11
+ ```
12
+ $ bundle install
13
+ ```
14
+ Or install it directly using `gem`:
15
+ ```
16
+ $ gem install palindrome
17
+ ```
18
+ ## Usage
19
+
20
+ `palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
21
+ ```
22
+ $ irb
23
+ >> require 'palindrome'
24
+ >> "honey badger".palindrome?
25
+ => false
26
+ >> "deified".palindrome?
27
+ => true
28
+ ```
29
+ ## License
30
+
31
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/Licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
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
+ task default: :test
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PasternakVideoPalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "pasternak_video_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
+ def letters
13
+ chars.select {|c| c.match(/[a-z]/i) }.join
14
+ end
15
+
16
+ private
17
+
18
+ # Returns content for palindrome testing.
19
+ def processed_content
20
+ self.letters.downcase
21
+ end
22
+ end
@@ -0,0 +1,4 @@
1
+ module PasternakVideoPalindrome
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: pasternak_video_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Terra Pasternak
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-05-21 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Learn Enough Ruby palindrome detector
14
+ email:
15
+ - tpaster1@asu.edu
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - Gemfile
21
+ - Gemfile.lock
22
+ - README.md
23
+ - Rakefile
24
+ - lib/pasternak_video_palindrome.rb
25
+ - lib/pasternak_video_palindrome/version.rb
26
+ - sig/pasternak_video_palindrome.rbs
27
+ homepage: https://github.com/tpaster/palindrome
28
+ licenses: []
29
+ metadata:
30
+ allowed_push_host: https://rubygems.org/
31
+ homepage_uri: https://github.com/tpaster/palindrome
32
+ source_code_uri: https://github.com/tpaster/palindrome
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.4.13
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: Palindrome detector
52
+ test_files: []