rubyfromexcel 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module RubyFromExcel
2
4
  class Worksheet
3
5
 
@@ -86,7 +88,7 @@ module RubyFromExcel
86
88
  end
87
89
  if workbook.indirects_used
88
90
  named_references.each do |name,reference|
89
- r.put_simple_method name, reference
91
+ r.put_simple_method name.downcase.gsub(/[^\p{word}]/,'_'), reference
90
92
  end
91
93
  end
92
94
  end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require_relative 'spec_helper'
2
4
 
3
5
  describe RuntimeFormulaBuilder, "For parsing indirect references" do
@@ -49,6 +51,7 @@ describe RuntimeFormulaBuilder, "For parsing indirect references" do
49
51
  ruby_for("SUM(OneAnd2)").should == "sum(one_and2)"
50
52
  ruby_for("ReferenceOne").should == "reference_one"
51
53
  ruby_for("Reference.2").should == "reference_2"
54
+ ruby_for("阿三").should == "阿三"
52
55
  ruby_for("-($AG70+$X70)*EF.NaturalGas.N2O").should == "-(ag70+x70)*ef_natural_gas_n2o"
53
56
  end
54
57
 
@@ -2,6 +2,8 @@ require_relative 'spec_helper'
2
2
 
3
3
  describe Worksheet do
4
4
 
5
+ SheetNames.instance['Outputs'] = 'sheet1'
6
+
5
7
  simple_worksheet_xml =<<END
6
8
  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
7
9
  <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="urn:schemas-microsoft-com:mac:vml" mc:Ignorable="mv" mc:PreserveAttributes="mv:*"><dimension ref="A1:A2"/><sheetViews><sheetView view="pageLayout" workbookViewId="0"/></sheetViews><sheetFormatPr baseColWidth="10" defaultRowHeight="13"/><sheetData><row r="1" spans="1:1"><c r="A1" t="str"><f>IF(A2="Hello","hello",Sheet2!B4)</f><v>hello</v></c></row><row r="2" spans="1:1"><c r="A2" t="s"><v>24</v></c></row></sheetData><sheetCalcPr fullCalcOnLoad="1"/><phoneticPr fontId="2" type="noConversion"/><pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5"/><pageSetup paperSize="10" orientation="portrait" horizontalDpi="4294967292" verticalDpi="4294967292"/><extLst><ext xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main" uri="http://schemas.microsoft.com/office/mac/excel/2008/main"><mx:PLV Mode="1" OnePage="0" WScale="0"/></ext></extLst></worksheet>
@@ -58,7 +60,7 @@ it 'should add any named references that apply just to this sheet' do
58
60
  SharedStrings.instance[24] = 'A shared string'
59
61
  worksheet = Worksheet.new(Nokogiri::XML(simple_worksheet_xml))
60
62
  worksheet.workbook = mock(:workbook,:indirects_used => true)
61
- worksheet.named_references['reference_one'] = 'sheet2.a1'
63
+ worksheet.named_references['reference.one'] = 'sheet2.a1'
62
64
  worksheet.name = 'sheet1'
63
65
  worksheet.to_ruby.should == named_reference_simple_worksheet_ruby
64
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyfromexcel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-27 00:00:00.000000000 Z
12
+ date: 2012-02-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &70198976262840 !ruby/object:Gem::Requirement
16
+ requirement: &70140944444740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.4.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70198976262840
24
+ version_requirements: *70140944444740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rubyscriptwriter
27
- requirement: &70198976262320 !ruby/object:Gem::Requirement
27
+ requirement: &70140944444120 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.0.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70198976262320
35
+ version_requirements: *70140944444120
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rubypeg
38
- requirement: &70198976261740 !ruby/object:Gem::Requirement
38
+ requirement: &70140944469920 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.0.4
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70198976261740
46
+ version_requirements: *70140944469920
47
47
  description:
48
48
  email: ruby-from-excel@greenonblack.com
49
49
  executables: