nithya_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 +7 -0
- data/.github/workflows/main.yml +18 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +10 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +50 -0
- data/README.md +39 -0
- data/Rakefile +16 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/nithya_palindrome.rb +18 -0
- data/lib/nithya_palindrome/version.rb +5 -0
- data/nithya_palindrome.gemspec +36 -0
- metadata +58 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 60f3927a18feba401951207380cfd33d31e9f1ed498c432ce33420c8dfd52c1c
|
4
|
+
data.tar.gz: f434c10c1683d0f7ce1f6b42c737e6270492ddd1db12b6b3c90559cd0e9cd07d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 22a66c20da4ad5949ae1b781018824607ae8be22db00679b7bf742fc2776625c36d7c770e10a038a758db48cbf4e4994ad57729bdf5b93450bc1b17f8723059a
|
7
|
+
data.tar.gz: fbae6740c50a5829bf9997322628798e26a1b54648e6ec3a7ecd8e8f61307651ada58b389db74949ed22fe7fc79774d4037d2f68cbb7afda93490f47d6f08f87
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push,pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- name: Set up Ruby
|
11
|
+
uses: ruby/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: 2.5.5
|
14
|
+
- name: Run the default task
|
15
|
+
run: |
|
16
|
+
gem install bundler -v 2.2.3
|
17
|
+
bundle install
|
18
|
+
bundle exec rake
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
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 nithya_palindrome.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
|
10
|
+
gem "minitest", "~> 5.0"
|
11
|
+
|
12
|
+
gem "rubocop", "~> 0.80"
|
13
|
+
|
14
|
+
gem 'minitest-reporters', '1.2.0'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
nithya_palindrome (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ansi (1.5.0)
|
10
|
+
ast (2.4.1)
|
11
|
+
builder (3.2.4)
|
12
|
+
minitest (5.14.2)
|
13
|
+
minitest-reporters (1.2.0)
|
14
|
+
ansi
|
15
|
+
builder
|
16
|
+
minitest (>= 5.0)
|
17
|
+
ruby-progressbar
|
18
|
+
parallel (1.20.1)
|
19
|
+
parser (3.0.0.0)
|
20
|
+
ast (~> 2.4.1)
|
21
|
+
rainbow (3.0.0)
|
22
|
+
rake (13.0.3)
|
23
|
+
regexp_parser (2.0.3)
|
24
|
+
rexml (3.2.4)
|
25
|
+
rubocop (0.93.1)
|
26
|
+
parallel (~> 1.10)
|
27
|
+
parser (>= 2.7.1.5)
|
28
|
+
rainbow (>= 2.2.2, < 4.0)
|
29
|
+
regexp_parser (>= 1.8)
|
30
|
+
rexml
|
31
|
+
rubocop-ast (>= 0.6.0)
|
32
|
+
ruby-progressbar (~> 1.7)
|
33
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
34
|
+
rubocop-ast (1.4.0)
|
35
|
+
parser (>= 2.7.1.5)
|
36
|
+
ruby-progressbar (1.11.0)
|
37
|
+
unicode-display_width (1.7.0)
|
38
|
+
|
39
|
+
PLATFORMS
|
40
|
+
x86_64-darwin-19
|
41
|
+
|
42
|
+
DEPENDENCIES
|
43
|
+
minitest (~> 5.0)
|
44
|
+
minitest-reporters (= 1.2.0)
|
45
|
+
nithya_palindrome!
|
46
|
+
rake (~> 13.0)
|
47
|
+
rubocop (~> 0.80)
|
48
|
+
|
49
|
+
BUNDLED WITH
|
50
|
+
2.2.3
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# NithyaPalindrome
|
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/nithya_palindrome`. 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 'nithya_palindrome'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install nithya_palindrome
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
|
26
|
+
`nithyaseverson_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
|
27
|
+
|
28
|
+
```
|
29
|
+
$ irb
|
30
|
+
>> require 'mhartl_palindrome'
|
31
|
+
>> "honey badger".palindrome?
|
32
|
+
=> false
|
33
|
+
>> "deified".palindrome?
|
34
|
+
=> true
|
35
|
+
>> "Able was I, ere I saw Elba.".palindrome?
|
36
|
+
=> true
|
37
|
+
>> phrase = "Madam, I'm Adam."
|
38
|
+
>> phrase.palindrome?
|
39
|
+
=> true
|
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]
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "nithya_palindrome"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "nithya_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
|
+
private
|
13
|
+
|
14
|
+
# Returns content for palindrome testing.
|
15
|
+
def processed_content
|
16
|
+
self.scan(/[a-zA-Z]/).join.downcase
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/nithya_palindrome/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "nithya_palindrome"
|
7
|
+
spec.version = NithyaPalindrome::VERSION
|
8
|
+
spec.authors = ["Nithya Severson"]
|
9
|
+
spec.email = ["nithya@supportbee.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Palindrome detector}
|
12
|
+
spec.description = %q{Learn Enough Ruby palindrome detector}
|
13
|
+
spec.homepage = "https://github.com/nithyarajaram/nithyaseverson_palindrome"
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
15
|
+
|
16
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org/"
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = "https://github.com/nithyarajaram/nithyaseverson_palindrome"
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/nithyarajaram/nithyaseverson_palindrome"
|
20
|
+
spec.metadata["changelog_uri"] = "https://github.com/nithyarajaram/nithyaseverson_palindrome"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
# Uncomment to register a new dependency of your gem
|
32
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
33
|
+
|
34
|
+
# For more information and examples about making a new gem, checkout our
|
35
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nithya_palindrome
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nithya Severson
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-01-04 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Learn Enough Ruby palindrome detector
|
14
|
+
email:
|
15
|
+
- nithya@supportbee.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".github/workflows/main.yml"
|
21
|
+
- ".gitignore"
|
22
|
+
- ".rubocop.yml"
|
23
|
+
- Gemfile
|
24
|
+
- Gemfile.lock
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- bin/console
|
28
|
+
- bin/setup
|
29
|
+
- lib/nithya_palindrome.rb
|
30
|
+
- lib/nithya_palindrome/version.rb
|
31
|
+
- nithya_palindrome.gemspec
|
32
|
+
homepage: https://github.com/nithyarajaram/nithyaseverson_palindrome
|
33
|
+
licenses: []
|
34
|
+
metadata:
|
35
|
+
allowed_push_host: https://rubygems.org/
|
36
|
+
homepage_uri: https://github.com/nithyarajaram/nithyaseverson_palindrome
|
37
|
+
source_code_uri: https://github.com/nithyarajaram/nithyaseverson_palindrome
|
38
|
+
changelog_uri: https://github.com/nithyarajaram/nithyaseverson_palindrome
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.3.0
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubygems_version: 3.0.8
|
55
|
+
signing_key:
|
56
|
+
specification_version: 4
|
57
|
+
summary: Palindrome detector
|
58
|
+
test_files: []
|