ooxl 0.0.1.4.6 → 0.0.1.4.7
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/lib/ooxl/version.rb +1 -1
- data/lib/ooxl/xl_objects/sheet/data_validation.rb +23 -15
- 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: 01511a331db538c10d28d38995c681d0406ea5ec
|
4
|
+
data.tar.gz: bb4f7b95dae30d39ea5e1756112c40bc6cd06a67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 429d6b724bc2e8d4a68e3b23a5abd71a74bf8ba4788d5122cfb94f212fa4dbad8245e4638013d41b427bd7adbb5454a6249f882abffc8ad956c08f68d58a29d4
|
7
|
+
data.tar.gz: b66babbc6940a0e86c2221e26e0cee1f809634247af10e238540b46b092bc0e48253a5ce92858fcccb80b98f3089bf36e3bccfc352b820e6170e593ceceff184
|
data/lib/ooxl/version.rb
CHANGED
@@ -35,26 +35,34 @@ class OOXL
|
|
35
35
|
def sqref_range
|
36
36
|
@sqref_range ||= begin
|
37
37
|
# "BH5:BH271 BI5:BI271"
|
38
|
-
if
|
39
|
-
|
40
|
-
index = sqref.gsub(/[^\d]/, '').to_i
|
41
|
-
{ cell_letter => (index..index)}
|
38
|
+
if sqref.blank?
|
39
|
+
[]
|
42
40
|
else
|
43
|
-
sqref.
|
44
|
-
# ["BH5:BH271, "BI5:BI271"]
|
45
|
-
if splitted_by_space_sqref.is_a?(Array)
|
46
|
-
splitted_by_space_sqref.map do |sqref|
|
47
|
-
build_range(splitted_by_space_sqref)
|
48
|
-
end
|
49
|
-
else
|
50
|
-
# "BH5:BH271"
|
51
|
-
build_range(splitted_by_space_sqref)
|
52
|
-
end
|
53
|
-
end.to_h
|
41
|
+
!sqref.include?(':') && !sqref.include?(' ') ? build_single_range(sqref) : build_multiple_range(sqref)
|
54
42
|
end
|
55
43
|
end
|
56
44
|
end
|
57
45
|
|
46
|
+
def build_multiple_range(sqref)
|
47
|
+
sqref.split(' ').map do |splitted_by_space_sqref|
|
48
|
+
# ["BH5:BH271, "BI5:BI271"]
|
49
|
+
if splitted_by_space_sqref.is_a?(Array)
|
50
|
+
splitted_by_space_sqref.map do |sqref|
|
51
|
+
build_range(splitted_by_space_sqref)
|
52
|
+
end
|
53
|
+
else
|
54
|
+
# "BH5:BH271"
|
55
|
+
build_range(splitted_by_space_sqref)
|
56
|
+
end
|
57
|
+
end.to_h
|
58
|
+
end
|
59
|
+
|
60
|
+
def build_single_range(sqref)
|
61
|
+
cell_letter = sqref.gsub(/[\d]/, '')
|
62
|
+
index = sqref.gsub(/[^\d]/, '').to_i
|
63
|
+
{ cell_letter => (index..index)}
|
64
|
+
end
|
65
|
+
|
58
66
|
def build_range(sqref)
|
59
67
|
splitted_sqref = sqref.gsub(/[\d]/, '')
|
60
68
|
sqref_without_letters = sqref.gsub(/[^\d:]/, '')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ooxl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.4.
|
4
|
+
version: 0.0.1.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Mones
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|