tracinho 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rspec +1 -0
- data/.rubocop.yml +4 -0
- data/.travis.yml +1 -0
- data/Gemfile.lock +21 -22
- data/README.md +2 -1
- data/lib/tracinho/version.rb +1 -1
- data/lib/tracinho.rb +18 -0
- data/spec/complement_builder_spec.rb +0 -2
- data/spec/tracinho_spec.rb +29 -0
- data/spec/word_classifier_spec.rb +0 -2
- data/spec/word_spec.rb +0 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e961631db8d45f2c530ff9a9eb15195a8798be09d3a93fffc836bf31a5af852b
|
4
|
+
data.tar.gz: fc10c5f73b8299cf34675a14150301135ce985495a65b1efcdff59d21f7bac63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e241e4f19f523688c9198e6d1351ab1f06bf2ee206c94ba585e0445267b939a11d336761821c7702efd7db4a9daf6b95fd54182e409f44da23aee658070310f
|
7
|
+
data.tar.gz: 6d616b468b8ccbe0c5ba589d0c8b740e8d6f9bc308adda1b24c01b474d7d4a8516cf7d8ff8b3f7255c50863b797b90f4df78c42823a3aed75cb65c4844a2734c
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,36 +1,35 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tracinho (0.1.
|
4
|
+
tracinho (0.1.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.
|
10
|
-
byebug (
|
9
|
+
ast (2.4.0)
|
10
|
+
byebug (10.0.2)
|
11
11
|
coderay (1.1.2)
|
12
12
|
diff-lcs (1.3)
|
13
|
-
docile (1.1
|
13
|
+
docile (1.3.1)
|
14
14
|
json (2.1.0)
|
15
15
|
method_source (0.9.0)
|
16
|
-
parallel (1.12.
|
17
|
-
parser (2.
|
18
|
-
ast (~> 2.
|
16
|
+
parallel (1.12.1)
|
17
|
+
parser (2.5.1.0)
|
18
|
+
ast (~> 2.4.0)
|
19
19
|
powerpack (0.1.1)
|
20
|
-
pry (0.11.
|
20
|
+
pry (0.11.3)
|
21
21
|
coderay (~> 1.1.0)
|
22
22
|
method_source (~> 0.9.0)
|
23
|
-
pry-byebug (3.
|
24
|
-
byebug (~>
|
23
|
+
pry-byebug (3.6.0)
|
24
|
+
byebug (~> 10.0)
|
25
25
|
pry (~> 0.10)
|
26
|
-
rainbow (
|
27
|
-
|
28
|
-
rake (12.1.0)
|
26
|
+
rainbow (3.0.0)
|
27
|
+
rake (12.3.1)
|
29
28
|
rspec (3.7.0)
|
30
29
|
rspec-core (~> 3.7.0)
|
31
30
|
rspec-expectations (~> 3.7.0)
|
32
31
|
rspec-mocks (~> 3.7.0)
|
33
|
-
rspec-core (3.7.
|
32
|
+
rspec-core (3.7.1)
|
34
33
|
rspec-support (~> 3.7.0)
|
35
34
|
rspec-expectations (3.7.0)
|
36
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -38,21 +37,21 @@ GEM
|
|
38
37
|
rspec-mocks (3.7.0)
|
39
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
39
|
rspec-support (~> 3.7.0)
|
41
|
-
rspec-support (3.7.
|
42
|
-
rubocop (0.
|
40
|
+
rspec-support (3.7.1)
|
41
|
+
rubocop (0.56.0)
|
43
42
|
parallel (~> 1.10)
|
44
|
-
parser (>= 2.
|
43
|
+
parser (>= 2.5)
|
45
44
|
powerpack (~> 0.1)
|
46
|
-
rainbow (>= 2.2.2, <
|
45
|
+
rainbow (>= 2.2.2, < 4.0)
|
47
46
|
ruby-progressbar (~> 1.7)
|
48
47
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
49
48
|
ruby-progressbar (1.9.0)
|
50
|
-
simplecov (0.
|
51
|
-
docile (~> 1.1
|
49
|
+
simplecov (0.16.1)
|
50
|
+
docile (~> 1.1)
|
52
51
|
json (>= 1.8, < 3)
|
53
52
|
simplecov-html (~> 0.10.0)
|
54
53
|
simplecov-html (0.10.2)
|
55
|
-
unicode-display_width (1.3.
|
54
|
+
unicode-display_width (1.3.3)
|
56
55
|
|
57
56
|
PLATFORMS
|
58
57
|
ruby
|
@@ -67,4 +66,4 @@ DEPENDENCIES
|
|
67
66
|
tracinho!
|
68
67
|
|
69
68
|
BUNDLED WITH
|
70
|
-
1.
|
69
|
+
1.16.1
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/rikas/tracinho.svg)](https://travis-ci.org/rikas/tracinho)
|
1
|
+
[![Build Status](https://travis-ci.org/rikas/tracinho.svg)](https://travis-ci.org/rikas/tracinho)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/rikas/tracinho/badges/gpa.svg)](https://codeclimate.com/github/rikas/tracinho)
|
2
3
|
|
3
4
|
tracinho
|
4
5
|
========
|
data/lib/tracinho/version.rb
CHANGED
data/lib/tracinho.rb
CHANGED
@@ -4,3 +4,21 @@ require 'tracinho/version'
|
|
4
4
|
require 'tracinho/complement_builder'
|
5
5
|
require 'tracinho/word'
|
6
6
|
require 'tracinho/word_classifier'
|
7
|
+
|
8
|
+
# Main module
|
9
|
+
module Tracinho
|
10
|
+
# Returns true if one word is the complement of the other.
|
11
|
+
#
|
12
|
+
# w1 = Word.new('fizeste')
|
13
|
+
# w2 = Word.new('fizes-te')
|
14
|
+
#
|
15
|
+
# Tracinho.pair?(w1, w2)
|
16
|
+
# # => true
|
17
|
+
def self.pair?(word1, word2)
|
18
|
+
word1.complement.to_s == word2.to_s
|
19
|
+
end
|
20
|
+
|
21
|
+
class << self
|
22
|
+
alias complementary? pair?
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe Tracinho do
|
4
|
+
describe '.pair?' do
|
5
|
+
it 'returns true if the two words are complementary' do
|
6
|
+
w1 = Tracinho::Word.new('fizeste')
|
7
|
+
w2 = Tracinho::Word.new('fizes-te')
|
8
|
+
|
9
|
+
expect(described_class.pair?(w1, w2)).to be_truthy
|
10
|
+
expect(described_class.pair?(w2, w1)).to be_truthy
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns false if the two words are not complementary' do
|
14
|
+
w1 = Tracinho::Word.new('fizeste')
|
15
|
+
w2 = Tracinho::Word.new('fizeste')
|
16
|
+
|
17
|
+
expect(described_class.pair?(w1, w2)).to be_falsey
|
18
|
+
expect(described_class.pair?(w2, w1)).to be_falsey
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'has an alias `complementary?`' do
|
22
|
+
w1 = Tracinho::Word.new('fizeste')
|
23
|
+
w2 = Tracinho::Word.new('fizes-te')
|
24
|
+
|
25
|
+
expect(described_class.complementary?(w1, w2)).to be_truthy
|
26
|
+
expect(described_class.complementary?(w2, w1)).to be_truthy
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/spec/word_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracinho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Otero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/tracinho/word_classifier.rb
|
123
123
|
- spec/complement_builder_spec.rb
|
124
124
|
- spec/spec_helper.rb
|
125
|
+
- spec/tracinho_spec.rb
|
125
126
|
- spec/word_classifier_spec.rb
|
126
127
|
- spec/word_spec.rb
|
127
128
|
- tracinho.gemspec
|
@@ -145,12 +146,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
146
|
version: '0'
|
146
147
|
requirements: []
|
147
148
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.
|
149
|
+
rubygems_version: 2.7.3
|
149
150
|
signing_key:
|
150
151
|
specification_version: 4
|
151
152
|
summary: Tracinho.com gem.
|
152
153
|
test_files:
|
153
154
|
- spec/complement_builder_spec.rb
|
154
155
|
- spec/spec_helper.rb
|
156
|
+
- spec/tracinho_spec.rb
|
155
157
|
- spec/word_classifier_spec.rb
|
156
158
|
- spec/word_spec.rb
|