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 +4 -4
- data/.rubocop.yml +3 -0
- data/Gemfile.lock +17 -15
- data/README.md +1 -0
- data/lib/mortadella/horizontal.rb +22 -11
- data/mortadella.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb8bdd8a5aedb635ad31ac79f1283b335491f158
|
4
|
+
data.tar.gz: 59cf40921a424abb24d38961942e09ed1175704f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d70e92927b5c8bf5bcb5655f6e3746eeadeb64edd66be76c609606b0ef1df57205ca34fb6ba126564294748e6f64e79abda742899bfdae19871870c50e04d96d
|
7
|
+
data.tar.gz: 899a13f1a4969a07caf16023c86a0a6254dbf7193fb600f216178afb341b11d5b7629d0b97e6017afe98b2bba70d0003d81e057c5bf9fdcbebf6b7e6c6646979
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mortadella (0.2.
|
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.
|
32
|
-
rspec-core (~> 3.
|
33
|
-
rspec-expectations (~> 3.
|
34
|
-
rspec-mocks (~> 3.
|
35
|
-
rspec-core (3.
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-expectations (3.
|
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.
|
40
|
-
rspec-mocks (3.
|
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.
|
43
|
-
rspec-support (3.
|
44
|
-
rubocop (0.
|
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.
|
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.
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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.
|
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.
|
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-
|
11
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|