palindrome-slzr 0.1.0 → 0.1.2
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 +4 -4
- data/bin/palindromo +7 -10
- data/lib/palindromo.rb +2 -0
- data/lib/palindromo/version.rb +1 -1
- data/palindromo.gemspec +2 -3
- metadata +2 -4
- data/spec/palindromo_spec.rb +0 -31
- data/spec/spec_helper.rb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f477182c25e881640febb56fe7e74ce7d87d0fa
|
4
|
+
data.tar.gz: 71f6923c154cc69144ca7e0a3fbcddde883c04c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1aa28516c3b72da0602edb8c3933d48403f5e12625599bdbc2536e29d33cfa64f507c856ab0e70159895e6dbbb77ff8a4126ef85a5a66196b0caad55cfdb590
|
7
|
+
data.tar.gz: a029d2d43d1625d19380b5cc3a076b52c2470010d75ab8e77284ff62953cee0258e179be343e222421857efbc740e0d405c79016a46a9f11a01840771d4c440b
|
data/bin/palindromo
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'Palindromo'
|
4
4
|
|
5
5
|
class Checker
|
6
|
-
def
|
7
|
-
|
8
|
-
word = gets.chomp
|
9
|
-
if word == word.reverse
|
10
|
-
puts "Sí es un palíndromo"
|
11
|
-
else
|
12
|
-
puts "No es un palíndromo"
|
13
|
-
end
|
6
|
+
def capture(string)
|
7
|
+
string == string.reverse
|
14
8
|
end
|
15
9
|
end
|
16
10
|
|
17
|
-
Checker.
|
11
|
+
checker = Checker.new
|
12
|
+
|
13
|
+
print "Palabra: "
|
14
|
+
checker.capture(gets.chomp)
|
data/lib/palindromo.rb
CHANGED
data/lib/palindromo/version.rb
CHANGED
data/palindromo.gemspec
CHANGED
@@ -10,12 +10,11 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["h.salazar.olivares@accenture.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Determines if a word is or isn't a palindrome}
|
13
|
-
spec.description = %q{
|
13
|
+
spec.description = %q{Determines if a word is or isn't a palindrome.}
|
14
14
|
spec.homepage = "https://github.com/hslzr"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
|
18
|
-
spec.files = `git ls-files`.split($\)
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
18
|
spec.executables = ["palindromo"]
|
20
19
|
spec.require_paths = ["lib"]
|
21
20
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: palindrome-slzr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Héctor Salazar
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
description:
|
55
|
+
description: Determines if a word is or isn't a palindrome.
|
56
56
|
email:
|
57
57
|
- h.salazar.olivares@accenture.com
|
58
58
|
executables:
|
@@ -73,8 +73,6 @@ files:
|
|
73
73
|
- lib/palindromo.rb
|
74
74
|
- lib/palindromo/version.rb
|
75
75
|
- palindromo.gemspec
|
76
|
-
- spec/palindromo_spec.rb
|
77
|
-
- spec/spec_helper.rb
|
78
76
|
- tasks/rspec.rake
|
79
77
|
homepage: https://github.com/hslzr
|
80
78
|
licenses:
|
data/spec/palindromo_spec.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Palindromo do
|
4
|
-
|
5
|
-
subject { Palindromo.new }
|
6
|
-
|
7
|
-
# it 'has a version number' do
|
8
|
-
# expect(Palindromo::VERSION).not_to be nil
|
9
|
-
# end
|
10
|
-
|
11
|
-
describe '#process' do
|
12
|
-
|
13
|
-
let(:ana) { "ana" }
|
14
|
-
let(:tom) { "tom" }
|
15
|
-
|
16
|
-
|
17
|
-
it 'verifies word is a string' do
|
18
|
-
expect(ana).to be_a String
|
19
|
-
expect(tom).to be_a String
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'verifies ana is a palindrome' do
|
23
|
-
expect(ana.reverse).to eq "ana"
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'verifies tom is not a palindrome' do
|
27
|
-
expect(tom.reverse).not_to eq "tom"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
data/spec/spec_helper.rb
DELETED