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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51f075424b62a47b35195d5866af543f3acbe170
4
- data.tar.gz: f313aa0ff0ad8eb6e29e39db4edf1c633d583c5b
3
+ metadata.gz: 8f2531c23200d22c4d34eb39a4f17b1199093dd4
4
+ data.tar.gz: b3a671f7a6180ab547a655a850b47d26259b45ea
5
5
  SHA512:
6
- metadata.gz: fe22727fb20c44580b7e9c2089c52c636d6a6141e9bca679d0b135b23547e5bf30111982f5774c7a25be425260c065c4480809d16d689b25a3e74d20f94d28ec
7
- data.tar.gz: f78b59c475d59a76be6c7e8a866b0f5134d8726677c985c6fda30c4203bf3e55f6ce9ebaf174100897c41b77a277719d002681870dd315487d1d2553f7c18807
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
@@ -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( /^=/,"'=" ) : v
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.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-22 00:00:00.000000000 Z
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,