xlsx_drone 0.3.0 → 0.4.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 +4 -4
- data/ext/xlsx_drone_x64.dll +0 -0
- data/ext/xlsx_drone_x86.dll +0 -0
- data/lib/xlsx_drone/native_binding.rb +2 -0
- data/lib/xlsx_drone/sheet.rb +21 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be28b8117784a982619a5215be335f025b2c1e285947b51fd11bc51997575986
|
4
|
+
data.tar.gz: f4c7169ff1281b8fdd2f7dedaba629ca429db5edf826c76b5a95bf87d666ff27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 942edb65153f423989edbc8ef03f51b8143ae395239c2a4a15db88e3a12e0e3ba9868ff64dbc668ebf8291f951420e99367b364d6b081ba8224d6e5eaac5d602
|
7
|
+
data.tar.gz: '059038b92605272fd0945e5619aa78713b5e322fa97ddc35151c4f64a1e4f5fa1a79886b81a413ca3d930780d9ae211334338cb8869bdaf671210b7eaba98990'
|
data/ext/xlsx_drone_x64.dll
CHANGED
Binary file
|
data/ext/xlsx_drone_x86.dll
CHANGED
Binary file
|
@@ -42,6 +42,7 @@ module XLSXDrone
|
|
42
42
|
:sheet_xml, :pointer,
|
43
43
|
:sheetdata, :pointer,
|
44
44
|
:last_row, :int,
|
45
|
+
:last_column, :pointer,
|
45
46
|
:last_row_looked, XLSXReferenceToRowT
|
46
47
|
end
|
47
48
|
|
@@ -70,6 +71,7 @@ module XLSXDrone
|
|
70
71
|
attach_function :xlsx_set_print_err_messages, [:int], :void
|
71
72
|
attach_function :xlsx_open, [:string, :pointer], :int
|
72
73
|
attach_function :xlsx_load_sheet, [:pointer, :int, :string], :pointer
|
74
|
+
attach_function :xlsx_get_last_column, [:pointer], :pointer
|
73
75
|
attach_function :xlsx_read_cell, [:pointer, :uint, :string, :pointer], :void
|
74
76
|
attach_function :xlsx_close, [:pointer], :int
|
75
77
|
end
|
data/lib/xlsx_drone/sheet.rb
CHANGED
@@ -3,7 +3,7 @@ module XLSXDrone
|
|
3
3
|
|
4
4
|
# XLSX Sheet.
|
5
5
|
class Sheet
|
6
|
-
|
6
|
+
|
7
7
|
# @return [XLSXDrone::Sheet]
|
8
8
|
def initialize(xlsx_sheet_mpointer)
|
9
9
|
@native_sheet = XLSXDrone::NativeBinding::XLSXSheetT.new(xlsx_sheet_mpointer)
|
@@ -16,6 +16,26 @@ module XLSXDrone
|
|
16
16
|
@native_sheet[:last_row]
|
17
17
|
end
|
18
18
|
|
19
|
+
# @return [String] "A" if the sheet is empty
|
20
|
+
def last_column
|
21
|
+
if(!@last_column)
|
22
|
+
mpointer = XLSXDrone::NativeBinding.xlsx_get_last_column(@native_sheet) # NULL or a string
|
23
|
+
if(mpointer.null?)
|
24
|
+
# the sheet is empty
|
25
|
+
@last_column = 'A'
|
26
|
+
else
|
27
|
+
@last_column = mpointer.get_string(0).force_encoding(Encoding::UTF_8)
|
28
|
+
end
|
29
|
+
else
|
30
|
+
@last_column
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# @return [Boolean]
|
35
|
+
def empty?
|
36
|
+
last_row() == 0 ? true : false
|
37
|
+
end
|
38
|
+
|
19
39
|
# @return [String]
|
20
40
|
def name
|
21
41
|
@native_sheet[:name].get_string(0).force_encoding(Encoding::UTF_8)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xlsx_drone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damián M. González
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|