rubyexcel 0.2.2 → 0.2.3
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/README.md +5 -0
- data/lib/rubyexcel/data.rb +3 -2
- data/lib/rubyexcel/excel_tools.rb +2 -2
- 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: 8f2531c23200d22c4d34eb39a4f17b1199093dd4
|
4
|
+
data.tar.gz: b3a671f7a6180ab547a655a850b47d26259b45ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 085d40c76c1a93189530070deaba6c8edf9fd52391db1bea9ee101f3a9028858e55dcc17c508c0ff0fb17b807b306957b2627a3c91b98380829abd18e7acbcf9
|
7
|
+
data.tar.gz: f4829dfa95047cd5dcf50d7a47f306e424376fffee89c41f868333c232ef22f66cf936e3fd3425ab48b989302076dc95ab05d91389080b1df1ed5b93a81883de
|
data/lib/README.md
CHANGED
@@ -519,6 +519,11 @@ s.offset( 'A2', 1, 2 ) #=> "C3"
|
|
519
519
|
s.offset( 'A2', 2, 0 ) #=> "A4"
|
520
520
|
s.offset( 'A2', -1, 0 ) #=> "A1"
|
521
521
|
|
522
|
+
#Here's a trick you can try if you're going to use the Address tools a lot:
|
523
|
+
include RubyExcel::Address
|
524
|
+
#Now you can use all the address methods in the current scope:
|
525
|
+
offset( 'C3', 1, -2 ) #=> A4
|
526
|
+
|
522
527
|
```
|
523
528
|
|
524
529
|
Importing a Hash
|
data/lib/rubyexcel/data.rb
CHANGED
@@ -318,9 +318,10 @@ require_relative 'address.rb'
|
|
318
318
|
#
|
319
319
|
|
320
320
|
def partition( header, &block )
|
321
|
+
copy = dup
|
321
322
|
idx = index_by_header( header )
|
322
|
-
d1, d2 = no_headers.partition { |row| yield row[ idx -1 ] }
|
323
|
-
[ headers + d1, headers + d2 ] if headers
|
323
|
+
d1, d2 = copy.no_headers.partition { |row| yield row[ idx -1 ] }
|
324
|
+
[ copy.headers + d1, copy.headers.map(&:dup) + d2 ] if headers
|
324
325
|
end
|
325
326
|
|
326
327
|
#
|
@@ -38,7 +38,7 @@ module RubyExcel
|
|
38
38
|
def disable_formulas!
|
39
39
|
sheets { |s| s.rows { |r| r.each_cell { |ce|
|
40
40
|
if ce.value.is_a?( String ) && ce.value[0] == '='
|
41
|
-
ce.value = ce.value.sub(
|
41
|
+
ce.value = ce.value.sub( /\A=/,"'=" )
|
42
42
|
end
|
43
43
|
} } }; self
|
44
44
|
end
|
@@ -169,7 +169,7 @@ module RubyExcel
|
|
169
169
|
def to_safe_format!
|
170
170
|
sheets { |s| s.rows { |r| r.map! { |v|
|
171
171
|
if v.is_a?( String )
|
172
|
-
v[0] == '=' ? v.sub(
|
172
|
+
v[0] == '=' ? v.sub( /\A=/,"'=" ) : v
|
173
173
|
else
|
174
174
|
v.to_s
|
175
175
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyexcel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Pearson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A tabular data structure in Ruby, with header-based helper methods for
|
14
14
|
analysis and editing, and some of Excel's API style. Can output as 2D Array, Excel,
|