little_table 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/little_table.rb +4 -1
- data/little_table.gemspec +2 -2
- data/spec/app_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +2 -3
- data/lib/little_table/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69aff402a45d794216ce4172772b8e8f21e0526a
|
4
|
+
data.tar.gz: 2ab7679c309d3e0287c155b39b5eb6146f82b9c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79a9f68848ba5283f8052636610fd48104daf817234db640413d742f538354fdd422d46e5a6b9b233fd9d37fa7fd0b68263887a517bad921b21922ef13f9d780
|
7
|
+
data.tar.gz: 71efe35450e5298f518f2571e85cd2670c22d7c10d678fe446a7bebae5adcb0c32da7a5c634ca41b95f3e347a7b7ce714e8e6cad6ad821a9bbb3eeecb40de151
|
data/lib/little_table.rb
CHANGED
@@ -2,6 +2,8 @@ require 'active_support/all'
|
|
2
2
|
|
3
3
|
class LittleTable
|
4
4
|
|
5
|
+
VERSION = "1.0.1"
|
6
|
+
|
5
7
|
def initialize input
|
6
8
|
@table_string = input
|
7
9
|
end
|
@@ -22,7 +24,7 @@ class LittleTable
|
|
22
24
|
result = []
|
23
25
|
rows.each do |row|
|
24
26
|
row_hash = {}
|
25
|
-
headers.each_with_index do |header,index|
|
27
|
+
headers.each_with_index do |header, index|
|
26
28
|
row_hash[header.parameterize('_').to_sym] = row[index]
|
27
29
|
end
|
28
30
|
result.push row_hash
|
@@ -39,4 +41,5 @@ class LittleTable
|
|
39
41
|
def parse_line text
|
40
42
|
text.split('|').reject { |i| !i.present? }.map { |value| value.squish }
|
41
43
|
end
|
44
|
+
|
42
45
|
end
|
data/little_table.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'little_table
|
4
|
+
require 'little_table'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "little_table"
|
8
8
|
spec.version = LittleTable::VERSION
|
9
9
|
spec.authors = ["Jankees van Woezik"]
|
10
10
|
spec.email = ["jankees@base42.nl"]
|
11
|
-
spec.description = %q{Little Tabel converts cucumber like tables to
|
11
|
+
spec.description = %q{Little Tabel converts cucumber like tables to useful objects}
|
12
12
|
spec.summary = %q{Convert your tables to objects}
|
13
13
|
spec.homepage = "http://rubygems.org/gems/little_table"
|
14
14
|
spec.license = "MIT"
|
data/spec/app_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: little_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jankees van Woezik
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description: Little Tabel converts cucumber like tables to
|
69
|
+
description: Little Tabel converts cucumber like tables to useful objects
|
70
70
|
email:
|
71
71
|
- jankees@base42.nl
|
72
72
|
executables: []
|
@@ -79,7 +79,6 @@ files:
|
|
79
79
|
- README.md
|
80
80
|
- Rakefile
|
81
81
|
- lib/little_table.rb
|
82
|
-
- lib/little_table/version.rb
|
83
82
|
- little_table.gemspec
|
84
83
|
- spec/app_spec.rb
|
85
84
|
- spec/spec_helper.rb
|
data/lib/little_table/version.rb
DELETED