robust_excel_ole 1.29 → 1.30
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/Changelog +8 -0
- data/docs/README_open.rdoc +8 -4
- data/lib/robust_excel_ole/address_tool.rb +0 -2
- data/lib/robust_excel_ole/bookstore.rb +1 -1
- data/lib/robust_excel_ole/excel.rb +5 -15
- data/lib/robust_excel_ole/general.rb +239 -223
- data/lib/robust_excel_ole/list_object.rb +5 -1
- data/lib/robust_excel_ole/range.rb +5 -1
- data/lib/robust_excel_ole/range_owners.rb +4 -71
- data/lib/robust_excel_ole/version.rb +1 -1
- data/lib/robust_excel_ole/workbook.rb +26 -17
- data/lib/robust_excel_ole/worksheet.rb +72 -4
- data/spec/base_spec.rb +17 -15
- data/spec/data/more_data/workbook.xls +0 -0
- data/spec/general_spec.rb +3 -0
- data/spec/workbook_spec.rb +11 -11
- data/spec/workbook_specs/workbook_misc_spec.rb +30 -30
- data/spec/workbook_specs/workbook_open_spec.rb +11 -0
- data/spec/workbook_specs/workbook_unobtr_spec.rb +289 -109
- data/spec/worksheet_spec.rb +18 -18
- metadata +2 -2
data/spec/worksheet_spec.rb
CHANGED
@@ -613,7 +613,7 @@ describe Worksheet do
|
|
613
613
|
end
|
614
614
|
end
|
615
615
|
|
616
|
-
describe "
|
616
|
+
describe "namevalue_global, set_namevalue_global" do
|
617
617
|
|
618
618
|
before do
|
619
619
|
@book1 = Workbook.open(@dir + '/another_workbook.xls')
|
@@ -625,54 +625,54 @@ describe Worksheet do
|
|
625
625
|
end
|
626
626
|
|
627
627
|
it "should return value of a defined name" do
|
628
|
-
@sheet1.
|
628
|
+
@sheet1.namevalue_global("firstcell").should == "foo"
|
629
629
|
end
|
630
630
|
|
631
631
|
#it "should evaluate a formula" do
|
632
|
-
# @sheet1.
|
632
|
+
# @sheet1.namevalue_global("another_formula").should == 5
|
633
633
|
#end
|
634
634
|
|
635
635
|
it "should raise an error if name not defined" do
|
636
636
|
expect {
|
637
|
-
@sheet1.
|
637
|
+
@sheet1.namevalue_global("foo")
|
638
638
|
}.to raise_error(NameNotFound, /name "foo" not in/)
|
639
639
|
end
|
640
640
|
|
641
641
|
it "should raise an error of coordinates are given instead of a defined name" do
|
642
642
|
expect {
|
643
|
-
@sheet1.
|
643
|
+
@sheet1.namevalue_global("A1")
|
644
644
|
}.to raise_error(NameNotFound, /name "A1" not in/)
|
645
645
|
end
|
646
646
|
|
647
647
|
it "should return default value for a range with empty contents" do
|
648
|
-
@sheet1.
|
648
|
+
@sheet1.namevalue_global("another", :default => 2) == 2
|
649
649
|
end
|
650
650
|
|
651
651
|
it "should set a range to a value" do
|
652
|
-
@sheet1.
|
652
|
+
@sheet1.namevalue_global("firstcell").should == "foo"
|
653
653
|
@sheet1[1,1].Value.should == "foo"
|
654
|
-
@sheet1.
|
655
|
-
@sheet1.
|
654
|
+
@sheet1.set_namevalue_global("firstcell","bar")
|
655
|
+
@sheet1.namevalue_global("firstcell").should == "bar"
|
656
656
|
@sheet1[1,1].Value.should == "bar"
|
657
657
|
end
|
658
658
|
|
659
659
|
it "should raise an error if name cannot be evaluated" do
|
660
660
|
expect{
|
661
|
-
@sheet1.
|
661
|
+
@sheet1.set_namevalue_global("foo", 1)
|
662
662
|
}.to raise_error(RangeNotEvaluatable, /cannot assign value/)
|
663
663
|
end
|
664
664
|
|
665
665
|
it "should color the cell (deprecated)" do
|
666
|
-
@sheet1.
|
666
|
+
@sheet1.set_namevalue_global("new", "bar")
|
667
667
|
@book1.Names.Item("new").RefersToRange.Interior.ColorIndex.should == -4142
|
668
|
-
@sheet1.
|
668
|
+
@sheet1.set_namevalue_global("new", "bar", :color => 4)
|
669
669
|
@book1.Names.Item("new").RefersToRange.Interior.ColorIndex.should == 4
|
670
670
|
end
|
671
671
|
|
672
672
|
it "should color the cell" do
|
673
|
-
@sheet1.
|
673
|
+
@sheet1.set_namevalue_global("new", "bar")
|
674
674
|
@book1.Names.Item("new").RefersToRange.Interior.ColorIndex.should == -4142
|
675
|
-
@sheet1.
|
675
|
+
@sheet1.set_namevalue_global("new", "bar", :color => 4)
|
676
676
|
@book1.Names.Item("new").RefersToRange.Interior.ColorIndex.should == 4
|
677
677
|
end
|
678
678
|
|
@@ -735,7 +735,7 @@ describe Worksheet do
|
|
735
735
|
|
736
736
|
it "should raise an error if name cannot be evaluated" do
|
737
737
|
expect{
|
738
|
-
@sheet1.
|
738
|
+
@sheet1.set_namevalue_global("foo", 1)
|
739
739
|
}.to raise_error(RangeNotEvaluatable, /cannot assign value/)
|
740
740
|
end
|
741
741
|
|
@@ -751,7 +751,7 @@ describe Worksheet do
|
|
751
751
|
}.to raise_error(NameNotFound, /name "foo" not in #<Worksheet: Sheet1/)
|
752
752
|
@sheet1.namevalue("foo", :default => nil).should be_nil
|
753
753
|
@sheet1.namevalue("foo", :default => 1).should == 1
|
754
|
-
@sheet1.
|
754
|
+
@sheet1.namevalue_global("empty", :default => 1).should be_nil
|
755
755
|
end
|
756
756
|
|
757
757
|
it "should color the cell (depracated)" do
|
@@ -815,14 +815,14 @@ describe Worksheet do
|
|
815
815
|
it "should rename a range" do
|
816
816
|
@sheet1.add_name("foo",[1,1])
|
817
817
|
@sheet1.rename_range("foo","bar")
|
818
|
-
@sheet1.
|
818
|
+
@sheet1.namevalue_global("bar").should == "foo"
|
819
819
|
end
|
820
820
|
|
821
821
|
it "should delete a name of a range" do
|
822
822
|
@sheet1.add_name("foo",[1,1])
|
823
823
|
@sheet1.delete_name("foo")
|
824
824
|
expect{
|
825
|
-
@sheet1.
|
825
|
+
@sheet1.namevalue_global("foo")
|
826
826
|
}.to raise_error(NameNotFound, /name "foo"/)
|
827
827
|
end
|
828
828
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: robust_excel_ole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.30'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- traths
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|