palindrome_tester 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2b9eb85905b8f947e01bfd66c728f28454312b2807d126fa5b12c02b23772d76
4
+ data.tar.gz: 1fc1d63e8c45d75d57a9f9725c1327c59e66705fd661ceffc3f96e39a6035ac3
5
+ SHA512:
6
+ metadata.gz: cfaf1c8c3d35663198e103cda10af61af87118bc64d80e71c89f1f3735a448ef656fdd3ef5c7bcec61fc328e6e996d538d3f4592d07820283ca49b980d1237fe
7
+ data.tar.gz: 80dc97f54d0869e1a65680a558e0cccf56f8fa8d3dddc24768c7804c738b5f3060436f12752d67321fc0e88b46d4c882d8a958e51148a2f32b47a6e718f9b8b6
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.2
6
+ before_install: gem install bundler -v 2.1.4
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+ gemspec
3
+
4
+ gem "rake", "~> 12.0"
5
+ gem "minitest", "~> 5.0"
6
+
7
+ gem "minitest-reporters", "~> 1.4"
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ palindrome_tester (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.14.2)
12
+ minitest-reporters (1.4.2)
13
+ ansi
14
+ builder
15
+ minitest (>= 5.0)
16
+ ruby-progressbar
17
+ rake (12.3.3)
18
+ ruby-progressbar (1.10.1)
19
+
20
+ PLATFORMS
21
+ ruby
22
+
23
+ DEPENDENCIES
24
+ minitest (~> 5.0)
25
+ minitest-reporters (~> 1.4)
26
+ palindrome_tester!
27
+ rake (~> 12.0)
28
+
29
+ BUNDLED WITH
30
+ 2.1.4
@@ -0,0 +1,36 @@
1
+ # PalindromeTester
2
+
3
+ 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/palindrome_tester`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'palindrome_tester'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install palindrome_tester
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 tags, 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]/palindrome_tester.
36
+
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "palindrome_tester"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,27 @@
1
+ require "palindrome_tester/version"
2
+
3
+ module PalindromeTester
4
+ # Returns true for a palindrome, false otherwise.
5
+ def palindrome?
6
+ if processed_content.empty?
7
+ false
8
+ else
9
+ processed_content == processed_content.reverse
10
+ end
11
+ end
12
+
13
+ private
14
+ # Return 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
+
21
+ class String
22
+ include PalindromeTester
23
+ end
24
+
25
+ class Integer
26
+ include PalindromeTester
27
+ end
@@ -0,0 +1,3 @@
1
+ module PalindromeTester
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,25 @@
1
+ require_relative 'lib/palindrome_tester/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "palindrome_tester"
5
+ spec.version = PalindromeTester::VERSION
6
+ spec.authors = ["Franklin Ticona"]
7
+ spec.email = ["franklinjosmell@gmail.com"]
8
+
9
+ spec.summary = %q{Palindrome detector}
10
+ spec.description = %q{Learn Enough Ruby palindrome detector.}
11
+ spec.homepage = "https://github.com/franklinjosmell/palindrome_tester"
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
+
14
+ spec.metadata["homepage_uri"] = spec.homepage
15
+ spec.metadata["source_code_uri"] = "https://github.com/franklinjosmell/palindrome_tester"
16
+
17
+ # Specify which files should be added to the gem when it is released.
18
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ end
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: palindrome_tester
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Franklin Ticona
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-11-11 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Learn Enough Ruby palindrome detector.
14
+ email:
15
+ - franklinjosmell@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".gitignore"
21
+ - ".travis.yml"
22
+ - Gemfile
23
+ - Gemfile.lock
24
+ - README.md
25
+ - Rakefile
26
+ - bin/console
27
+ - bin/setup
28
+ - lib/palindrome_tester.rb
29
+ - lib/palindrome_tester/version.rb
30
+ - palindrome_tester.gemspec
31
+ homepage: https://github.com/franklinjosmell/palindrome_tester
32
+ licenses: []
33
+ metadata:
34
+ homepage_uri: https://github.com/franklinjosmell/palindrome_tester
35
+ source_code_uri: https://github.com/franklinjosmell/palindrome_tester
36
+ post_install_message:
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 2.3.0
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubygems_version: 3.1.4
52
+ signing_key:
53
+ specification_version: 4
54
+ summary: Palindrome detector
55
+ test_files: []