excelinator 1.3.0 → 1.3.1
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 +7 -0
- data/README.md +18 -1
- data/lib/excelinator/version.rb +1 -1
- data/lib/excelinator/xls.rb +5 -5
- metadata +15 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fd8397db273de0310bc2b9fa4d89e4e2858695eb
|
4
|
+
data.tar.gz: 49826c6f00f0e8b399719a238dac0c7ebce8eb46
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8eb57fb30f1f891a99ca013048719193e0cf7f1c8839fb2f4200b596699f70385a2491b1886f5637ec9b828af6c59d12e369313e85d68eca3365f07853e918b6
|
7
|
+
data.tar.gz: d200dc7a79ffe553d85d95fcf189fc155b10da57ea56ce348106011e9d814bed8befed080fd55c62335bb113c8eba887a12ca3a72e34eb53086cf13220b483da
|
data/README.md
CHANGED
@@ -34,6 +34,10 @@ memory, call `Excelinator.csv_to_xls_file(csv_path, file)`, passing the path to
|
|
34
34
|
the CSV file and a path to the .xls file you'd like the workbook saved to.
|
35
35
|
(contributed by [maxwell](https://github.com/maxwell))
|
36
36
|
|
37
|
+
If you want the CSV Data not to be separated by ',' (as it is by default) you can call
|
38
|
+
`Excelinator.csv_to_xls_file(csv_path, file, ";")` or
|
39
|
+
`Excelinator.csv_to_xls(csv_content, ";")` or with any other separator char.
|
40
|
+
|
37
41
|
###HTML
|
38
42
|
|
39
43
|
Call `Excelinator.html_as_xls(html_content)`. The table element from the HTML
|
@@ -154,6 +158,19 @@ code.
|
|
154
158
|
|
155
159
|
CHANGELOG
|
156
160
|
---------
|
157
|
-
####1.1
|
161
|
+
#### 1.3.1
|
162
|
+
|
163
|
+
Merged PRs (effectively and actually) from ikusei and maxwell to remove the versioning on
|
164
|
+
the dependent `spreadsheet` gem and allow for a custom separator.
|
165
|
+
|
166
|
+
#### 1.3.0
|
167
|
+
|
168
|
+
Added `csv_to_xls_file(csv_path, file)` (contributed by [maxwell](https://github.com/maxwell))
|
169
|
+
|
170
|
+
#### 1.2.0
|
171
|
+
|
172
|
+
Ruby 2 support
|
173
|
+
|
174
|
+
#### 1.1.0
|
158
175
|
|
159
176
|
Added Ruby 1.9 support.
|
data/lib/excelinator/version.rb
CHANGED
data/lib/excelinator/xls.rb
CHANGED
@@ -7,8 +7,8 @@ module Excelinator
|
|
7
7
|
content =~ /<table/ ? Excelinator.html_as_xls(content) : Excelinator.csv_to_xls(content)
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.csv_to_xls(csv_content)
|
11
|
-
ary = (!old_ruby? ? CSV : FasterCSV).parse(csv_content)
|
10
|
+
def self.csv_to_xls(csv_content, separator=",")
|
11
|
+
ary = (!old_ruby? ? CSV : FasterCSV).parse(csv_content, { :col_sep => separator} )
|
12
12
|
|
13
13
|
book = Spreadsheet::Workbook.new
|
14
14
|
sheet = book.create_worksheet
|
@@ -23,11 +23,11 @@ def self.csv_to_xls(csv_content)
|
|
23
23
|
end
|
24
24
|
|
25
25
|
#memory ftw
|
26
|
-
def self.csv_to_xls_file(csv_path, file)
|
26
|
+
def self.csv_to_xls_file(csv_path, file, separator=",")
|
27
27
|
book = Spreadsheet::Workbook.new
|
28
28
|
sheet = book.create_worksheet
|
29
|
-
|
30
|
-
CSV.open(csv_path) do |csv|
|
29
|
+
|
30
|
+
CSV.open(csv_path, { :col_sep => separator} ) do |csv|
|
31
31
|
index = 0
|
32
32
|
csv.each do |raw_row|
|
33
33
|
row = sheet.row(index)
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excelinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- chrismo
|
@@ -10,54 +9,48 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2016-01-12 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: spreadsheet
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - ">="
|
21
19
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0
|
20
|
+
version: '0'
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - ">="
|
29
26
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0
|
27
|
+
version: '0'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rake
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - ">="
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - ">="
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: rspec
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- -
|
46
|
+
- - ">="
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: '0'
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- -
|
53
|
+
- - ">="
|
61
54
|
- !ruby/object:Gem::Version
|
62
55
|
version: '0'
|
63
56
|
description: convert your csv data and html tables to excel data
|
@@ -75,32 +68,25 @@ files:
|
|
75
68
|
- lib/excelinator/xls.rb
|
76
69
|
homepage: https://github.com/livingsocial/excelinator
|
77
70
|
licenses: []
|
71
|
+
metadata: {}
|
78
72
|
post_install_message:
|
79
73
|
rdoc_options: []
|
80
74
|
require_paths:
|
81
75
|
- lib
|
82
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
77
|
requirements:
|
85
|
-
- -
|
78
|
+
- - ">="
|
86
79
|
- !ruby/object:Gem::Version
|
87
80
|
version: '0'
|
88
|
-
segments:
|
89
|
-
- 0
|
90
|
-
hash: 2637605060163655214
|
91
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
82
|
requirements:
|
94
|
-
- -
|
83
|
+
- - ">="
|
95
84
|
- !ruby/object:Gem::Version
|
96
85
|
version: '0'
|
97
|
-
segments:
|
98
|
-
- 0
|
99
|
-
hash: 2637605060163655214
|
100
86
|
requirements: []
|
101
87
|
rubyforge_project:
|
102
|
-
rubygems_version:
|
88
|
+
rubygems_version: 2.4.8
|
103
89
|
signing_key:
|
104
|
-
specification_version:
|
90
|
+
specification_version: 4
|
105
91
|
summary: Excel Converter
|
106
92
|
test_files: []
|