rubyXL 1.2.10 → 3.4.33
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 +7 -0
- data/.circleci/config.yml +60 -0
- data/.codeclimate.yml +3 -0
- data/.rubocop.yml +124 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +18 -14
- data/LICENSE.txt +1 -1
- data/README.rdoc +170 -100
- data/Rakefile +76 -26
- data/VERSION +1 -1
- data/lib/rubyXL/cell.rb +13 -447
- data/lib/rubyXL/convenience_methods/cell.rb +276 -0
- data/lib/rubyXL/convenience_methods/color.rb +156 -0
- data/lib/rubyXL/convenience_methods/font.rb +63 -0
- data/lib/rubyXL/convenience_methods/workbook.rb +137 -0
- data/lib/rubyXL/convenience_methods/worksheet.rb +734 -0
- data/lib/rubyXL/convenience_methods.rb +5 -0
- data/lib/rubyXL/objects/border.rb +71 -0
- data/lib/rubyXL/objects/calculation_chain.rb +31 -0
- data/lib/rubyXL/objects/cell_style.rb +63 -0
- data/lib/rubyXL/objects/chartsheet.rb +88 -0
- data/lib/rubyXL/objects/color.rb +25 -0
- data/lib/rubyXL/objects/column_range.rb +93 -0
- data/lib/rubyXL/objects/comments.rb +44 -0
- data/lib/rubyXL/objects/connection.rb +175 -0
- data/lib/rubyXL/objects/container_nodes.rb +131 -0
- data/lib/rubyXL/objects/content_types.rb +74 -0
- data/lib/rubyXL/objects/data_validation.rb +37 -0
- data/lib/rubyXL/objects/document_properties.rb +156 -0
- data/lib/rubyXL/objects/extensions.rb +51 -0
- data/lib/rubyXL/objects/external_links.rb +115 -0
- data/lib/rubyXL/objects/fill.rb +52 -0
- data/lib/rubyXL/objects/filters.rb +118 -0
- data/lib/rubyXL/objects/font.rb +43 -0
- data/lib/rubyXL/objects/formula.rb +22 -0
- data/lib/rubyXL/objects/ooxml_object.rb +469 -0
- data/lib/rubyXL/objects/query_table.rb +106 -0
- data/lib/rubyXL/objects/reference.rb +119 -0
- data/lib/rubyXL/objects/relationships.rb +213 -0
- data/lib/rubyXL/objects/root.rb +84 -0
- data/lib/rubyXL/objects/shared_strings.rb +67 -0
- data/lib/rubyXL/objects/sheet_common.rb +49 -0
- data/lib/rubyXL/objects/sheet_data.rb +219 -0
- data/lib/rubyXL/objects/simple_types.rb +249 -0
- data/lib/rubyXL/objects/storage.rb +193 -0
- data/lib/rubyXL/objects/stylesheet.rb +224 -0
- data/lib/rubyXL/objects/text.rb +92 -0
- data/lib/rubyXL/objects/theme.rb +1730 -0
- data/lib/rubyXL/objects/workbook.rb +572 -0
- data/lib/rubyXL/objects/worksheet.rb +762 -0
- data/lib/rubyXL/parser.rb +18 -459
- data/lib/rubyXL/worksheet.rb +73 -1461
- data/lib/rubyXL.rb +9 -7
- data/rdoc/README_rdoc.html +534 -0
- data/rdoc/RubyXL/AExtension.html +187 -0
- data/rdoc/RubyXL/AExtensionStorageArea.html +97 -0
- data/rdoc/RubyXL/ActiveX.html +156 -0
- data/rdoc/RubyXL/ActiveXBinary.html +106 -0
- data/rdoc/RubyXL/AdjustHandleList.html +99 -0
- data/rdoc/RubyXL/Alignment.html +99 -0
- data/rdoc/RubyXL/AlternateContent.html +97 -0
- data/rdoc/RubyXL/AlternateUrls.html +99 -0
- data/rdoc/RubyXL/Authors.html +99 -0
- data/rdoc/RubyXL/AutoFilter.html +99 -0
- data/rdoc/RubyXL/AutoFilterColumn.html +99 -0
- data/rdoc/RubyXL/BinaryImageFile.html +108 -0
- data/rdoc/RubyXL/BodyProperties.html +99 -0
- data/rdoc/RubyXL/BooleanNode.html +97 -0
- data/rdoc/RubyXL/BooleanValue.html +97 -0
- data/rdoc/RubyXL/Border.html +223 -0
- data/rdoc/RubyXL/BorderEdge.html +160 -0
- data/rdoc/RubyXL/Borders.html +138 -0
- data/rdoc/RubyXL/Break.html +99 -0
- data/rdoc/RubyXL/BreakList.html +99 -0
- data/rdoc/RubyXL/CT_AdjPoint2D.html +99 -0
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +99 -0
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +99 -0
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +99 -0
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +99 -0
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +99 -0
- data/rdoc/RubyXL/CT_Backdrop.html +99 -0
- data/rdoc/RubyXL/CT_Bevel.html +99 -0
- data/rdoc/RubyXL/CT_BiLevelEffect.html +99 -0
- data/rdoc/RubyXL/CT_BlendEffect.html +99 -0
- data/rdoc/RubyXL/CT_Blip.html +99 -0
- data/rdoc/RubyXL/CT_BlipFillProperties.html +99 -0
- data/rdoc/RubyXL/CT_BlurEffect.html +99 -0
- data/rdoc/RubyXL/CT_Camera.html +99 -0
- data/rdoc/RubyXL/CT_Color.html +99 -0
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +99 -0
- data/rdoc/RubyXL/CT_ColorMapping.html +99 -0
- data/rdoc/RubyXL/CT_ColorScheme.html +99 -0
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +99 -0
- data/rdoc/RubyXL/CT_ConnectionSite.html +99 -0
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +99 -0
- data/rdoc/RubyXL/CT_DashStop.html +99 -0
- data/rdoc/RubyXL/CT_DashStopList.html +99 -0
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +99 -0
- data/rdoc/RubyXL/CT_DuotoneEffect.html +99 -0
- data/rdoc/RubyXL/CT_EffectContainer.html +99 -0
- data/rdoc/RubyXL/CT_EffectList.html +99 -0
- data/rdoc/RubyXL/CT_EffectReference.html +99 -0
- data/rdoc/RubyXL/CT_EffectStyleItem.html +99 -0
- data/rdoc/RubyXL/CT_EffectStyleList.html +99 -0
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +99 -0
- data/rdoc/RubyXL/CT_FillEffect.html +99 -0
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +99 -0
- data/rdoc/RubyXL/CT_FillStyleList.html +99 -0
- data/rdoc/RubyXL/CT_FlatText.html +99 -0
- data/rdoc/RubyXL/CT_FontCollection.html +99 -0
- data/rdoc/RubyXL/CT_FontReference.html +99 -0
- data/rdoc/RubyXL/CT_GeomGuideList.html +99 -0
- data/rdoc/RubyXL/CT_GlowEffect.html +99 -0
- data/rdoc/RubyXL/CT_GradientFillProperties.html +99 -0
- data/rdoc/RubyXL/CT_GradientStop.html +99 -0
- data/rdoc/RubyXL/CT_GradientStopList.html +99 -0
- data/rdoc/RubyXL/CT_HSLEffect.html +99 -0
- data/rdoc/RubyXL/CT_HslColor.html +99 -0
- data/rdoc/RubyXL/CT_Hyperlink.html +99 -0
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +99 -0
- data/rdoc/RubyXL/CT_LightRig.html +99 -0
- data/rdoc/RubyXL/CT_LineEndProperties.html +99 -0
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +99 -0
- data/rdoc/RubyXL/CT_LineProperties.html +99 -0
- data/rdoc/RubyXL/CT_LineStyleList.html +99 -0
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +99 -0
- data/rdoc/RubyXL/CT_LuminanceEffect.html +99 -0
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +99 -0
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +99 -0
- data/rdoc/RubyXL/CT_Path2D.html +99 -0
- data/rdoc/RubyXL/CT_Path2DArcTo.html +99 -0
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +99 -0
- data/rdoc/RubyXL/CT_Path2DList.html +99 -0
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +99 -0
- data/rdoc/RubyXL/CT_Path2DTo.html +99 -0
- data/rdoc/RubyXL/CT_PathShadeProperties.html +99 -0
- data/rdoc/RubyXL/CT_PatternFillProperties.html +99 -0
- data/rdoc/RubyXL/CT_Point3D.html +99 -0
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +99 -0
- data/rdoc/RubyXL/CT_PresetColor.html +99 -0
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +99 -0
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +99 -0
- data/rdoc/RubyXL/CT_PresetTextShape.html +99 -0
- data/rdoc/RubyXL/CT_ReflectionEffect.html +99 -0
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +99 -0
- data/rdoc/RubyXL/CT_RelativeRect.html +99 -0
- data/rdoc/RubyXL/CT_SRgbColor.html +99 -0
- data/rdoc/RubyXL/CT_ScRgbColor.html +99 -0
- data/rdoc/RubyXL/CT_Scene3D.html +99 -0
- data/rdoc/RubyXL/CT_SchemeColor.html +99 -0
- data/rdoc/RubyXL/CT_Shape3D.html +99 -0
- data/rdoc/RubyXL/CT_ShapeStyle.html +99 -0
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +99 -0
- data/rdoc/RubyXL/CT_SphereCoords.html +99 -0
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +99 -0
- data/rdoc/RubyXL/CT_StyleMatrix.html +99 -0
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +99 -0
- data/rdoc/RubyXL/CT_SupplementalFont.html +99 -0
- data/rdoc/RubyXL/CT_SystemColor.html +99 -0
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +99 -0
- data/rdoc/RubyXL/CT_TextBlipBullet.html +99 -0
- data/rdoc/RubyXL/CT_TextCharBullet.html +99 -0
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +99 -0
- data/rdoc/RubyXL/CT_TextFont.html +99 -0
- data/rdoc/RubyXL/CT_TextListStyle.html +99 -0
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +99 -0
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +99 -0
- data/rdoc/RubyXL/CT_TextSpacing.html +99 -0
- data/rdoc/RubyXL/CT_TextTabStop.html +99 -0
- data/rdoc/RubyXL/CT_TextTabStopList.html +99 -0
- data/rdoc/RubyXL/CT_TileInfoProperties.html +99 -0
- data/rdoc/RubyXL/CT_TintEffect.html +99 -0
- data/rdoc/RubyXL/CT_Transform2D.html +99 -0
- data/rdoc/RubyXL/CT_TransformEffect.html +99 -0
- data/rdoc/RubyXL/CT_Vector3D.html +99 -0
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +99 -0
- data/rdoc/RubyXL/CalculationChain.html +149 -0
- data/rdoc/RubyXL/CalculationChainCell.html +99 -0
- data/rdoc/RubyXL/CalculationProperties.html +99 -0
- data/rdoc/RubyXL/Cell.html +510 -0
- data/rdoc/RubyXL/CellConvenienceMethods.html +1077 -0
- data/rdoc/RubyXL/CellExt.html +99 -0
- data/rdoc/RubyXL/CellSmartTag.html +99 -0
- data/rdoc/RubyXL/CellSmartTagProperty.html +99 -0
- data/rdoc/RubyXL/CellSmartTags.html +99 -0
- data/rdoc/RubyXL/CellStyle.html +99 -0
- data/rdoc/RubyXL/CellStyleXFs.html +138 -0
- data/rdoc/RubyXL/CellStyles.html +138 -0
- data/rdoc/RubyXL/CellValue.html +139 -0
- data/rdoc/RubyXL/CellWatch.html +99 -0
- data/rdoc/RubyXL/CellWatches.html +99 -0
- data/rdoc/RubyXL/CellXFs.html +139 -0
- data/rdoc/RubyXL/ChartColorsFile.html +108 -0
- data/rdoc/RubyXL/ChartFile.html +160 -0
- data/rdoc/RubyXL/ChartStyleFile.html +108 -0
- data/rdoc/RubyXL/ChartUserShapesFile.html +108 -0
- data/rdoc/RubyXL/Chartsheet.html +213 -0
- data/rdoc/RubyXL/ChartsheetPageSetup.html +99 -0
- data/rdoc/RubyXL/ChartsheetProperties.html +99 -0
- data/rdoc/RubyXL/ChartsheetProtection.html +99 -0
- data/rdoc/RubyXL/ChartsheetView.html +99 -0
- data/rdoc/RubyXL/ChartsheetViews.html +99 -0
- data/rdoc/RubyXL/Color.html +151 -0
- data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +246 -0
- data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +285 -0
- data/rdoc/RubyXL/ColorConvenienceClasses.html +91 -0
- data/rdoc/RubyXL/ColorConvenienceMethods.html +139 -0
- data/rdoc/RubyXL/ColorFilter.html +99 -0
- data/rdoc/RubyXL/ColorScale.html +99 -0
- data/rdoc/RubyXL/ColorSet.html +99 -0
- data/rdoc/RubyXL/Colors.html +99 -0
- data/rdoc/RubyXL/ColumnRange.html +230 -0
- data/rdoc/RubyXL/ColumnRanges.html +237 -0
- data/rdoc/RubyXL/Comment.html +99 -0
- data/rdoc/RubyXL/CommentList.html +99 -0
- data/rdoc/RubyXL/CommentsFile.html +165 -0
- data/rdoc/RubyXL/ConditionalFormatValue.html +99 -0
- data/rdoc/RubyXL/ConditionalFormatting.html +99 -0
- data/rdoc/RubyXL/ConditionalFormattingRule.html +99 -0
- data/rdoc/RubyXL/Connection.html +99 -0
- data/rdoc/RubyXL/ConnectionTable.html +99 -0
- data/rdoc/RubyXL/ConnectionTables.html +99 -0
- data/rdoc/RubyXL/ConnectionTextField.html +99 -0
- data/rdoc/RubyXL/ConnectionTextFields.html +99 -0
- data/rdoc/RubyXL/Connections.html +149 -0
- data/rdoc/RubyXL/ContentTypeDefault.html +97 -0
- data/rdoc/RubyXL/ContentTypeOverride.html +97 -0
- data/rdoc/RubyXL/ContentTypes.html +211 -0
- data/rdoc/RubyXL/ControlPropertiesFile.html +108 -0
- data/rdoc/RubyXL/CorePropertiesFile.html +355 -0
- data/rdoc/RubyXL/CustomColor.html +99 -0
- data/rdoc/RubyXL/CustomColorList.html +99 -0
- data/rdoc/RubyXL/CustomFilter.html +99 -0
- data/rdoc/RubyXL/CustomFilters.html +99 -0
- data/rdoc/RubyXL/CustomGeometry.html +99 -0
- data/rdoc/RubyXL/CustomProperties.html +99 -0
- data/rdoc/RubyXL/CustomPropertiesFile.html +108 -0
- data/rdoc/RubyXL/CustomProperty.html +99 -0
- data/rdoc/RubyXL/CustomPropertyFile.html +108 -0
- data/rdoc/RubyXL/CustomSheetView.html +99 -0
- data/rdoc/RubyXL/CustomSheetViews.html +99 -0
- data/rdoc/RubyXL/CustomWorkbookView.html +99 -0
- data/rdoc/RubyXL/CustomWorkbookViews.html +99 -0
- data/rdoc/RubyXL/CustomXMLFile.html +106 -0
- data/rdoc/RubyXL/DXF.html +99 -0
- data/rdoc/RubyXL/DXFs.html +99 -0
- data/rdoc/RubyXL/DataBar.html +99 -0
- data/rdoc/RubyXL/DataConsolidate.html +99 -0
- data/rdoc/RubyXL/DataConsolidationReference.html +99 -0
- data/rdoc/RubyXL/DataConsolidationReferences.html +99 -0
- data/rdoc/RubyXL/DataType.html +114 -0
- data/rdoc/RubyXL/DataValidation.html +99 -0
- data/rdoc/RubyXL/DataValidations.html +99 -0
- data/rdoc/RubyXL/DateGroupItem.html +99 -0
- data/rdoc/RubyXL/DefinedName.html +99 -0
- data/rdoc/RubyXL/DefinedNameExt.html +99 -0
- data/rdoc/RubyXL/DefinedNames.html +99 -0
- data/rdoc/RubyXL/DefinedNamesExt.html +99 -0
- data/rdoc/RubyXL/DocumentPropertiesFile.html +213 -0
- data/rdoc/RubyXL/DrawingFile.html +159 -0
- data/rdoc/RubyXL/DynamicFilter.html +99 -0
- data/rdoc/RubyXL/EmbeddedControl.html +99 -0
- data/rdoc/RubyXL/EmbeddedControls.html +99 -0
- data/rdoc/RubyXL/Extension.html +99 -0
- data/rdoc/RubyXL/ExtensionStorageArea.html +99 -0
- data/rdoc/RubyXL/Extents.html +99 -0
- data/rdoc/RubyXL/ExternalBook.html +99 -0
- data/rdoc/RubyXL/ExternalLinksFile.html +155 -0
- data/rdoc/RubyXL/ExternalReference.html +99 -0
- data/rdoc/RubyXL/ExternalReferences.html +99 -0
- data/rdoc/RubyXL/ExtraColorSchemeList.html +99 -0
- data/rdoc/RubyXL/FieldItem.html +99 -0
- data/rdoc/RubyXL/FileRecoveryProperties.html +99 -0
- data/rdoc/RubyXL/FileSharing.html +99 -0
- data/rdoc/RubyXL/FileVersion.html +99 -0
- data/rdoc/RubyXL/Fill.html +138 -0
- data/rdoc/RubyXL/Fills.html +138 -0
- data/rdoc/RubyXL/FilterContainer.html +99 -0
- data/rdoc/RubyXL/FloatNode.html +97 -0
- data/rdoc/RubyXL/FloatValue.html +97 -0
- data/rdoc/RubyXL/Font.html +148 -0
- data/rdoc/RubyXL/FontConvenienceMethods.html +442 -0
- data/rdoc/RubyXL/FontScheme.html +99 -0
- data/rdoc/RubyXL/Fonts.html +138 -0
- data/rdoc/RubyXL/Formula.html +99 -0
- data/rdoc/RubyXL/FunctionGroup.html +99 -0
- data/rdoc/RubyXL/FunctionGroups.html +99 -0
- data/rdoc/RubyXL/GenericStorageObject.html +241 -0
- data/rdoc/RubyXL/GradientFill.html +99 -0
- data/rdoc/RubyXL/HeaderFooterSettings.html +99 -0
- data/rdoc/RubyXL/Hyperlink.html +99 -0
- data/rdoc/RubyXL/HyperlinkRelFile.html +106 -0
- data/rdoc/RubyXL/Hyperlinks.html +99 -0
- data/rdoc/RubyXL/IconFilter.html +99 -0
- data/rdoc/RubyXL/IconSet.html +99 -0
- data/rdoc/RubyXL/IgnoredError.html +99 -0
- data/rdoc/RubyXL/IgnoredErrors.html +99 -0
- data/rdoc/RubyXL/IndexedColors.html +99 -0
- data/rdoc/RubyXL/InputCells.html +99 -0
- data/rdoc/RubyXL/IntegerNode.html +97 -0
- data/rdoc/RubyXL/IntegerValue.html +97 -0
- data/rdoc/RubyXL/LegacyCell.html +130 -0
- data/rdoc/RubyXL/LegacyWorksheet.html +306 -0
- data/rdoc/RubyXL/MRUColors.html +99 -0
- data/rdoc/RubyXL/MacrosFile.html +108 -0
- data/rdoc/RubyXL/MergedCell.html +99 -0
- data/rdoc/RubyXL/MergedCells.html +99 -0
- data/rdoc/RubyXL/NumFmt.html +99 -0
- data/rdoc/RubyXL/NumberFormat.html +139 -0
- data/rdoc/RubyXL/NumberFormats.html +147 -0
- data/rdoc/RubyXL/OLEObject.html +99 -0
- data/rdoc/RubyXL/OLEObjectFile.html +108 -0
- data/rdoc/RubyXL/OLEObjects.html +99 -0
- data/rdoc/RubyXL/OLESize.html +99 -0
- data/rdoc/RubyXL/OOXMLContainerObject.html +309 -0
- data/rdoc/RubyXL/OOXMLIgnored.html +167 -0
- data/rdoc/RubyXL/OOXMLObject.html +107 -0
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +455 -0
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +442 -0
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +470 -0
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +297 -0
- data/rdoc/RubyXL/OdbcOleDbProperties.html +99 -0
- data/rdoc/RubyXL/Offset.html +99 -0
- data/rdoc/RubyXL/OlapProperties.html +99 -0
- data/rdoc/RubyXL/OleItem.html +99 -0
- data/rdoc/RubyXL/OleItems.html +99 -0
- data/rdoc/RubyXL/OleLink.html +99 -0
- data/rdoc/RubyXL/OutlineProperties.html +99 -0
- data/rdoc/RubyXL/PageMargins.html +99 -0
- data/rdoc/RubyXL/PageSetup.html +99 -0
- data/rdoc/RubyXL/PageSetupProperties.html +99 -0
- data/rdoc/RubyXL/Pane.html +99 -0
- data/rdoc/RubyXL/Parser.html +174 -0
- data/rdoc/RubyXL/PatternFill.html +99 -0
- data/rdoc/RubyXL/PersonMetadata.html +108 -0
- data/rdoc/RubyXL/PhoneticProperties.html +99 -0
- data/rdoc/RubyXL/PhoneticRun.html +99 -0
- data/rdoc/RubyXL/PivotArea.html +99 -0
- data/rdoc/RubyXL/PivotCache.html +99 -0
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +116 -0
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +108 -0
- data/rdoc/RubyXL/PivotCaches.html +99 -0
- data/rdoc/RubyXL/PivotReference.html +99 -0
- data/rdoc/RubyXL/PivotReferences.html +99 -0
- data/rdoc/RubyXL/PivotTableFile.html +116 -0
- data/rdoc/RubyXL/PivotTableSelection.html +99 -0
- data/rdoc/RubyXL/PresetGeometry.html +99 -0
- data/rdoc/RubyXL/PrintOptions.html +99 -0
- data/rdoc/RubyXL/PrinterSettingsFile.html +108 -0
- data/rdoc/RubyXL/ProtectedRange.html +99 -0
- data/rdoc/RubyXL/ProtectedRanges.html +99 -0
- data/rdoc/RubyXL/Protection.html +99 -0
- data/rdoc/RubyXL/QueryParameter.html +99 -0
- data/rdoc/RubyXL/QueryParameters.html +99 -0
- data/rdoc/RubyXL/QueryTable.html +157 -0
- data/rdoc/RubyXL/QueryTableDeletedField.html +99 -0
- data/rdoc/RubyXL/QueryTableDeletedFields.html +99 -0
- data/rdoc/RubyXL/QueryTableField.html +99 -0
- data/rdoc/RubyXL/QueryTableFields.html +99 -0
- data/rdoc/RubyXL/QueryTableRefresh.html +99 -0
- data/rdoc/RubyXL/RID.html +97 -0
- data/rdoc/RubyXL/RawOOXML.html +187 -0
- data/rdoc/RubyXL/Reference.html +510 -0
- data/rdoc/RubyXL/Relationship.html +97 -0
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +131 -0
- data/rdoc/RubyXL/RelationshipSupport.html +336 -0
- data/rdoc/RubyXL/RevisionPointer.html +99 -0
- data/rdoc/RubyXL/RichText.html +141 -0
- data/rdoc/RubyXL/RichTextRun.html +138 -0
- data/rdoc/RubyXL/Row.html +357 -0
- data/rdoc/RubyXL/RowExt.html +99 -0
- data/rdoc/RubyXL/RunProperties.html +99 -0
- data/rdoc/RubyXL/Scenario.html +99 -0
- data/rdoc/RubyXL/Scenarios.html +99 -0
- data/rdoc/RubyXL/Selection.html +146 -0
- data/rdoc/RubyXL/ShapeGuide.html +99 -0
- data/rdoc/RubyXL/ShapeTextRectangle.html +99 -0
- data/rdoc/RubyXL/SharedStringsTable.html +328 -0
- data/rdoc/RubyXL/Sheet.html +99 -0
- data/rdoc/RubyXL/SheetCalculationProperties.html +99 -0
- data/rdoc/RubyXL/SheetData.html +162 -0
- data/rdoc/RubyXL/SheetDataExt.html +99 -0
- data/rdoc/RubyXL/SheetDataSet.html +99 -0
- data/rdoc/RubyXL/SheetMetadata.html +108 -0
- data/rdoc/RubyXL/SheetName.html +99 -0
- data/rdoc/RubyXL/SheetNames.html +99 -0
- data/rdoc/RubyXL/Sheets.html +99 -0
- data/rdoc/RubyXL/SlicerCacheFile.html +108 -0
- data/rdoc/RubyXL/SlicerFile.html +108 -0
- data/rdoc/RubyXL/SmartTagProperties.html +99 -0
- data/rdoc/RubyXL/SmartTagType.html +99 -0
- data/rdoc/RubyXL/SmartTagTypes.html +99 -0
- data/rdoc/RubyXL/SmartTags.html +99 -0
- data/rdoc/RubyXL/SortCondition.html +99 -0
- data/rdoc/RubyXL/SortState.html +99 -0
- data/rdoc/RubyXL/Sqref.html +167 -0
- data/rdoc/RubyXL/Stop.html +99 -0
- data/rdoc/RubyXL/StringNode.html +97 -0
- data/rdoc/RubyXL/StringNodeW3C.html +167 -0
- data/rdoc/RubyXL/StringValue.html +97 -0
- data/rdoc/RubyXL/Stylesheet.html +281 -0
- data/rdoc/RubyXL/TableFile.html +108 -0
- data/rdoc/RubyXL/TableParts.html +97 -0
- data/rdoc/RubyXL/TableStyle.html +99 -0
- data/rdoc/RubyXL/TableStyles.html +99 -0
- data/rdoc/RubyXL/Text.html +175 -0
- data/rdoc/RubyXL/TextImportSettings.html +99 -0
- data/rdoc/RubyXL/Theme.html +535 -0
- data/rdoc/RubyXL/ThemeElements.html +99 -0
- data/rdoc/RubyXL/ThumbnailFile.html +108 -0
- data/rdoc/RubyXL/Top10.html +99 -0
- data/rdoc/RubyXL/VMLDrawingFile.html +116 -0
- data/rdoc/RubyXL/Variant.html +99 -0
- data/rdoc/RubyXL/Vector.html +142 -0
- data/rdoc/RubyXL/VectorValue.html +97 -0
- data/rdoc/RubyXL/VisualProperties.html +99 -0
- data/rdoc/RubyXL/WebPublishObject.html +99 -0
- data/rdoc/RubyXL/WebPublishObjects.html +99 -0
- data/rdoc/RubyXL/WebPublishingItem.html +99 -0
- data/rdoc/RubyXL/WebPublishingItems.html +99 -0
- data/rdoc/RubyXL/WebPublishingProperties.html +99 -0
- data/rdoc/RubyXL/WebQueryProperties.html +99 -0
- data/rdoc/RubyXL/Workbook.html +948 -0
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +596 -0
- data/rdoc/RubyXL/WorkbookProperties.html +99 -0
- data/rdoc/RubyXL/WorkbookProtection.html +99 -0
- data/rdoc/RubyXL/WorkbookRoot.html +325 -0
- data/rdoc/RubyXL/WorkbookView.html +99 -0
- data/rdoc/RubyXL/WorkbookViews.html +99 -0
- data/rdoc/RubyXL/Worksheet.html +418 -0
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +2205 -0
- data/rdoc/RubyXL/WorksheetDimensions.html +99 -0
- data/rdoc/RubyXL/WorksheetFormatProperties.html +97 -0
- data/rdoc/RubyXL/WorksheetProperties.html +99 -0
- data/rdoc/RubyXL/WorksheetProtection.html +99 -0
- data/rdoc/RubyXL/WorksheetView.html +99 -0
- data/rdoc/RubyXL/WorksheetViews.html +99 -0
- data/rdoc/RubyXL/XF.html +99 -0
- data/rdoc/RubyXL.html +338 -0
- data/rdoc/created.rid +45 -0
- data/rdoc/css/fonts.css +167 -0
- data/rdoc/css/rdoc.css +687 -0
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +477 -0
- data/rdoc/js/darkfish.js +97 -0
- data/rdoc/js/navigation.js +105 -0
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +110 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +229 -0
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +3021 -0
- data/rubyXL.gemspec +521 -60
- data/spec/lib/cell_spec.rb +386 -143
- data/spec/lib/color_spec.rb +11 -4
- data/spec/lib/parser_spec.rb +90 -38
- data/spec/lib/reference_spec.rb +64 -0
- data/spec/lib/rgb_color_spec.rb +29 -0
- data/spec/lib/stylesheet_spec.rb +27 -0
- data/spec/lib/text_spec.rb +27 -0
- data/spec/lib/workbook_spec.rb +168 -22
- data/spec/lib/worksheet_spec.rb +1207 -1220
- data/spec/spec_helper.rb +13 -0
- data/test/input/.gitkeep +0 -0
- data/test/output/.gitkeep +0 -0
- data/test/test_parse_write.rb +15 -0
- data/tmp/.gitignore +1 -0
- metadata +634 -168
- data/Gemfile.lock +0 -34
- data/lib/.DS_Store +0 -0
- data/lib/rubyXL/Hash.rb +0 -60
- data/lib/rubyXL/color.rb +0 -14
- data/lib/rubyXL/private_class.rb +0 -265
- data/lib/rubyXL/workbook.rb +0 -450
- data/lib/rubyXL/writer/app_writer.rb +0 -62
- data/lib/rubyXL/writer/calc_chain_writer.rb +0 -33
- data/lib/rubyXL/writer/content_types_writer.rb +0 -77
- data/lib/rubyXL/writer/core_writer.rb +0 -51
- data/lib/rubyXL/writer/root_rels_writer.rb +0 -25
- data/lib/rubyXL/writer/shared_strings_writer.rb +0 -30
- data/lib/rubyXL/writer/styles_writer.rb +0 -407
- data/lib/rubyXL/writer/theme_writer.rb +0 -343
- data/lib/rubyXL/writer/workbook_rels_writer.rb +0 -59
- data/lib/rubyXL/writer/workbook_writer.rb +0 -77
- data/lib/rubyXL/writer/worksheet_writer.rb +0 -230
- data/lib/rubyXL/zip.rb +0 -20
- data/spec/lib/hash_spec.rb +0 -28
data/spec/lib/cell_spec.rb
CHANGED
@@ -1,194 +1,299 @@
|
|
1
|
-
|
2
|
-
require 'rubyXL'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'bigdecimal'
|
5
|
+
require 'rubyXL/convenience_methods/font'
|
6
|
+
require 'rubyXL/convenience_methods/cell'
|
5
7
|
|
8
|
+
describe RubyXL::Cell do
|
6
9
|
before do
|
7
10
|
@workbook = RubyXL::Workbook.new
|
8
|
-
@worksheet =
|
11
|
+
@worksheet = @workbook.add_worksheet('Test Worksheet')
|
9
12
|
@workbook.worksheets << @worksheet
|
10
|
-
|
11
|
-
|
13
|
+
11.times do |i|
|
14
|
+
11.times do |j|
|
12
15
|
@worksheet.add_cell(i, j, "#{i}:#{j}")
|
13
16
|
end
|
14
17
|
end
|
15
18
|
@cell = @worksheet[0][0]
|
16
19
|
end
|
17
20
|
|
21
|
+
describe '.add_cell' do
|
22
|
+
it 'should properly assign data types' do
|
23
|
+
r = 4
|
24
|
+
c = 4
|
25
|
+
|
26
|
+
cell = @worksheet.add_cell(r, c, 123)
|
27
|
+
expect(cell.datatype).to be_nil
|
28
|
+
|
29
|
+
cell = @worksheet.add_cell(r, c, "#{r}:#{c}")
|
30
|
+
expect(cell.datatype).to eq(RubyXL::DataType::RAW_STRING)
|
31
|
+
|
32
|
+
cell = @worksheet.add_cell(r, c, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => 'Hello')))
|
33
|
+
expect(cell.datatype).to eq(RubyXL::DataType::INLINE_STRING)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should properly handle dates' do
|
37
|
+
r = 3
|
38
|
+
c = 3
|
39
|
+
|
40
|
+
dt = Date.today
|
41
|
+
cell = @worksheet.add_cell(r, c, dt)
|
42
|
+
cell.set_number_format('ddd mmm dd, yyyy')
|
43
|
+
expect(cell.value).to eq(dt)
|
44
|
+
|
45
|
+
tm = DateTime.now
|
46
|
+
cell = @worksheet.add_cell(r, c, tm)
|
47
|
+
cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
|
48
|
+
|
49
|
+
# Due to rounding errors, we allow microsecond precision on DateTime.
|
50
|
+
expect((cell.value - tm).to_f).to be_within(1.0 / 86400e6).of(0)
|
51
|
+
|
52
|
+
tm = Time.now
|
53
|
+
cell = @worksheet.add_cell(r, c, tm)
|
54
|
+
cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
|
55
|
+
|
56
|
+
# Due to rounding errors, we allow microsecond precision on Time.
|
57
|
+
expect(cell.value - tm.to_datetime).to be_within(1.0 / 86400e6).of(0)
|
58
|
+
|
59
|
+
expected_date = '2020-10-15T14:00:00Z'
|
60
|
+
expected_datetime = Time.parse(expected_date).utc
|
61
|
+
raw_value = '44119.583333333328' # Obtained from parsing a xlsx file with the expected date
|
62
|
+
cell = @worksheet.add_cell(r, c, Time.now) # Force a date cell type
|
63
|
+
cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
|
64
|
+
cell.raw_value = raw_value
|
65
|
+
expect(cell.raw_value).to eq(raw_value), 'Wrong raw value'
|
66
|
+
cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
|
67
|
+
|
68
|
+
# We expect exactly the same date
|
69
|
+
expect(cell.value.to_time.utc.iso8601).to eq(expected_datetime.iso8601)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'should raise against too long String' do
|
73
|
+
ok_data = 'A' * 32767 # The limit is 32767
|
74
|
+
|
75
|
+
expect {
|
76
|
+
@worksheet.add_cell(0, 1, ok_data) # 32767 -> OK
|
77
|
+
}.not_to raise_error
|
78
|
+
expect {
|
79
|
+
# 1 longer than the limit, so an exception must be thrown.
|
80
|
+
@worksheet.add_cell(0, 2, "#{ok_data}x")
|
81
|
+
}.to raise_error(ArgumentError)
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'should raise against too long RichText' do
|
85
|
+
ok_data = 'A' * 32767 # The limit is 32767
|
86
|
+
|
87
|
+
expect {
|
88
|
+
@worksheet.add_cell(0, 1, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => ok_data))) # 32767 -> OK
|
89
|
+
}.not_to raise_error
|
90
|
+
expect {
|
91
|
+
# 1 longer than the limit, so an exception must be thrown.
|
92
|
+
@worksheet.add_cell(0, 2, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => "#{ok_data}x")))
|
93
|
+
}.to raise_error(ArgumentError)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
18
97
|
describe '.change_fill' do
|
19
98
|
it 'should cause an error if hex color code not passed' do
|
20
|
-
|
99
|
+
expect {
|
21
100
|
@cell.change_fill('G')
|
22
|
-
}.
|
101
|
+
}.to raise_error(RuntimeError)
|
23
102
|
end
|
24
103
|
|
25
104
|
it 'should make cell fill color equal to hex color code passed' do
|
26
105
|
@cell.change_fill('0f0f0f')
|
27
|
-
@cell.fill_color.
|
106
|
+
expect(@cell.fill_color).to eq('0f0f0f')
|
28
107
|
end
|
29
108
|
|
30
109
|
it 'should cause an error if hex color code includes # character' do
|
31
|
-
|
110
|
+
expect {
|
32
111
|
@cell.change_fill('#0f0f0f')
|
33
|
-
}.
|
112
|
+
}.to raise_error(RuntimeError)
|
34
113
|
end
|
35
114
|
end
|
36
115
|
|
37
116
|
describe '.change_font_name' do
|
38
117
|
it 'should make font name match font name passed' do
|
39
118
|
@cell.change_font_name('Arial')
|
40
|
-
@cell.font_name.
|
119
|
+
expect(@cell.font_name).to eq('Arial')
|
41
120
|
end
|
42
121
|
end
|
43
122
|
|
44
123
|
describe '.change_font_size' do
|
45
124
|
it 'should make font size match number passed' do
|
46
125
|
@cell.change_font_size(30)
|
47
|
-
@cell.font_size.
|
126
|
+
expect(@cell.font_size).to eq(30)
|
48
127
|
end
|
49
128
|
|
50
129
|
it 'should cause an error if a string passed' do
|
51
|
-
|
130
|
+
expect {
|
52
131
|
@cell.change_font_size('20')
|
53
|
-
}.
|
132
|
+
}.to raise_error(RuntimeError)
|
54
133
|
end
|
55
134
|
end
|
56
135
|
|
57
136
|
describe '.change_font_color' do
|
58
137
|
it 'should cause an error if hex color code not passed' do
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
138
|
+
expect {
|
139
|
+
@cell.change_font_color('G')
|
140
|
+
}.to raise_error(RuntimeError)
|
141
|
+
end
|
63
142
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
143
|
+
it 'should make cell font color equal to hex color code passed' do
|
144
|
+
@cell.change_font_color('0f0f0f')
|
145
|
+
expect(@cell.font_color).to eq('0f0f0f')
|
146
|
+
end
|
68
147
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
148
|
+
it 'should cause an error if hex color code includes # character' do
|
149
|
+
expect {
|
150
|
+
@cell.change_font_color('#0f0f0f')
|
151
|
+
}.to raise_error(RuntimeError)
|
152
|
+
end
|
74
153
|
end
|
75
154
|
|
76
155
|
describe '.change_font_italics' do
|
77
156
|
it 'should make cell font italicized when true is passed' do
|
157
|
+
expect(@cell.is_italicized).to be_nil
|
78
158
|
@cell.change_font_italics(true)
|
79
|
-
@cell.is_italicized.
|
159
|
+
expect(@cell.is_italicized).to eq(true)
|
80
160
|
end
|
81
161
|
end
|
82
162
|
|
83
163
|
describe '.change_font_bold' do
|
84
164
|
it 'should make cell font bolded when true is passed' do
|
165
|
+
expect(@cell.is_bolded).to be_nil
|
85
166
|
@cell.change_font_bold(true)
|
86
|
-
@cell.is_bolded.
|
167
|
+
expect(@cell.is_bolded).to eq(true)
|
87
168
|
end
|
88
169
|
end
|
89
170
|
|
90
171
|
describe '.change_font_underline' do
|
91
172
|
it 'should make cell font underlined when true is passed' do
|
173
|
+
expect(@cell.is_underlined).to be_nil
|
92
174
|
@cell.change_font_underline(true)
|
93
|
-
@cell.is_underlined.
|
175
|
+
expect(@cell.is_underlined).to eq(true)
|
94
176
|
end
|
95
177
|
end
|
96
178
|
|
97
179
|
describe '.change_font_strikethrough' do
|
98
180
|
it 'should make cell font struckthrough when true is passed' do
|
181
|
+
expect(@cell.is_struckthrough).to be_nil
|
99
182
|
@cell.change_font_strikethrough(true)
|
100
|
-
@cell.is_struckthrough.
|
183
|
+
expect(@cell.is_struckthrough).to eq(true)
|
101
184
|
end
|
102
185
|
end
|
103
186
|
|
104
187
|
describe '.change_horizontal_alignment' do
|
105
188
|
it 'should cause cell to horizontally align as specified by the passed in string' do
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
it 'should cause error if nil, "center", "justify", "left", "right", or "distributed" is not passed' do
|
111
|
-
lambda {
|
112
|
-
@cell.change_horizontal_alignment('TEST')
|
113
|
-
}.should raise_error
|
114
|
-
end
|
189
|
+
expect(@cell.horizontal_alignment).to be_nil
|
190
|
+
@cell.change_horizontal_alignment('center')
|
191
|
+
expect(@cell.horizontal_alignment).to eq('center')
|
192
|
+
end
|
115
193
|
end
|
116
194
|
|
117
195
|
describe '.change_vertical_alignment' do
|
118
196
|
it 'should cause cell to vertically align as specified by the passed in string' do
|
119
|
-
|
120
|
-
|
121
|
-
|
197
|
+
expect(@cell.vertical_alignment).to be_nil
|
198
|
+
@cell.change_vertical_alignment('center')
|
199
|
+
expect(@cell.vertical_alignment).to eq('center')
|
200
|
+
end
|
201
|
+
end
|
122
202
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
203
|
+
describe '.change_wrap' do
|
204
|
+
it 'should cause cell to wrap align as specified by the passed in value' do
|
205
|
+
expect(@cell.text_wrap).to be_nil
|
206
|
+
@cell.change_text_wrap(true)
|
207
|
+
expect(@cell.text_wrap).to eq(true)
|
208
|
+
end
|
128
209
|
end
|
129
210
|
|
130
|
-
describe '.
|
131
|
-
it 'should cause cell to have
|
132
|
-
@cell.
|
133
|
-
@cell.
|
211
|
+
describe '.change_text_indent' do
|
212
|
+
it 'should cause the cell to have the corresponding text indent' do
|
213
|
+
expect(@cell.text_indent).to be_nil
|
214
|
+
@cell.change_text_indent(2)
|
215
|
+
expect(@cell.text_indent).to eq(2)
|
134
216
|
end
|
135
217
|
|
136
|
-
it 'should cause
|
137
|
-
|
138
|
-
|
139
|
-
|
218
|
+
it 'should not cause other cells with the same style to have text indent' do
|
219
|
+
another_cell = @worksheet[1][0]
|
220
|
+
another_cell.style_index = @cell.style_index
|
221
|
+
expect(another_cell.text_indent).to be_nil
|
222
|
+
@cell.change_text_indent(2)
|
223
|
+
expect(another_cell.text_indent).to be_nil
|
140
224
|
end
|
141
225
|
end
|
142
226
|
|
143
|
-
describe '.
|
144
|
-
it 'should cause cell to have
|
145
|
-
@cell.
|
146
|
-
@cell.
|
227
|
+
describe '.change_border_color' do
|
228
|
+
it 'should cause cell to have a colored top border' do
|
229
|
+
expect(@cell.get_border_color(:top)).to be_nil
|
230
|
+
@cell.change_border_color(:top, 'FF0000')
|
231
|
+
expect(@cell.get_border_color(:top)).to eq('FF0000')
|
147
232
|
end
|
148
233
|
|
149
|
-
it 'should cause
|
150
|
-
|
151
|
-
|
152
|
-
|
234
|
+
it 'should cause cell to have a colored bottom border' do
|
235
|
+
expect(@cell.get_border_color(:bottom)).to be_nil
|
236
|
+
@cell.change_border_color(:bottom, 'FF0000')
|
237
|
+
expect(@cell.get_border_color(:bottom)).to eq('FF0000')
|
153
238
|
end
|
154
|
-
end
|
155
239
|
|
156
|
-
|
157
|
-
|
158
|
-
@cell.
|
159
|
-
@cell.
|
240
|
+
it 'should cause cell to have a colored left border' do
|
241
|
+
expect(@cell.get_border_color(:left)).to be_nil
|
242
|
+
@cell.change_border_color(:left, 'FF0000')
|
243
|
+
expect(@cell.get_border_color(:left)).to eq('FF0000')
|
160
244
|
end
|
161
245
|
|
162
|
-
it 'should cause
|
163
|
-
|
164
|
-
|
165
|
-
|
246
|
+
it 'should cause cell to have a colored right border' do
|
247
|
+
expect(@cell.get_border_color(:right)).to be_nil
|
248
|
+
@cell.change_border_color(:right, 'FF0000')
|
249
|
+
expect(@cell.get_border_color(:right)).to eq('FF0000')
|
166
250
|
end
|
167
|
-
end
|
168
251
|
|
169
|
-
|
170
|
-
|
171
|
-
@cell.
|
172
|
-
@cell.
|
252
|
+
it 'should cause cell to have a colored diagonal border' do
|
253
|
+
expect(@cell.get_border_color(:diagonal)).to be_nil
|
254
|
+
@cell.change_border_color(:diagonal, 'FF0000')
|
255
|
+
expect(@cell.get_border_color(:diagonal)).to eq('FF0000')
|
173
256
|
end
|
174
257
|
|
175
|
-
it '
|
176
|
-
|
177
|
-
|
178
|
-
|
258
|
+
it 'is not overridden if the border style is set afterwards' do
|
259
|
+
expect(@cell.get_border_color(:top)).to be_nil
|
260
|
+
expect(@cell.get_border(:top)).to be_nil
|
261
|
+
@cell.change_border_color(:top, 'FF0000')
|
262
|
+
@cell.change_border(:top, 'thin')
|
263
|
+
expect(@cell.get_border_color(:top)).to eq('FF0000')
|
264
|
+
expect(@cell.get_border(:top)).to eq('thin')
|
179
265
|
end
|
180
266
|
end
|
181
267
|
|
182
|
-
describe '.
|
183
|
-
it 'should cause cell to have border at
|
184
|
-
@cell.
|
185
|
-
@cell.
|
268
|
+
describe '.change_border' do
|
269
|
+
it 'should cause cell to have border at top with specified weight' do
|
270
|
+
expect(@cell.get_border(:top)).to be_nil
|
271
|
+
@cell.change_border(:top, 'thin')
|
272
|
+
expect(@cell.get_border(:top)).to eq('thin')
|
186
273
|
end
|
187
274
|
|
188
|
-
it 'should cause
|
189
|
-
|
190
|
-
|
191
|
-
|
275
|
+
it 'should cause cell to have border at right with specified weight' do
|
276
|
+
expect(@cell.get_border(:right)).to be_nil
|
277
|
+
@cell.change_border(:right, 'thin')
|
278
|
+
expect(@cell.get_border(:right)).to eq('thin')
|
279
|
+
end
|
280
|
+
|
281
|
+
it 'should cause cell to have border at left with specified weight' do
|
282
|
+
expect(@cell.get_border(:left)).to be_nil
|
283
|
+
@cell.change_border(:left, 'thin')
|
284
|
+
expect(@cell.get_border(:left)).to eq('thin')
|
285
|
+
end
|
286
|
+
|
287
|
+
it 'should cause cell to have border at bottom with specified weight' do
|
288
|
+
expect(@cell.get_border(:bottom)).to be_nil
|
289
|
+
@cell.change_border(:bottom, 'thin')
|
290
|
+
expect(@cell.get_border(:bottom)).to eq('thin')
|
291
|
+
end
|
292
|
+
|
293
|
+
it 'should cause cell to have border at diagonal with specified weight' do
|
294
|
+
expect(@cell.get_border(:diagonal)).to be_nil
|
295
|
+
@cell.change_border(:diagonal, 'thin')
|
296
|
+
expect(@cell.get_border(:diagonal)).to eq('thin')
|
192
297
|
end
|
193
298
|
end
|
194
299
|
|
@@ -196,190 +301,328 @@ describe RubyXL::Cell do
|
|
196
301
|
it 'should return the value of a date' do
|
197
302
|
date = Date.parse('January 1, 2011')
|
198
303
|
@cell.change_contents(date)
|
199
|
-
@cell.
|
200
|
-
@cell.value.
|
304
|
+
expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
|
305
|
+
expect(@cell.value).to eq(date)
|
201
306
|
end
|
202
307
|
|
203
|
-
it 'should
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
@cell.
|
308
|
+
it 'should properly return value of inlineStr' do
|
309
|
+
cell = @worksheet.add_cell(5, 5, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => 'Hello')))
|
310
|
+
expect(cell.value).to eq('Hello')
|
311
|
+
end
|
312
|
+
|
313
|
+
it 'should properly handle numeric values' do
|
314
|
+
@cell.datatype = nil
|
315
|
+
@cell.raw_value = '1'
|
316
|
+
expect(@cell.value).to eq(1)
|
317
|
+
|
318
|
+
@cell.raw_value = '10000000'
|
319
|
+
expect(@cell.value).to eq(10000000)
|
320
|
+
|
321
|
+
@cell.raw_value = '-10'
|
322
|
+
expect(@cell.value).to eq(-10)
|
323
|
+
|
324
|
+
@cell.raw_value = '0'
|
325
|
+
expect(@cell.value).to eq(0)
|
326
|
+
|
327
|
+
@cell.raw_value = '0.001'
|
328
|
+
expect(@cell.value).to eq(0.001)
|
329
|
+
|
330
|
+
@cell.raw_value = '-0.00000000001'
|
331
|
+
expect(@cell.value).to eq(-0.00000000001)
|
332
|
+
|
333
|
+
@cell.raw_value = '1E5'
|
334
|
+
expect(@cell.value).to eq(100000.0)
|
335
|
+
|
336
|
+
@cell.raw_value = '1E0'
|
337
|
+
expect(@cell.value).to eq(1.0)
|
338
|
+
|
339
|
+
@cell.raw_value = '1E-5'
|
340
|
+
expect(@cell.value).to eq(0.00001)
|
341
|
+
|
342
|
+
@cell.raw_value = '-1E5'
|
343
|
+
expect(@cell.value).to eq(-100000.0)
|
344
|
+
|
345
|
+
@cell.raw_value = '-1E0'
|
346
|
+
expect(@cell.value).to eq(-1.0)
|
347
|
+
|
348
|
+
@cell.raw_value = '-1E-5'
|
349
|
+
expect(@cell.value).to eq(-0.00001)
|
350
|
+
|
351
|
+
@cell.raw_value = '1DE-5'
|
352
|
+
expect(@cell.value).to eq('1DE-5')
|
353
|
+
end
|
354
|
+
|
355
|
+
context '1900-based dates' do
|
356
|
+
before(:each) { @workbook.date1904 = false }
|
357
|
+
it 'should convert date numbers correctly' do
|
358
|
+
date = 41019
|
359
|
+
@cell.change_contents(date)
|
360
|
+
expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
|
361
|
+
expect(@cell.value).to eq(Date.parse('April 20, 2012'))
|
362
|
+
@cell.change_contents(35981)
|
363
|
+
expect(@cell.value).to eq(Date.parse('July 5, 1998'))
|
364
|
+
@cell.change_contents(0.019467592592592595)
|
365
|
+
expect(@cell.value).to eq(DateTime.parse('1899-12-31T00:28:02+00:00'))
|
366
|
+
@cell.change_contents(1)
|
367
|
+
expect(@cell.value).to eq(Date.parse('January 1, 1900'))
|
368
|
+
@cell.change_contents(59)
|
369
|
+
expect(@cell.value).to eq(Date.parse('February 28, 1900'))
|
370
|
+
@cell.change_contents(60)
|
371
|
+
# There's no way Ruby can return the nonexistent February 29th, so it has to be March 1st:
|
372
|
+
expect(@cell.value).to eq(Date.parse('March 1, 1900'))
|
373
|
+
@cell.change_contents(61)
|
374
|
+
expect(@cell.value).to eq(Date.parse('March 1, 1900'))
|
375
|
+
end
|
376
|
+
end
|
377
|
+
|
378
|
+
context '1904-based dates' do
|
379
|
+
before(:each) { @workbook.date1904 = true }
|
380
|
+
it 'should convert date numbers correctly' do
|
381
|
+
date = 39557
|
382
|
+
@cell.change_contents(date)
|
383
|
+
expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
|
384
|
+
expect(@cell.value).to eq(Date.parse('April 20, 2012'))
|
385
|
+
@cell.change_contents(34519)
|
386
|
+
expect(@cell.value).to eq(Date.parse('July 5, 1998'))
|
387
|
+
end
|
388
|
+
end
|
389
|
+
|
390
|
+
context 'date before January 1, 1900' do
|
391
|
+
it 'should parse as date' do
|
392
|
+
@cell.set_number_format('h:mm:ss')
|
393
|
+
@cell.datatype = nil
|
394
|
+
|
395
|
+
@cell.raw_value = '0.97726851851851848'
|
396
|
+
expect(@cell.is_date?).to be(true)
|
397
|
+
expect(@cell.value).to eq(DateTime.parse('1899-12-31 23:27:16'))
|
398
|
+
@cell.raw_value = '1.9467592592592595E-2'
|
399
|
+
expect(@cell.is_date?).to be(true)
|
400
|
+
expect(@cell.value).to eq(DateTime.parse('1899-12-31 00:28:02'))
|
401
|
+
end
|
402
|
+
end
|
403
|
+
|
404
|
+
context 'with RichText' do
|
405
|
+
it 'returns the value of the RichText' do
|
406
|
+
cell = RubyXL::Cell.new(is: RubyXL::RichText.new(t: RubyXL::Text.new(value: 'test')))
|
407
|
+
expect(cell.value).to eq('test')
|
408
|
+
end
|
210
409
|
end
|
211
410
|
end
|
212
411
|
|
213
412
|
describe '.change_contents' do
|
214
413
|
it 'should cause cell value to match string or number that is passed in' do
|
215
414
|
@cell.change_contents('TEST')
|
216
|
-
@cell.value.
|
217
|
-
@cell.formula.
|
415
|
+
expect(@cell.value).to eq('TEST')
|
416
|
+
expect(@cell.formula).to be_nil
|
218
417
|
end
|
219
418
|
|
220
419
|
it 'should cause cell value to match a date that is passed in' do
|
221
420
|
date = Date.parse('January 1, 2011')
|
222
421
|
@cell.change_contents(date)
|
223
|
-
@cell.
|
224
|
-
@cell.value.
|
225
|
-
@cell.
|
422
|
+
expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
|
423
|
+
expect(@cell.value).to eq(date)
|
424
|
+
expect(@cell.datatype).to be_nil
|
425
|
+
expect(@cell.formula).to be_nil
|
426
|
+
end
|
427
|
+
|
428
|
+
it 'should cause cell value to match a time that is passed in' do
|
429
|
+
time = Time.parse('January 1, 2011')
|
430
|
+
@cell.change_contents(time)
|
431
|
+
expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
|
432
|
+
expect(@cell.value).to eq(time.to_datetime)
|
433
|
+
expect(@cell.datatype).to be_nil
|
434
|
+
expect(@cell.formula).to be_nil
|
435
|
+
end
|
436
|
+
|
437
|
+
it 'should case cell value to match a Float that is passed in' do
|
438
|
+
number = 1.25
|
439
|
+
@cell.change_contents(number)
|
440
|
+
expect(@cell.value).to eq(number)
|
441
|
+
expect(@cell.datatype).to be_nil
|
442
|
+
expect(@cell.formula).to be_nil
|
443
|
+
end
|
444
|
+
|
445
|
+
it 'should case cell value to match an Integer that is passed in' do
|
446
|
+
number = 1234567
|
447
|
+
@cell.change_contents(number)
|
448
|
+
expect(@cell.value).to eq(number)
|
449
|
+
expect(@cell.datatype).to be_nil
|
450
|
+
expect(@cell.formula).to be_nil
|
451
|
+
end
|
452
|
+
|
453
|
+
it 'should cause cell value to match a BigDecimal that is passed in' do
|
454
|
+
number = BigDecimal('1234.5678')
|
455
|
+
@cell.change_contents(number)
|
456
|
+
expect(@cell.value).to eq(number)
|
457
|
+
expect(@cell.datatype).to be_nil
|
458
|
+
expect(@cell.formula).to be_nil
|
226
459
|
end
|
227
460
|
|
228
461
|
it 'should cause cell value and formula to match what is passed in' do
|
229
462
|
@cell.change_contents(nil, 'SUM(A2:A4)')
|
230
|
-
@cell.value.
|
231
|
-
@cell.formula.
|
463
|
+
expect(@cell.value).to be_nil
|
464
|
+
expect(@cell.formula.expression).to eq('SUM(A2:A4)')
|
232
465
|
end
|
233
466
|
end
|
234
467
|
|
235
468
|
describe '.is_italicized' do
|
236
469
|
it 'should correctly return whether or not the cell\'s font is italicized' do
|
237
470
|
@cell.change_font_italics(true)
|
238
|
-
@cell.is_italicized.
|
471
|
+
expect(@cell.is_italicized).to eq(true)
|
239
472
|
end
|
240
473
|
end
|
241
474
|
|
242
475
|
describe '.is_bolded' do
|
243
476
|
it 'should correctly return whether or not the cell\'s font is bolded' do
|
244
477
|
@cell.change_font_bold(true)
|
245
|
-
@cell.is_bolded.
|
478
|
+
expect(@cell.is_bolded).to eq(true)
|
246
479
|
end
|
247
480
|
end
|
248
481
|
|
249
482
|
describe '.is_underlined' do
|
250
483
|
it 'should correctly return whether or not the cell\'s font is underlined' do
|
251
484
|
@cell.change_font_underline(true)
|
252
|
-
@cell.is_underlined.
|
485
|
+
expect(@cell.is_underlined).to eq(true)
|
253
486
|
end
|
254
487
|
end
|
255
488
|
|
256
489
|
describe '.is_struckthrough' do
|
257
490
|
it 'should correctly return whether or not the cell\'s font is struckthrough' do
|
258
491
|
@cell.change_font_strikethrough(true)
|
259
|
-
@cell.is_struckthrough.
|
492
|
+
expect(@cell.is_struckthrough).to eq(true)
|
260
493
|
end
|
261
494
|
end
|
262
495
|
|
263
496
|
describe '.font_name' do
|
264
497
|
it 'should correctly return the name of the cell\'s font' do
|
265
498
|
@cell.change_font_name('Verdana')
|
266
|
-
@cell.font_name.
|
499
|
+
expect(@cell.font_name).to eq('Verdana')
|
267
500
|
end
|
268
501
|
end
|
269
502
|
|
270
503
|
describe '.font_size' do
|
271
504
|
it 'should correctly return the size of the cell\'s font' do
|
272
505
|
@cell.change_font_size(20)
|
273
|
-
@cell.font_size.
|
506
|
+
expect(@cell.font_size).to eq(20)
|
274
507
|
end
|
275
508
|
end
|
276
509
|
|
277
510
|
describe '.font_color' do
|
278
511
|
it 'should correctly return the color of the cell\'s font' do
|
279
512
|
@cell.change_font_color('0f0f0f')
|
280
|
-
@cell.font_color.
|
513
|
+
expect(@cell.font_color).to eq('0f0f0f')
|
281
514
|
end
|
282
515
|
|
283
516
|
it 'should return 000000 (black) if no font color has been specified for this cell' do
|
284
|
-
@cell.font_color.
|
517
|
+
expect(@cell.font_color).to eq('000000')
|
285
518
|
end
|
286
519
|
end
|
287
520
|
|
288
521
|
describe '.fill_color' do
|
289
522
|
it 'should correctly return the color of the cell\'s fill' do
|
290
523
|
@cell.change_fill('000000')
|
291
|
-
@cell.fill_color.
|
524
|
+
expect(@cell.fill_color).to eq('000000')
|
292
525
|
end
|
293
526
|
|
294
527
|
it 'should return ffffff (white) if no fill color has been specified for this cell' do
|
295
|
-
@cell.fill_color.
|
528
|
+
expect(@cell.fill_color).to eq('ffffff')
|
296
529
|
end
|
297
530
|
end
|
298
531
|
|
299
532
|
describe '.horizontal_alignment' do
|
300
533
|
it 'should correctly return the type of horizontal alignment of this cell' do
|
301
534
|
@cell.change_horizontal_alignment('center')
|
302
|
-
@cell.horizontal_alignment.
|
535
|
+
expect(@cell.horizontal_alignment).to eq('center')
|
303
536
|
end
|
304
537
|
|
305
538
|
it 'should return nil if no horizontal alignment has been specified for this cell' do
|
306
|
-
@cell.horizontal_alignment.
|
539
|
+
expect(@cell.horizontal_alignment).to be_nil
|
540
|
+
end
|
541
|
+
|
542
|
+
it 'should not create new XFs when changing alignment to already existing values' do
|
543
|
+
@cell.change_horizontal_alignment('left')
|
544
|
+
style_xf1 = @cell.style_index
|
545
|
+
@cell.change_horizontal_alignment('right')
|
546
|
+
expect(@cell.style_index).not_to eq(style_xf1)
|
547
|
+
style_xf2 = @cell.style_index
|
548
|
+
@cell.change_horizontal_alignment('left')
|
549
|
+
expect(@cell.style_index).to eq(style_xf1)
|
550
|
+
@cell.change_horizontal_alignment('right')
|
551
|
+
expect(@cell.style_index).to eq(style_xf2)
|
307
552
|
end
|
308
553
|
end
|
309
554
|
|
310
555
|
describe '.vertical_alignment' do
|
311
556
|
it 'should correctly return the type of vertical alignment of this cell' do
|
312
557
|
@cell.change_vertical_alignment('center')
|
313
|
-
@cell.vertical_alignment.
|
558
|
+
expect(@cell.vertical_alignment).to eq('center')
|
314
559
|
end
|
315
560
|
|
316
561
|
it 'should return nil if no vertical alignment has been specified for this cell' do
|
317
|
-
@cell.vertical_alignment.
|
562
|
+
expect(@cell.vertical_alignment).to be_nil
|
318
563
|
end
|
319
564
|
end
|
320
565
|
|
321
566
|
describe '.border_top' do
|
322
567
|
it 'should correctly return the weight of the border on top for this cell' do
|
323
|
-
@cell.
|
324
|
-
@cell.
|
568
|
+
@cell.change_border(:top, 'thin')
|
569
|
+
expect(@cell.get_border(:top)).to eq('thin')
|
325
570
|
end
|
326
571
|
|
327
572
|
it 'should return nil if no top border has been specified for this cell' do
|
328
|
-
@cell.
|
573
|
+
expect(@cell.get_border(:top)).to be_nil
|
329
574
|
end
|
330
575
|
end
|
331
576
|
|
332
577
|
describe '.border_left' do
|
333
578
|
it 'should correctly return the weight of the border on left for this cell' do
|
334
|
-
@cell.
|
335
|
-
@cell.
|
579
|
+
@cell.change_border(:left, 'thin')
|
580
|
+
expect(@cell.get_border(:left)).to eq('thin')
|
336
581
|
end
|
337
582
|
|
338
583
|
it 'should return nil if no left border has been specified for this cell' do
|
339
|
-
@cell.
|
584
|
+
expect(@cell.get_border(:left)).to be_nil
|
340
585
|
end
|
341
586
|
end
|
342
587
|
|
343
588
|
describe '.border_right' do
|
344
589
|
it 'should correctly return the weight of the border on right for this cell' do
|
345
|
-
@cell.
|
346
|
-
@cell.
|
590
|
+
@cell.change_border(:right, 'thin')
|
591
|
+
expect(@cell.get_border(:right)).to eq('thin')
|
347
592
|
end
|
348
593
|
|
349
594
|
it 'should return nil if no right border has been specified for this cell' do
|
350
|
-
@cell.
|
595
|
+
expect(@cell.get_border(:right)).to be_nil
|
351
596
|
end
|
352
597
|
end
|
353
598
|
|
354
599
|
describe '.border_bottom' do
|
355
600
|
it 'should correctly return the weight of the border on bottom for this cell' do
|
356
|
-
@cell.
|
357
|
-
@cell.
|
601
|
+
@cell.change_border(:bottom, 'thin')
|
602
|
+
expect(@cell.get_border(:bottom)).to eq('thin')
|
358
603
|
end
|
359
604
|
|
360
605
|
it 'should return nil if no bottom border has been specified for this cell' do
|
361
|
-
@cell.
|
606
|
+
expect(@cell.get_border(:bottom)).to be_nil
|
362
607
|
end
|
363
608
|
end
|
364
609
|
|
365
610
|
describe '.border_diagonal' do
|
366
611
|
it 'should correctly return the weight of the diagonal border for this cell' do
|
367
|
-
@cell.
|
368
|
-
@cell.
|
612
|
+
@cell.change_border(:diagonal, 'thin')
|
613
|
+
expect(@cell.get_border(:diagonal)).to eq('thin')
|
369
614
|
end
|
370
615
|
|
371
616
|
it 'should return nil if no diagonal border has been specified for this cell' do
|
372
|
-
@cell.
|
617
|
+
expect(@cell.get_border(:diagonal)).to be_nil
|
373
618
|
end
|
374
619
|
end
|
375
620
|
|
376
|
-
describe '.
|
377
|
-
it 'should correctly return the
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
it 'should cause an error if a negative argument is given' do
|
382
|
-
lambda {RubyXL::Cell.convert_to_cell(-1,0)}.should raise_error
|
621
|
+
describe '.text_rotation' do
|
622
|
+
it 'should correctly return the rotation for this cell' do
|
623
|
+
expect(@cell.text_rotation).to be_nil
|
624
|
+
@cell.change_text_rotation(45)
|
625
|
+
expect(@cell.text_rotation).to eq(45)
|
383
626
|
end
|
384
627
|
end
|
385
628
|
end
|