rxl 0.1.4 → 0.2.0
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 +5 -5
- data/lib/rxl.rb +12 -0
- data/lib/rxl/version.rb +1 -1
- data/lib/worksheet.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cd17d97488a9891b7bce15f8352bd0fb4a1b5ccb030be154d20f4eeee9369c78
|
4
|
+
data.tar.gz: 7c0dc41d7cac1f81724a951d3d228af7fa76d2c4c0d76878c06d15b4e73613bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74d0cc8be8633bb2ff9bb6258a48dd5496819d6902133802af7416fcb19c691af13bd60e7b052346efc7bc9ae5566d9e39fb1593db76b89e965e897e30c42db7
|
7
|
+
data.tar.gz: 0c6f3fdbb3d88bb2f3ab73f20b9d593d9cddb693505ffd049ff40d354763a568d38bc8f97a5adf6266147aa8a79809553f0503659d792874e9ce14983116657a
|
data/lib/rxl.rb
CHANGED
@@ -23,4 +23,16 @@ module Rxl
|
|
23
23
|
Workbook.hash_workbook_to_hash_tables(hash_workbook)
|
24
24
|
end
|
25
25
|
|
26
|
+
def self.read_files(filepaths_hash, read_style = nil)
|
27
|
+
return_hash = {}
|
28
|
+
filepaths_hash.each do |key, value|
|
29
|
+
if read_style == :as_tables
|
30
|
+
return_hash[key] = read_file_as_tables(value)
|
31
|
+
else
|
32
|
+
return_hash[key] = read_file(value)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
return_hash
|
36
|
+
end
|
37
|
+
|
26
38
|
end
|
data/lib/rxl/version.rb
CHANGED
data/lib/worksheet.rb
CHANGED
@@ -74,7 +74,8 @@ module Worksheet
|
|
74
74
|
cells = Mitrush.deep_copy(raw_hash)
|
75
75
|
columns = cells.keys.map { |key| key[/\D+/] }.uniq
|
76
76
|
columns.delete_if { |item| cells["#{item}1"][:value].nil? }
|
77
|
-
row_nums = cells.keys.map { |key| key[/\d+/].to_i }.uniq[1..-1]
|
77
|
+
row_nums = cells.keys.map { |key| key[/\d+/].to_i }.uniq[1..-1] || []
|
78
|
+
row_nums.sort! unless row_nums.empty?
|
78
79
|
row_nums.map do |row_number|
|
79
80
|
columns.each_with_object({}) do |column_letter, h|
|
80
81
|
h[cells["#{column_letter}1"][:value]] = cells["#{column_letter}#{row_number}"][:value]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rxl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian McWilliams
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
116
|
+
rubygems_version: 2.7.7
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: A ruby spreadsheet interface
|