tracinho 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e961631db8d45f2c530ff9a9eb15195a8798be09d3a93fffc836bf31a5af852b
4
- data.tar.gz: fc10c5f73b8299cf34675a14150301135ce985495a65b1efcdff59d21f7bac63
3
+ metadata.gz: 05d53905d331c7f2432c585ec35d383f765c8fe0934350614badca6fa434b746
4
+ data.tar.gz: 0575660c51075710cd2eba36262cb4e2026e5701370b1e0ec98e0adaa34fd72f
5
5
  SHA512:
6
- metadata.gz: 0e241e4f19f523688c9198e6d1351ab1f06bf2ee206c94ba585e0445267b939a11d336761821c7702efd7db4a9daf6b95fd54182e409f44da23aee658070310f
7
- data.tar.gz: 6d616b468b8ccbe0c5ba589d0c8b740e8d6f9bc308adda1b24c01b474d7d4a8516cf7d8ff8b3f7255c50863b797b90f4df78c42823a3aed75cb65c4844a2734c
6
+ metadata.gz: 4757ce4cd655205c8525b35a993fcb76775bfc184098714402f115ccfa0f4832601444539a1474fa4a5551166ba0ae55ed439b1138d9d5a65c3e94727d31a901
7
+ data.tar.gz: 79a15a4fc3f47ad6b7012bd21ab6de1ded9023b90ad1628b196ad50fb7c29cdab579b12f95c6ac407ccabdd8bcc90d7ec04c643237380c78a677cb2c7cd9fb21
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tracinho (0.1.3)
4
+ tracinho (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,5 +3,5 @@
3
3
  # This gem converts words with dash in the version without it and vice-versa. It also gets the verb
4
4
  # name from a word and gives the full grammar classification of the verb.
5
5
  module Tracinho
6
- VERSION = '0.1.3'
6
+ VERSION = '0.1.4'
7
7
  end
data/lib/tracinho.rb CHANGED
@@ -15,6 +15,9 @@ module Tracinho
15
15
  # Tracinho.pair?(w1, w2)
16
16
  # # => true
17
17
  def self.pair?(word1, word2)
18
+ word1 = Word.new(word1) unless word1.is_a?(Word)
19
+ word2 = Word.new(word2) unless word2.is_a?(Word)
20
+
18
21
  word1.complement.to_s == word2.to_s
19
22
  end
20
23
 
@@ -18,6 +18,16 @@ describe Tracinho do
18
18
  expect(described_class.pair?(w2, w1)).to be_falsey
19
19
  end
20
20
 
21
+ it 'works with strings or Tracinho::Word objects' do
22
+ w1 = Tracinho::Word.new('fizeste')
23
+ w2 = 'fizes-te'
24
+ w3 = 'fizeste'
25
+ w4 = Tracinho::Word.new('fizes-te')
26
+
27
+ expect(described_class.pair?(w1, w2)).to be_truthy
28
+ expect(described_class.pair?(w4, w3)).to be_truthy
29
+ end
30
+
21
31
  it 'has an alias `complementary?`' do
22
32
  w1 = Tracinho::Word.new('fizeste')
23
33
  w2 = Tracinho::Word.new('fizes-te')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracinho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero