mortadella 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: ae0012a5242c88790aea017c81474f2fce788eb0
4
- data.tar.gz: 33ffd2a65deb404f4302e600a38c0dfbcbd6f352
3
+ metadata.gz: eb8bdd8a5aedb635ad31ac79f1283b335491f158
4
+ data.tar.gz: 59cf40921a424abb24d38961942e09ed1175704f
5
5
  SHA512:
6
- metadata.gz: 8517edb5e36f6b6c417f0f579b81502421366b0f9c6211e258200540911a0c0d250453e8298b2d6df4e89a2bf93b0d91ab3eead42f6ad19ba68ed18f7c2b171d
7
- data.tar.gz: a8005063a0951e3c1b8d5fdd0a82673763697b48e51bf61dbfdf67e36f83ca096e369d56fcc35a6525271f544976f4c7ba77a96a63c4f630765270c58497e60e
6
+ metadata.gz: d70e92927b5c8bf5bcb5655f6e3746eeadeb64edd66be76c609606b0ef1df57205ca34fb6ba126564294748e6f64e79abda742899bfdae19871870c50e04d96d
7
+ data.tar.gz: 899a13f1a4969a07caf16023c86a0a6254dbf7193fb600f216178afb341b11d5b7629d0b97e6017afe98b2bba70d0003d81e057c5bf9fdcbebf6b7e6c6646979
data/.rubocop.yml CHANGED
@@ -16,6 +16,9 @@ Metrics/LineLength:
16
16
  Max: 100
17
17
 
18
18
 
19
+ Style/AccessModifierIndentation:
20
+ EnforcedStyle: outdent
21
+
19
22
  Style/EmptyLines:
20
23
  Enabled: false
21
24
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mortadella (0.2.1)
4
+ mortadella (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -28,26 +28,28 @@ GEM
28
28
  powerpack (0.1.1)
29
29
  rainbow (2.0.0)
30
30
  rake (10.4.2)
31
- rspec (3.3.0)
32
- rspec-core (~> 3.3.0)
33
- rspec-expectations (~> 3.3.0)
34
- rspec-mocks (~> 3.3.0)
35
- rspec-core (3.3.2)
36
- rspec-support (~> 3.3.0)
37
- rspec-expectations (3.3.1)
31
+ rspec (3.4.0)
32
+ rspec-core (~> 3.4.0)
33
+ rspec-expectations (~> 3.4.0)
34
+ rspec-mocks (~> 3.4.0)
35
+ rspec-core (3.4.1)
36
+ rspec-support (~> 3.4.0)
37
+ rspec-expectations (3.4.0)
38
38
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.3.0)
40
- rspec-mocks (3.3.2)
39
+ rspec-support (~> 3.4.0)
40
+ rspec-mocks (3.4.0)
41
41
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.3.0)
43
- rspec-support (3.3.0)
44
- rubocop (0.34.2)
42
+ rspec-support (~> 3.4.0)
43
+ rspec-support (3.4.1)
44
+ rubocop (0.35.1)
45
45
  astrolabe (~> 1.3)
46
- parser (>= 2.2.2.5, < 3.0)
46
+ parser (>= 2.2.3.0, < 3.0)
47
47
  powerpack (~> 0.1)
48
48
  rainbow (>= 1.99.1, < 3.0)
49
- ruby-progressbar (~> 1.4)
49
+ ruby-progressbar (~> 1.7)
50
+ tins (<= 1.6.0)
50
51
  ruby-progressbar (1.7.5)
52
+ tins (1.6.0)
51
53
 
52
54
  PLATFORMS
53
55
  ruby
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Delicious Mock Ruby Tables
2
2
 
3
3
  [![Build Status](https://circleci.com/gh/Originate/mortadella/tree/master.svg?style=shield)](https://circleci.com/gh/Originate/mortadella)
4
+ [![Code Climate](https://codeclimate.com/github/Originate/mortadella/badges/gpa.svg)](https://codeclimate.com/github/Originate/mortadella)
4
5
  [![Dependency Status](https://gemnasium.com/Originate/mortadella.svg)](https://gemnasium.com/Originate/mortadella)
5
6
  [![License](http://img.shields.io/:license-MIT-blue.svg?style=flat)](LICENSE.txt)
6
7
 
@@ -26,6 +26,21 @@ module Mortadella
26
26
  end
27
27
 
28
28
 
29
+ def empty?
30
+ @table.size == 1
31
+ end
32
+
33
+
34
+
35
+ private
36
+
37
+
38
+ # Returns whether the column with the given name can be dried up
39
+ def can_dry? column_name
40
+ @dry.include? column_name
41
+ end
42
+
43
+
29
44
  # Returns a dried up version of the given row
30
45
  # based on the row that came before in the table
31
46
  #
@@ -33,22 +48,18 @@ module Mortadella
33
48
  # stopping on the first difference
34
49
  def dry_up row
35
50
  return row unless @previous_row
36
- result = row.clone
37
- @previous_row.each_with_index do |previous_value, i|
38
- if @dry.include?(@headers[i]) && row[i] == previous_value
39
- result[i] = ''
40
- else
41
- break
51
+ row.clone.tap do |result|
52
+ row.length.times do |i|
53
+ if can_dry?(@headers[i]) && row[i] == @previous_row[i]
54
+ result[i] = ''
55
+ else
56
+ break
57
+ end
42
58
  end
43
59
  end
44
- result
45
60
  end
46
61
 
47
62
 
48
- def empty?
49
- @table.size == 1
50
- end
51
-
52
63
  end
53
64
 
54
65
  end
data/mortadella.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'mortadella'
7
- s.version = '0.2.1'
7
+ s.version = '0.2.2'
8
8
  s.authors = ['Kevin Goslar']
9
9
  s.email = ['kevin.goslar@gmail.com']
10
10
  s.summary = %s(Mock Ruby Table Delivery)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mortadella
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Goslar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-18 00:00:00.000000000 Z
11
+ date: 2015-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler