amp_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/.idea/.gitignore +2 -0
- data/.idea/amp_palindrome.iml +22 -0
- data/.idea/inspectionProfiles/Project_Default.xml +6 -0
- data/.idea/misc.xml +7 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/.rakeTasks +7 -0
- data/.travis.yml +6 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +30 -0
- data/README.md +36 -0
- data/Rakefile +10 -0
- data/amp_palindrome.gemspec +28 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/amp_palindrome.rb +20 -0
- data/lib/amp_palindrome/version.rb +3 -0
- metadata +64 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1bfe42861395492295758ecb61f266a4b9d3159c5f36f3794e802e1845f9e4cd
|
4
|
+
data.tar.gz: 192ee1c338e7aece25fc7b192c6393905814d7eb401b41511992228f540b812c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 13d7528b6d513de36cb06228af5a359d03da3ac81dc65aa8414fde0dcd0ecea5754707253ae0714bb0c3336d74e944c55278e553b339c218b598c1ad5f77c1ff
|
7
|
+
data.tar.gz: 51bc8a751649b56cc5c34d2773378d7ecbf10743e0de4b5987444f3b5239947cf3d66a3f295f4ffa062f6ae8abc84d7c25b46672d9565dad86686dc492e45b48
|
data/.gitignore
ADDED
data/.idea/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<shared />
|
5
|
+
</component>
|
6
|
+
<component name="NewModuleRootManager">
|
7
|
+
<content url="file://$MODULE_DIR$">
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
|
+
</content>
|
12
|
+
<orderEntry type="inheritedJdk" />
|
13
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="ansi (v1.5.0, ruby-2.6.5-p114) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="builder (v3.2.4, ruby-2.6.5-p114) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, ruby-2.6.5-p114) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.0, ruby-2.6.5-p114) [gem]" level="application" />
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="minitest-reporters (v1.2.0, ruby-2.6.5-p114) [gem]" level="application" />
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, ruby-2.6.5-p114) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.1, ruby-2.6.5-p114) [gem]" level="application" />
|
21
|
+
</component>
|
22
|
+
</module>
|
data/.idea/misc.xml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="JavaScriptSettings">
|
4
|
+
<option name="languageLevel" value="ES6" />
|
5
|
+
</component>
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.6.5-p114" project-jdk-type="RUBY_SDK" />
|
7
|
+
</project>
|
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/amp_palindrome.iml" filepath="$PROJECT_DIR$/.idea/amp_palindrome.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
data/.idea/vcs.xml
ADDED
data/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build amp_palindrome-0.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install amp_palindrome-0.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install amp_palindrome-0.1.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.0 and build and push amp_palindrome-0.1.0.gem to TODO: Set to 'http://mygemserver.com'" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run tests" fullCmd="test" taksId="test" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
amp_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
|
+
amp_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,36 @@
|
|
1
|
+
# AmpPalindrome
|
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/amp_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 'amp_palindrome'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install amp_palindrome
|
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]/amp_palindrome.
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative 'lib/amp_palindrome/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "amp_palindrome"
|
5
|
+
spec.version = AmpPalindrome::VERSION
|
6
|
+
spec.authors = ["Adam Parker"]
|
7
|
+
spec.email = ["amichaelparker@gmail.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{Palindrome detector}
|
10
|
+
spec.description = %q{Learn Enough Ruby palindrome detector}
|
11
|
+
spec.homepage = "https://github.com/amichaelparker/palindrome_gem.git"
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/amichaelparker/palindrome_gem.git"
|
18
|
+
spec.metadata["changelog_uri"] = "https://github.com/amichaelparker/palindrome_gem.git"
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "amp_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,20 @@
|
|
1
|
+
require "amp_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
|
+
def letters
|
11
|
+
self.gsub(/\W/, '')
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
# Returns content for palindrome testing.
|
17
|
+
def processed_content
|
18
|
+
self.letters.downcase
|
19
|
+
end
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: amp_palindrome
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Parker
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Learn Enough Ruby palindrome detector
|
14
|
+
email:
|
15
|
+
- amichaelparker@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".gitignore"
|
21
|
+
- ".idea/.gitignore"
|
22
|
+
- ".idea/amp_palindrome.iml"
|
23
|
+
- ".idea/inspectionProfiles/Project_Default.xml"
|
24
|
+
- ".idea/misc.xml"
|
25
|
+
- ".idea/modules.xml"
|
26
|
+
- ".idea/vcs.xml"
|
27
|
+
- ".rakeTasks"
|
28
|
+
- ".travis.yml"
|
29
|
+
- Gemfile
|
30
|
+
- Gemfile.lock
|
31
|
+
- README.md
|
32
|
+
- Rakefile
|
33
|
+
- amp_palindrome.gemspec
|
34
|
+
- bin/console
|
35
|
+
- bin/setup
|
36
|
+
- lib/amp_palindrome.rb
|
37
|
+
- lib/amp_palindrome/version.rb
|
38
|
+
homepage: https://github.com/amichaelparker/palindrome_gem.git
|
39
|
+
licenses: []
|
40
|
+
metadata:
|
41
|
+
allowed_push_host: https://rubygems.org
|
42
|
+
homepage_uri: https://github.com/amichaelparker/palindrome_gem.git
|
43
|
+
source_code_uri: https://github.com/amichaelparker/palindrome_gem.git
|
44
|
+
changelog_uri: https://github.com/amichaelparker/palindrome_gem.git
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.3.0
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubygems_version: 3.0.6
|
61
|
+
signing_key:
|
62
|
+
specification_version: 4
|
63
|
+
summary: Palindrome detector
|
64
|
+
test_files: []
|