tracinho 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6ac4ff2efca57bb861585d8e88b14959e4b743d9
4
- data.tar.gz: e470af0a0a0ea736f115612e68856154b547e7f6
2
+ SHA256:
3
+ metadata.gz: e961631db8d45f2c530ff9a9eb15195a8798be09d3a93fffc836bf31a5af852b
4
+ data.tar.gz: fc10c5f73b8299cf34675a14150301135ce985495a65b1efcdff59d21f7bac63
5
5
  SHA512:
6
- metadata.gz: ca4ce4573245f60ae3eda72dfac119472af947c6d3458514685dc1efeccd50f140d6a0d495a56a2d5bcb50801d71184cd620ef78617d6456727e36b4a27af845
7
- data.tar.gz: 61531fd654f16be289f7d2ece845cacd77552602174eeb8052083621a604fb9712dc7c22e275615aa796b3ed47cfd342966a2462903db82c8a43ba652fe81808
6
+ metadata.gz: 0e241e4f19f523688c9198e6d1351ab1f06bf2ee206c94ba585e0445267b939a11d336761821c7702efd7db4a9daf6b95fd54182e409f44da23aee658070310f
7
+ data.tar.gz: 6d616b468b8ccbe0c5ba589d0c8b740e8d6f9bc308adda1b24c01b474d7d4a8516cf7d8ff8b3f7255c50863b797b90f4df78c42823a3aed75cb65c4844a2734c
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format documentation
2
2
  --color
3
+ --require spec_helper.rb
data/.rubocop.yml CHANGED
@@ -13,3 +13,7 @@ Metrics/MethodLength:
13
13
  Metrics/BlockLength:
14
14
  Exclude:
15
15
  - 'spec/**'
16
+
17
+ # We want to support older versions of ruby
18
+ Style/ExpandPathArguments:
19
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.4.2
4
+ - 2.5.0
4
5
  script: bundle exec rspec
5
6
  sudo: false
data/Gemfile.lock CHANGED
@@ -1,36 +1,35 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tracinho (0.1.2)
4
+ tracinho (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.3.0)
10
- byebug (9.1.0)
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.5)
13
+ docile (1.3.1)
14
14
  json (2.1.0)
15
15
  method_source (0.9.0)
16
- parallel (1.12.0)
17
- parser (2.4.0.0)
18
- ast (~> 2.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.2)
20
+ pry (0.11.3)
21
21
  coderay (~> 1.1.0)
22
22
  method_source (~> 0.9.0)
23
- pry-byebug (3.5.0)
24
- byebug (~> 9.1)
23
+ pry-byebug (3.6.0)
24
+ byebug (~> 10.0)
25
25
  pry (~> 0.10)
26
- rainbow (2.2.2)
27
- rake
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.0)
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.0)
42
- rubocop (0.51.0)
40
+ rspec-support (3.7.1)
41
+ rubocop (0.56.0)
43
42
  parallel (~> 1.10)
44
- parser (>= 2.3.3.1, < 3.0)
43
+ parser (>= 2.5)
45
44
  powerpack (~> 0.1)
46
- rainbow (>= 2.2.2, < 3.0)
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.15.1)
51
- docile (~> 1.1.0)
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.0)
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.15.4
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) [![Dependency Status](https://gemnasium.com/rikas/tracinho.svg)](https://gemnasium.com/rikas/tracinho) [![Code Climate](https://codeclimate.com/github/rikas/tracinho/badges/gpa.svg)](https://codeclimate.com/github/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
  ========
@@ -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.2'
6
+ VERSION = '0.1.3'
7
7
  end
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
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
4
-
5
3
  describe ComplementBuilder do
6
4
  let(:hyphenated) { %w[passa-mos cala-te matas-te conhecer-te morde-mos mata-te] }
7
5
  let(:not_hyphenated) { %w[passamos calate mataste conhecerte mordemos matate] }
@@ -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
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
4
-
5
3
  describe WordClassifier do
6
4
  describe 'verb' do
7
5
  let(:regular_words) do
data/spec/word_spec.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
4
-
5
3
  describe Word do
6
4
  let(:hyphenated) { %w[passa-mos cala-te matas-te conhecer-te morde-mos mata-te] }
7
5
  let(:not_hyphenated) { %w[passamos calate mataste conhecerte mordemos matate] }
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.2
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: 2017-10-22 00:00:00.000000000 Z
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.6.13
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