aga_palindrome 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.travis.yml +6 -0
- data/CHANGELOG.md +0 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +30 -0
- data/README.md +49 -0
- data/Rakefile +10 -0
- data/aga_palindrome.gemspec +32 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/aga_palindrome.rb +16 -0
- data/lib/aga_palindrome/version.rb +3 -0
- metadata +58 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2cc69650fcfa6268413dce969b524ef651f43bd31de3d0576eaa55573857d79f
|
4
|
+
data.tar.gz: 14cf388afde9827df6ba7a0f84bccabab86685577cc1b81ef96d7f68d4b442d0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 39f1ad852b9a11b4dba0e76e5d167b370ed464bf7755d1b2203a045588141be8cdfeba1ba4c8bf95aca51b9eaa3a7fb8ab313f5ba86e3f9f4a18b28a9708183b
|
7
|
+
data.tar.gz: e1fb699d4af964e60d57ae4315a39362153da94d0f416d77ad1dd38c3b04f8ffddd0a3fa5a7dd786e565c9c1d2bb2b4187faec78ffd8967a855ad787a31c29bf
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
File without changes
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
aga_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.14.0)
|
12
|
+
minitest-reporters (1.2.0)
|
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
|
+
aga_palindrome!
|
25
|
+
minitest (~> 5.0)
|
26
|
+
minitest-reporters (= 1.2.0)
|
27
|
+
rake (~> 12.0)
|
28
|
+
|
29
|
+
BUNDLED WITH
|
30
|
+
2.1.4
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# AgaPalindrome
|
2
|
+
|
3
|
+
`aga_palindrome` is a sample Ruby gem created in [*Learn Enough Ruby to Be Dangerous*](https://www.learnenough.com/ruby-tutorial) by Michael Hartl.
|
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
|
+
```
|
12
|
+
gem 'aga_palindrome'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install aga_palindrome
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
`aga_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
|
26
|
+
```
|
27
|
+
$ irb
|
28
|
+
>> require 'mhartl_palindrome'
|
29
|
+
>> "honey badger".palindrome?
|
30
|
+
=> false
|
31
|
+
>> "deified".palindrome?
|
32
|
+
=> true
|
33
|
+
>> "Able was I, ere I saw Elba.".palindrome?
|
34
|
+
=> true
|
35
|
+
>> phrase = "Madam, I'm Adam."
|
36
|
+
>> phrase.palindrome?
|
37
|
+
=> true
|
38
|
+
```
|
39
|
+
|
40
|
+
|
41
|
+
## Development
|
42
|
+
|
43
|
+
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.
|
44
|
+
|
45
|
+
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).
|
46
|
+
|
47
|
+
## Contributing
|
48
|
+
|
49
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/agakesik/aga_palindrome.
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'lib/aga_palindrome/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "aga_palindrome"
|
5
|
+
spec.version = AgaPalindrome::VERSION
|
6
|
+
spec.authors = ["Aga"]
|
7
|
+
spec.email = ["aga.k396@gmail.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{Palindrome detector}
|
10
|
+
spec.description = %q{Simple program to detect palindroms from Learn Enough Ruby course}
|
11
|
+
spec.homepage = "https://github.com/agakesik/aga-palindrome"
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the
|
15
|
+
# 'allowed_push_host'
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to
|
17
|
+
# any host.
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/agakesik/aga-palindrome"
|
22
|
+
spec.metadata["changelog_uri"] = "https://github.com/agakesik/aga-palindrome/blob/master/CHANGELOG.md"
|
23
|
+
|
24
|
+
# Specify which files should be added to the gem when it is released.
|
25
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
27
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "aga_palindrome"
|
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__)
|
data/bin/setup
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "aga_palindrome/version"
|
2
|
+
|
3
|
+
class String
|
4
|
+
|
5
|
+
# Returns true for a palindrome, false otherwise.
|
6
|
+
def palindrome?
|
7
|
+
processed_content == processed_content.reverse
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# Returns content for palindrome testing.
|
13
|
+
def processed_content
|
14
|
+
scan(/[a-z]/i).join.downcase
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aga_palindrome
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Aga
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Simple program to detect palindroms from Learn Enough Ruby course
|
14
|
+
email:
|
15
|
+
- aga.k396@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".gitignore"
|
21
|
+
- ".travis.yml"
|
22
|
+
- CHANGELOG.md
|
23
|
+
- Gemfile
|
24
|
+
- Gemfile.lock
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- aga_palindrome.gemspec
|
28
|
+
- bin/console
|
29
|
+
- bin/setup
|
30
|
+
- lib/aga_palindrome.rb
|
31
|
+
- lib/aga_palindrome/version.rb
|
32
|
+
homepage: https://github.com/agakesik/aga-palindrome
|
33
|
+
licenses: []
|
34
|
+
metadata:
|
35
|
+
allowed_push_host: https://rubygems.org
|
36
|
+
homepage_uri: https://github.com/agakesik/aga-palindrome
|
37
|
+
source_code_uri: https://github.com/agakesik/aga-palindrome
|
38
|
+
changelog_uri: https://github.com/agakesik/aga-palindrome/blob/master/CHANGELOG.md
|
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.3
|
55
|
+
signing_key:
|
56
|
+
specification_version: 4
|
57
|
+
summary: Palindrome detector
|
58
|
+
test_files: []
|