diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-10 11:45:57 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-04-10 11:45:57 +0200 |
| commit | 84a2b255d6fd780f526ac3d9bf99a40f08792986 (patch) | |
| tree | cea31975973b14e6a7e2879bd43a561ad0bfa59d | |
| parent | 1406b47e64188765f220be86001ec1f543e0157d (diff) | |
| download | caxlsx-84a2b255d6fd780f526ac3d9bf99a40f08792986.tar.gz caxlsx-84a2b255d6fd780f526ac3d9bf99a40f08792986.zip | |
Fix Layout/LeadingCommentSpace offenses
```
rubocop --only Layout/LeadingCommentSpace -a
```
51 files changed, 218 insertions, 224 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d03f2431..552d2f0c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -56,12 +56,6 @@ Layout/HeredocIndentation: - 'lib/axlsx/drawing/vml_drawing.rb' - 'lib/axlsx/drawing/vml_shape.rb' -# Offense count: 218 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. -Layout/LeadingCommentSpace: - Enabled: false - # Offense count: 1 Lint/AmbiguousAssignment: Exclude: diff --git a/lib/axlsx.rb b/lib/axlsx.rb index a12bf08a..2ee8a1d8 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -21,11 +21,11 @@ require 'axlsx/rels/relationships.rb' require 'axlsx/drawing/drawing.rb' require 'axlsx/workbook/workbook.rb' require 'axlsx/package.rb' -#required gems +# required gems require 'nokogiri' require 'zip' -#core dependencies +# core dependencies require 'bigdecimal' require 'set' require 'time' @@ -75,7 +75,7 @@ module Axlsx cells.sort_by(&:pos) end - #global reference html entity encoding + # global reference html entity encoding # @return [HtmlEntities] def self.coder @@coder ||= ::HTMLEntities.new diff --git a/lib/axlsx/drawing/bar_3D_chart.rb b/lib/axlsx/drawing/bar_3D_chart.rb index 6ec95d8d..89544be0 100644 --- a/lib/axlsx/drawing/bar_3D_chart.rb +++ b/lib/axlsx/drawing/bar_3D_chart.rb @@ -39,7 +39,7 @@ module Axlsx end alias :gapWidth :gap_width - #grouping for a column, line, or area chart. + # grouping for a column, line, or area chart. # must be one of [:percentStacked, :clustered, :standard, :stacked] # @return [Symbol] def grouping @@ -87,7 +87,7 @@ module Axlsx end alias :barDir= :bar_dir= - #grouping for a column, line, or area chart. + # grouping for a column, line, or area chart. # must be one of [:percentStacked, :clustered, :standard, :stacked] def grouping=(v) RestrictionValidator.validate "Bar3DChart.grouping", [:percentStacked, :clustered, :standard, :stacked], v diff --git a/lib/axlsx/drawing/bar_chart.rb b/lib/axlsx/drawing/bar_chart.rb index f77eb7c1..1ed38332 100644 --- a/lib/axlsx/drawing/bar_chart.rb +++ b/lib/axlsx/drawing/bar_chart.rb @@ -34,7 +34,7 @@ module Axlsx end alias :gapWidth :gap_width - #grouping for a column, line, or area chart. + # grouping for a column, line, or area chart. # must be one of [:percentStacked, :clustered, :standard, :stacked] # @return [Symbol] def grouping @@ -79,7 +79,7 @@ module Axlsx end alias :barDir= :bar_dir= - #grouping for a column, line, or area chart. + # grouping for a column, line, or area chart. # must be one of [:percentStacked, :clustered, :standard, :stacked] def grouping=(v) RestrictionValidator.validate "BarChart.grouping", [:percentStacked, :clustered, :standard, :stacked], v diff --git a/lib/axlsx/drawing/cat_axis.rb b/lib/axlsx/drawing/cat_axis.rb index ded05ee8..75290da0 100644 --- a/lib/axlsx/drawing/cat_axis.rb +++ b/lib/axlsx/drawing/cat_axis.rb @@ -1,5 +1,5 @@ module Axlsx - #A CatAxis object defines a chart category axis + # A CatAxis object defines a chart category axis class CatAxis < Axis # Creates a new CatAxis object # @option options [Integer] tick_lbl_skip diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb index e64163d9..e9f4441f 100644 --- a/lib/axlsx/drawing/chart.rb +++ b/lib/axlsx/drawing/chart.rb @@ -49,7 +49,7 @@ module Axlsx # @return [Series] attr_reader :series_type - #TODO data labels! + # TODO data labels! def d_lbls @d_lbls ||= DLbls.new(self.class) end diff --git a/lib/axlsx/drawing/d_lbls.rb b/lib/axlsx/drawing/d_lbls.rb index 3e51d021..358378c5 100644 --- a/lib/axlsx/drawing/d_lbls.rb +++ b/lib/axlsx/drawing/d_lbls.rb @@ -2,7 +2,7 @@ module Axlsx # There are more elements in the dLbls spec that allow for # customizations and formatting. For now, I am just implementing the # basics. - #The DLbls class manages serialization of data labels + # The DLbls class manages serialization of data labels # showLeaderLines and leaderLines are not currently implemented class DLbls include Axlsx::Accessors diff --git a/lib/axlsx/drawing/hyperlink.rb b/lib/axlsx/drawing/hyperlink.rb index 979fdd6a..4d3b343d 100644 --- a/lib/axlsx/drawing/hyperlink.rb +++ b/lib/axlsx/drawing/hyperlink.rb @@ -6,7 +6,7 @@ module Axlsx include Axlsx::SerializedAttributes include Axlsx::OptionsParser - #Creates a hyperlink object + # Creates a hyperlink object # parent must be a Pic for now, although I expect that other object support this tag and its cNvPr parent # @param [Pic] parent # @option options [String] tooltip message shown when hyperlinked object is hovered over with mouse. @@ -38,7 +38,7 @@ module Axlsx alias :invalidUrl :invalid_url alias :invalidUrl= :invalid_url= - #An action to take when the link is clicked. The specification says "This can be used to specify a slide to be navigated to or a script of code to be run." but in most cases you will not need to do anything with this. MS does reserve a few interesting strings. @see http://msdn.microsoft.com/en-us/library/ff532419%28v=office.12%29.aspx + # An action to take when the link is clicked. The specification says "This can be used to specify a slide to be navigated to or a script of code to be run." but in most cases you will not need to do anything with this. MS does reserve a few interesting strings. @see http://msdn.microsoft.com/en-us/library/ff532419%28v=office.12%29.aspx # @return [String] attr_accessor :action diff --git a/lib/axlsx/drawing/num_data.rb b/lib/axlsx/drawing/num_data.rb index 140cfb9f..7239ac5f 100644 --- a/lib/axlsx/drawing/num_data.rb +++ b/lib/axlsx/drawing/num_data.rb @@ -1,5 +1,5 @@ module Axlsx - #This class specifies data for a particular data point. It is used for both numCache and numLit object + # This class specifies data for a particular data point. It is used for both numCache and numLit object class NumData include Axlsx::OptionsParser diff --git a/lib/axlsx/drawing/num_val.rb b/lib/axlsx/drawing/num_val.rb index c03a0fa1..f4b2c399 100644 --- a/lib/axlsx/drawing/num_val.rb +++ b/lib/axlsx/drawing/num_val.rb @@ -1,5 +1,5 @@ module Axlsx - #This class specifies data for a particular data point. + # This class specifies data for a particular data point. class NumVal < StrVal # A string representing the format code to apply. # For more information see see the SpreadsheetML numFmt element's (§18.8.30) formatCode attribute. diff --git a/lib/axlsx/drawing/pic.rb b/lib/axlsx/drawing/pic.rb index 64e5a877..fb4d01fe 100644 --- a/lib/axlsx/drawing/pic.rb +++ b/lib/axlsx/drawing/pic.rb @@ -194,7 +194,7 @@ module Axlsx swap_anchor(new_anchor) end - #changes the anchor type to a two cell anchor + # changes the anchor type to a two cell anchor def use_two_cell_anchor return if @anchor.is_a?(TwoCellAnchor) diff --git a/lib/axlsx/drawing/ser_axis.rb b/lib/axlsx/drawing/ser_axis.rb index b5844454..f49c1301 100644 --- a/lib/axlsx/drawing/ser_axis.rb +++ b/lib/axlsx/drawing/ser_axis.rb @@ -1,5 +1,5 @@ module Axlsx - #A SerAxis object defines a series axis + # A SerAxis object defines a series axis class SerAxis < Axis # The number of tick lables to skip between labels # @return [Integer] diff --git a/lib/axlsx/drawing/str_data.rb b/lib/axlsx/drawing/str_data.rb index 843c90a7..5ea8a892 100644 --- a/lib/axlsx/drawing/str_data.rb +++ b/lib/axlsx/drawing/str_data.rb @@ -1,5 +1,5 @@ module Axlsx - #This specifies the last string data used for a chart. (e.g. strLit and strCache) + # This specifies the last string data used for a chart. (e.g. strLit and strCache) # This class is extended for NumData to include the formatCode attribute required for numLit and numCache class StrData include Axlsx::OptionsParser diff --git a/lib/axlsx/drawing/str_val.rb b/lib/axlsx/drawing/str_val.rb index 4a85d256..e5c851ee 100644 --- a/lib/axlsx/drawing/str_val.rb +++ b/lib/axlsx/drawing/str_val.rb @@ -1,5 +1,5 @@ module Axlsx - #This class specifies data for a particular data point. + # This class specifies data for a particular data point. class StrVal include Axlsx::OptionsParser diff --git a/lib/axlsx/drawing/title.rb b/lib/axlsx/drawing/title.rb index e1b0d7f8..92294a06 100644 --- a/lib/axlsx/drawing/title.rb +++ b/lib/axlsx/drawing/title.rb @@ -60,9 +60,9 @@ module Axlsx end # Not implemented at this time. - #def layout=(v) DataTypeValidator.validate 'Title.layout', Layout, v; @layout = v; end - #def overlay=(v) Axlsx::validate_boolean v; @overlay=v; end - #def spPr=(v) DataTypeValidator.validate 'Title.spPr', SpPr, v; @spPr = v; end + # def layout=(v) DataTypeValidator.validate 'Title.layout', Layout, v; @layout = v; end + # def overlay=(v) Axlsx::validate_boolean v; @overlay=v; end + # def spPr=(v) DataTypeValidator.validate 'Title.spPr', SpPr, v; @spPr = v; end # Serializes the object # @param [String] str diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index c3805a5c..02ab184c 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -231,8 +231,8 @@ module Axlsx workbook.pivot_tables.each do |pivot_table| cache_definition = pivot_table.cache_definition parts << { :entry => "xl/#{pivot_table.rels_pn}", :doc => pivot_table.relationships, :schema => RELS_XSD } - parts << { :entry => "xl/#{pivot_table.pn}", :doc => pivot_table } #, :schema => SML_XSD} - parts << { :entry => "xl/#{cache_definition.pn}", :doc => cache_definition } #, :schema => SML_XSD} + parts << { :entry => "xl/#{pivot_table.pn}", :doc => pivot_table } # , :schema => SML_XSD} + parts << { :entry => "xl/#{cache_definition.pn}", :doc => cache_definition } # , :schema => SML_XSD} end workbook.comments.each do |comment| diff --git a/lib/axlsx/stylesheet/border_pr.rb b/lib/axlsx/stylesheet/border_pr.rb index 8300f4bc..3f1054f2 100644 --- a/lib/axlsx/stylesheet/border_pr.rb +++ b/lib/axlsx/stylesheet/border_pr.rb @@ -45,9 +45,9 @@ module Axlsx # @see Axlsx::Border def initialize(options = {}) parse_options(options) - #options.each do |o| + # options.each do |o| # self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" - #end + # end end # @see name diff --git a/lib/axlsx/stylesheet/color.rb b/lib/axlsx/stylesheet/color.rb index 4f358a78..d6d204bf 100644 --- a/lib/axlsx/stylesheet/color.rb +++ b/lib/axlsx/stylesheet/color.rb @@ -37,7 +37,7 @@ module Axlsx # no support for theme just yet # @return [Integer] - #attr_reader :theme + # attr_reader :theme # The tint value. # @note valid values are between -1.0 and 1.0 diff --git a/lib/axlsx/stylesheet/dxf.rb b/lib/axlsx/stylesheet/dxf.rb index a3f15581..516894df 100644 --- a/lib/axlsx/stylesheet/dxf.rb +++ b/lib/axlsx/stylesheet/dxf.rb @@ -7,7 +7,7 @@ module Axlsx # The order in which the child elements is put in the XML seems to # be important for Excel CHILD_ELEMENTS = [:font, :numFmt, :fill, :alignment, :border, :protection] - #does not support extList (ExtensionList) + # does not support extList (ExtensionList) # The cell alignment for this style # @return [CellAlignment] diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index 2a210776..ca2c7a8c 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -17,7 +17,7 @@ module Axlsx require 'axlsx/stylesheet/xf.rb' require 'axlsx/stylesheet/cell_protection.rb' - #The Styles class manages worksheet styles + # The Styles class manages worksheet styles # In addition to creating the require style objects for a valid xlsx package, this class provides the key mechanism for adding styles to your workbook, and safely applying them to the cells of your worksheet. # All portions of the stylesheet are implemented here exception colors, which specify legacy and modified pallete colors, and exLst, whic is used as a future feature data storage area. # @see Office Open XML Part 1 18.8.11 for gory details on how this stuff gets put together @@ -468,10 +468,10 @@ module Axlsx def parse_num_fmt_options(options = {}) return if (options.keys & [:format_code, :num_fmt]).empty? - #When the user provides format_code - we always need to create a new numFmt object - #When the type is :dxf we always need to create a new numFmt object + # When the user provides format_code - we always need to create a new numFmt object + # When the type is :dxf we always need to create a new numFmt object if options[:format_code] || options[:type] == :dxf - #If this is a standard xf we pull from numFmts the highest current and increment for num_fmt + # If this is a standard xf we pull from numFmts the highest current and increment for num_fmt options[:num_fmt] ||= (@numFmts.map { |num_fmt| num_fmt.numFmtId }.max + 1) if options[:type] != :dxf numFmt = NumFmt.new(:numFmtId => options[:num_fmt] || 0, :formatCode => options[:format_code].to_s) options[:type] == :dxf ? numFmt : (numFmts << numFmt; numFmt.numFmtId) diff --git a/lib/axlsx/stylesheet/xf.rb b/lib/axlsx/stylesheet/xf.rb index e7a84a46..e58608f7 100644 --- a/lib/axlsx/stylesheet/xf.rb +++ b/lib/axlsx/stylesheet/xf.rb @@ -2,7 +2,7 @@ module Axlsx # The Xf class defines a formatting record for use in Styles. The recommended way to manage styles for your workbook is with Styles#add_style # @see Styles#add_style class Xf - #does not support extList (ExtensionList) + # does not support extList (ExtensionList) include Axlsx::SerializedAttributes include Axlsx::OptionsParser diff --git a/lib/axlsx/util/constants.rb b/lib/axlsx/util/constants.rb index 7a49a0eb..55e2b58f 100644 --- a/lib/axlsx/util/constants.rb +++ b/lib/axlsx/util/constants.rb @@ -95,7 +95,7 @@ module Axlsx # comment relation for nil target COMMENT_R_NULL = "http://purl.oclc.org/ooxml/officeDocument/relationships/comments".freeze - #vml drawing relation namespace + # vml drawing relation namespace VML_DRAWING_R = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing' # VML Drawing content type @@ -158,7 +158,7 @@ module Axlsx # png content type PNG_CT = "image/png".freeze - #drawing content type + # drawing content type DRAWING_CT = "application/vnd.openxmlformats-officedocument.drawing+xml".freeze # xml content type extensions diff --git a/lib/axlsx/workbook/defined_name.rb b/lib/axlsx/workbook/defined_name.rb index 2632e8ef..d3b6e1ef 100644 --- a/lib/axlsx/workbook/defined_name.rb +++ b/lib/axlsx/workbook/defined_name.rb @@ -2,9 +2,9 @@ # <definedName name="_xlnm.Print_Titles" localSheetId="0">Sheet1!$1:$1</definedName> # </definedNames> -#<xsd:complexType name="CT_DefinedName"> +# <xsd:complexType name="CT_DefinedName"> # <xsd:simpleContent> -# <xsd:extension base="ST_Formula"> +#  <xsd:extension base="ST_Formula"> # <xsd:attribute name="name" type="s:ST_Xstring" use="required"/> # <xsd:attribute name="comment" type="s:ST_Xstring" use="optional"/> # <xsd:attribute name="customMenu" type="s:ST_Xstring" use="optional"/> diff --git a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb index 9e753759..bf3426b6 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb @@ -2,7 +2,7 @@ require 'axlsx/workbook/worksheet/auto_filter/filter_column.rb' require 'axlsx/workbook/worksheet/auto_filter/filters.rb' module Axlsx - #This class represents an auto filter range in a worksheet + # This class represents an auto filter range in a worksheet class AutoFilter # creates a new Autofilter object # @param [Worksheet] worksheet diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb index 1fa2ff78..32a9df26 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb @@ -16,7 +16,7 @@ module Axlsx # @option [Boolean] show_button @see show_button def initialize(col_id, filter_type, options = {}) RestrictionValidator.validate 'FilterColumn.filter', FILTERS, filter_type - #Axlsx::validate_unsigned_int(col_id) + # Axlsx::validate_unsigned_int(col_id) self.col_id = col_id parse_options options @filter = Axlsx.const_get(Axlsx.camel(filter_type)).new(options) @@ -26,7 +26,7 @@ module Axlsx serializable_attributes :col_id, :hidden_button, :show_button # Allowed filters - FILTERS = [:filters] #, :top10, :custom_filters, :dynamic_filters, :color_filters, :icon_filters] + FILTERS = [:filters] # , :top10, :custom_filters, :dynamic_filters, :color_filters, :icon_filters] # Zero-based index indicating the AutoFilter column to which this filter information applies. # @return [Integer] diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb index 554df012..83da2da2 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb @@ -113,7 +113,7 @@ module Axlsx @val = value end - #Filter value used in the criteria. + # Filter value used in the criteria. attr_accessor :val # Serializes the filter value object diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index cc668208..364de1e9 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -150,7 +150,7 @@ module Axlsx # @see value def value=(v) - #TODO: consider doing value based type determination first? + # TODO: consider doing value based type determination first? @value = cast_value(v) end @@ -537,7 +537,7 @@ module Axlsx when :boolean v ? 1 : 0 when :iso_8601 - #consumer is responsible for ensuring the iso_8601 format when specifying this type + # consumer is responsible for ensuring the iso_8601 format when specifying this type v else v.to_s diff --git a/lib/axlsx/workbook/worksheet/cfvos.rb b/lib/axlsx/workbook/worksheet/cfvos.rb index 44db4dfd..c5fa80f3 100644 --- a/lib/axlsx/workbook/worksheet/cfvos.rb +++ b/lib/axlsx/workbook/worksheet/cfvos.rb @@ -1,6 +1,6 @@ module Axlsx - #A collection of Cfvo objects that initializes with the required - #first two items + # A collection of Cfvo objects that initializes with the required + # first two items class Cfvos < SimpleTypedList def initialize super(Cfvo) diff --git a/lib/axlsx/workbook/worksheet/col.rb b/lib/axlsx/workbook/worksheet/col.rb index da3a9364..37c38365 100644 --- a/lib/axlsx/workbook/worksheet/col.rb +++ b/lib/axlsx/workbook/worksheet/col.rb @@ -111,7 +111,7 @@ module Axlsx # is to only set this if a calculated value is greated than the # current @width value. # TODO!!! - #Axlsx.validate_unsigned_numeric(v) unless v == nil + # Axlsx.validate_unsigned_numeric(v) unless v == nil @custom_width = @best_fit = v != nil @width = v.nil? ? v : [v, MAX_WIDTH].min end diff --git a/lib/axlsx/workbook/worksheet/page_setup.rb b/lib/axlsx/workbook/worksheet/page_setup.rb index 6b07466e..c10e28ce 100644 --- a/lib/axlsx/workbook/worksheet/page_setup.rb +++ b/lib/axlsx/workbook/worksheet/page_setup.rb @@ -64,120 +64,120 @@ module Axlsx attr_reader :scale # The paper size to use in printing - #1 = Letter paper (8.5 in. by 11 in.) - #2 = Letter small paper (8.5 in. by 11 in.) - #3 = Tabloid paper (11 in. by 17 in.) - #4 = Ledger paper (17 in. by 11 in.) - #5 = Legal paper (8.5 in. by 14 in.) - #6 = Statement paper (5.5 in. by 8.5 in.) - #7 = Executive paper (7.25 in. by 10.5 in.) - #8 = A3 paper (297 mm by 420 mm) - #9 = A4 paper (210 mm by 297 mm) - #10 = A4 small paper (210 mm by 297 mm) - #11 = A5 paper (148 mm by 210 mm) - #12 = B4 paper (250 mm by 353 mm) - #13 = B5 paper (176 mm by 250 mm) - #14 = Folio paper (8.5 in. by 13 in.) - #15 = Quarto paper (215 mm by 275 mm) - #16 = Standard paper (10 in. by 14 in.) - #17 = Standard paper (11 in. by 17 in.) - #18 = Note paper (8.5 in. by 11 in.) - #19 = #9 envelope (3.875 in. by 8.875 in.) - #20 = #10 envelope (4.125 in. by 9.5 in.) - #21 = #11 envelope (4.5 in. by 10.375 in.) - #22 = #12 envelope (4.75 in. by 11 in.) - #23 = #14 envelope (5 in. by 11.5 in.) 24 = C paper (17 in. by 22 in.) - #25 = D paper (22 in. by 34 in.) - #26 = E paper (34 in. by 44 in.) - #27 = DL envelope (110 mm by 220 mm) - #28 = C5 envelope (162 mm by 229 mm) - #29 = C3 envelope (324 mm by 458 mm) - #30 = C4 envelope (229 mm by 324 mm) - #31 = C6 envelope (114 mm by 162 mm) - #32 = C65 envelope (114 mm by 229 mm) - #33 = B4 envelope (250 mm by 353 mm) - #34 = B5 envelope (176 mm by 250 mm) - #35 = B6 envelope (176 mm by 125 mm) - #36 = Italy envelope (110 mm by 230 mm) - #37 = Monarch envelope (3.875 in. by 7.5 in.). 38 = 6 3/4 envelope (3.625 in. by 6.5 in.) - #39 = US standard fanfold (14.875 in. by 11 in.) - #40 = German standard fanfold (8.5 in. by 12 in.) - #41 = German legal fanfold (8.5 in. by 13 in.) - #42 = ISO B4 (250 mm by 353 mm) - #43 = Japanese double postcard (200 mm by 148 mm) - #44 = Standard paper (9 in. by 11 in.) - #45 = Standard paper (10 in. by 11 in.) - #46 = Standard paper (15 in. by 11 in.) - #47 = Invite envelope (220 mm by 220 mm) - #50 = Letter extra paper (9.275 in. by 12 in.) - #51 = Legal extra paper (9.275 in. by 15 in.) - #52 = Tabloid extra paper (11.69 in. by 18 in.) - #53 = A4 extra paper (236 mm by 322 mm) - #54 = Letter transverse paper (8.275 in. by 11 in.) - #55 = A4 transverse paper (210 mm by 297 mm) - #56 = Letter extra transverse paper (9.275 in. by 12 in.) - #57 = SuperA/SuperA/A4 paper (227 mm by 356 mm) - #58 = SuperB/SuperB/A3 paper (305 mm by 487 mm) - #59 = Letter plus paper (8.5 in. by 12.69 in.) - #60 = A4 plus paper (210 mm by 330 mm) - #61 = A5 transverse paper (148 mm by 210 mm) - #62 = JIS B5 transverse paper (182 mm by 257 mm) - #63 = A3 extra paper (322 mm by 445 mm) - #64 = A5 extra paper (174 mm by 235 mm) - #65 = ISO B5 extra paper (201 mm by 276 mm) - #66 = A2 paper (420 mm by 594 mm) - #67 = A3 transverse paper (297 mm by 420 mm) - #68 = A3 extra transverse paper (322 mm by 445 mm) - #69 = Japanese Double Postcard (200 mm x 148 mm) - #70 = A6 (105 mm x 148 mm - #71 = Japanese Envelope Kaku #2 - #72 = Japanese Envelope Kaku #3 - #73 = Japanese Envelope Chou #3 - #74 = Japanese Envelope Chou #4 - #75 = Letter Rotated (11in x 8 1/2 11 in) - #76 = A3 Rotated (420 mm x 297 mm) - #77 = A4 Rotated (297 mm x 210 mm) - #78 = A5 Rotated (210 mm x 148 mm) - #79 = B4 (JIS) Rotated (364 mm x 257 mm) - #80 = B5 (JIS) Rotated (257 mm x 182 mm) - #81 = Japanese Postcard Rotated (148 mm x 100 mm) - #82 = Double Japanese Postcard Rotated (148 mm x 200 mm) - #83 = A6 Rotated (148 mm x 105 mm) - #84 = Japanese Envelope Kaku #2 Rotated - #85 = Japanese Envelope Kaku #3 Rotated - #86 = Japanese Envelope Chou #3 Rotated - #87 = Japanese Envelope Chou #4 Rotated - #88 = B6 (JIS) (128 mm x 182 mm) - #89 = B6 (JIS) Rotated (182 mm x 128 mm) - #90 = (12 in x 11 in) - #91 = Japanese Envelope You #4 - #92 = Japanese Envelope You #4 Rotated - #93 = PRC 16K (146 mm x 215 mm) - #94 = PRC 32K (97 mm x 151 mm) - #95 = PRC 32K(Big) (97 mm x 151 mm) - #96 = PRC Envelope #1 (102 mm x 165 mm) - #97 = PRC Envelope #2 (102 mm x 176 mm) - #98 = PRC Envelope #3 (125 mm x 176 mm) - #99 = PRC Envelope #4 (110 mm x 208 mm) - #100 = PRC Envelope #5 (110 mm x 220 mm) - #101 = PRC Envelope #6 (120 mm x 230 mm) - #102 = PRC Envelope #7 (160 mm x 230 mm) - #103 = PRC Envelope #8 (120 mm x 309 mm) - #104 = PRC Envelope #9 (229 mm x 324 mm) - #105 = PRC Envelope #10 (324 mm x 458 mm) - #106 = PRC 16K Rotated - #107 = PRC 32K Rotated - #108 = PRC 32K(Big) Rotated - #109 = PRC Envelope #1 Rotated (165 mm x 102 mm) - #110 = PRC Envelope #2 Rotated (176 mm x 102 mm) - #111 = PRC Envelope #3 Rotated (176 mm x 125 mm) - #112 = PRC Envelope #4 Rotated (208 mm x 110 mm) - #113 = PRC Envelope #5 Rotated (220 mm x 110 mm) - #114 = PRC Envelope #6 Rotated (230 mm x 120 mm) - #115 = PRC Envelope #7 Rotated (230 mm x 160 mm) - #116 = PRC Envelope #8 Rotated (309 mm x 120 mm) - #117 = PRC Envelope #9 Rotated (324 mm x 229 mm) - #118 = PRC Envelope #10 Rotated (458 mm x 324 mm) + # 1 = Letter paper (8.5 in. by 11 in.) + # 2 = Letter small paper (8.5 in. by 11 in.) + # 3 = Tabloid paper (11 in. by 17 in.) + # 4 = Ledger paper (17 in. by 11 in.) + # 5 = Legal paper (8.5 in. by 14 in.) + # 6 = Statement paper (5.5 in. by 8.5 in.) + # 7 = Executive paper (7.25 in. by 10.5 in.) + # 8 = A3 paper (297 mm by 420 mm) + # 9 = A4 paper (210 mm by 297 mm) + # 10 = A4 small paper (210 mm by 297 mm) + # 11 = A5 paper (148 mm by 210 mm) + # 12 = B4 paper (250 mm by 353 mm) + # 13 = B5 paper (176 mm by 250 mm) + # 14 = Folio paper (8.5 in. by 13 in.) + # 15 = Quarto paper (215 mm by 275 mm) + # 16 = Standard paper (10 in. by 14 in.) + # 17 = Standard paper (11 in. by 17 in.) + # 18 = Note paper (8.5 in. by 11 in.) + # 19 = #9 envelope (3.875 in. by 8.875 in.) + # 20 = #10 envelope (4.125 in. by 9.5 in.) + # 21 = #11 envelope (4.5 in. by 10.375 in.) + # 22 = #12 envelope (4.75 in. by 11 in.) + # 23 = #14 envelope (5 in. by 11.5 in.) 24 = C paper (17 in. by 22 in.) + # 25 = D paper (22 in. by 34 in.) + # 26 = E paper (34 in. by 44 in.) + # 27 = DL envelope (110 mm by 220 mm) + # 28 = C5 envelope (162 mm by 229 mm) + # 29 = C3 envelope (324 mm by 458 mm) + # 30 = C4 envelope (229 mm by 324 mm) + # 31 = C6 envelope (114 mm by 162 mm) + # 32 = C65 envelope (114 mm by 229 mm) + # 33 = B4 envelope (250 mm by 353 mm) + # 34 = B5 envelope (176 mm by 250 mm) + # 35 = B6 envelope (176 mm by 125 mm) + # 36 = Italy envelope (110 mm by 230 mm) + # 37 = Monarch envelope (3.875 in. by 7.5 in.). 38 = 6 3/4 envelope (3.625 in. by 6.5 in.) + # 39 = US standard fanfold (14.875 in. by 11 in.) + # 40 = German standard fanfold (8.5 in. by 12 in.) + # 41 = German legal fanfold (8.5 in. by 13 in.) + # 42 = ISO B4 (250 mm by 353 mm) + # 43 = Japanese double postcard (200 mm by 148 mm) + # 44 = Standard paper (9 in. by 11 in.) + # 45 = Standard paper (10 in. by 11 in.) + # 46 = Standard paper (15 in. by 11 in.) + # 47 = Invite envelope (220 mm by 220 mm) + # 50 = Letter extra paper (9.275 in. by 12 in.) + # 51 = Legal extra paper (9.275 in. by 15 in.) + # 52 = Tabloid extra paper (11.69 in. by 18 in.) + # 53 = A4 extra paper (236 mm by 322 mm) + # 54 = Letter transverse paper (8.275 in. by 11 in.) + # 55 = A4 transverse paper (210 mm by 297 mm) + # 56 = Letter extra transverse paper (9.275 in. by 12 in.) + # 57 = SuperA/SuperA/A4 paper (227 mm by 356 mm) + # 58 = SuperB/SuperB/A3 paper (305 mm by 487 mm) + # 59 = Letter plus paper (8.5 in. by 12.69 in.) + # 60 = A4 plus paper (210 mm by 330 mm) + # 61 = A5 transverse paper (148 mm by 210 mm) + # 62 = JIS B5 transverse paper (182 mm by 257 mm) + # 63 = A3 extra paper (322 mm by 445 mm) + # 64 = A5 extra paper (174 mm by 235 mm) + # 65 = ISO B5 extra paper (201 mm by 276 mm) + # 66 = A2 paper (420 mm by 594 mm) + # 67 = A3 transverse paper (297 mm by 420 mm) + # 68 = A3 extra transverse paper (322 mm by 445 mm) + # 69 = Japanese Double Postcard (200 mm x 148 mm) + # 70 = A6 (105 mm x 148 mm + # 71 = Japanese Envelope Kaku #2 + # 72 = Japanese Envelope Kaku #3 + # 73 = Japanese Envelope Chou #3 + # 74 = Japanese Envelope Chou #4 + # 75 = Letter Rotated (11in x 8 1/2 11 in) + # 76 = A3 Rotated (420 mm x 297 mm) + # 77 = A4 Rotated (297 mm x 210 mm) + # 78 = A5 Rotated (210 mm x 148 mm) + # 79 = B4 (JIS) Rotated (364 mm x 257 mm) + # 80 = B5 (JIS) Rotated (257 mm x 182 mm) + # 81 = Japanese Postcard Rotated (148 mm x 100 mm) + # 82 = Double Japanese Postcard Rotated (148 mm x 200 mm) + # 83 = A6 Rotated (148 mm x 105 mm) + # 84 = Japanese Envelope Kaku #2 Rotated + # 85 = Japanese Envelope Kaku #3 Rotated + # 86 = Japanese Envelope Chou #3 Rotated + # 87 = Japanese Envelope Chou #4 Rotated + # 88 = B6 (JIS) (128 mm x 182 mm) + # 89 = B6 (JIS) Rotated (182 mm x 128 mm) + # 90 = (12 in x 11 in) + # 91 = Japanese Envelope You #4 + # 92 = Japanese Envelope You #4 Rotated + # 93 = PRC 16K (146 mm x 215 mm) + # 94 = PRC 32K (97 mm x 151 mm) + # 95 = PRC 32K(Big) (97 mm x 151 mm) + # 96 = PRC Envelope #1 (102 mm x 165 mm) + # 97 = PRC Envelope #2 (102 mm x 176 mm) + # 98 = PRC Envelope #3 (125 mm x 176 mm) + # 99 = PRC Envelope #4 (110 mm x 208 mm) + # 100 = PRC Envelope #5 (110 mm x 220 mm) + # 101 = PRC Envelope #6 (120 mm x 230 mm) + # 102 = PRC Envelope #7 (160 mm x 230 mm) + # 103 = PRC Envelope #8 (120 mm x 309 mm) + # 104 = PRC Envelope #9 (229 mm x 324 mm) + # 105 = PRC Envelope #10 (324 mm x 458 mm) + # 106 = PRC 16K Rotated + # 107 = PRC 32K Rotated + # 108 = PRC 32K(Big) Rotated + # 109 = PRC Envelope #1 Rotated (165 mm x 102 mm) + # 110 = PRC Envelope #2 Rotated (176 mm x 102 mm) + # 111 = PRC Envelope #3 Rotated (176 mm x 125 mm) + # 112 = PRC Envelope #4 Rotated (208 mm x 110 mm) + # 113 = PRC Envelope #5 Rotated (220 mm x 110 mm) + # 114 = PRC Envelope #6 Rotated (230 mm x 120 mm) + # 115 = PRC Envelope #7 Rotated (230 mm x 160 mm) + # 116 = PRC Envelope #8 Rotated (309 mm x 120 mm) + # 117 = PRC Envelope #9 Rotated (324 mm x 229 mm) + # 118 = PRC Envelope #10 Rotated (458 mm x 324 mm) # @return [Integer] attr_reader :paper_size diff --git a/lib/axlsx/workbook/worksheet/pane.rb b/lib/axlsx/workbook/worksheet/pane.rb index f9323d3e..e752ab22 100644 --- a/lib/axlsx/workbook/worksheet/pane.rb +++ b/lib/axlsx/workbook/worksheet/pane.rb @@ -13,7 +13,7 @@ module Axlsx # @option options [Integer] x_split Horizontal Split Position # @option options [Integer] y_split Vertical Split Position def initialize(options = {}) - #defaults + # defaults @active_pane = @state = @top_left_cell = nil @x_split = @y_split = 0 parse_options options diff --git a/lib/axlsx/workbook/worksheet/sheet_protection.rb b/lib/axlsx/workbook/worksheet/sheet_protection.rb index b36f8875..7433d5bb 100644 --- a/lib/axlsx/workbook/worksheet/sheet_protection.rb +++ b/lib/axlsx/workbook/worksheet/sheet_protection.rb @@ -101,7 +101,7 @@ module Axlsx chars.collect! do |char| i += 1 - char = char.unpack('c')[0] << i #ord << i + char = char.unpack('c')[0] << i # ord << i low_15 = char & 0x7fff high_15 = char & 0x7fff << 15 high_15 = high_15 >> 15 diff --git a/lib/axlsx/workbook/worksheet/sheet_view.rb b/lib/axlsx/workbook/worksheet/sheet_view.rb index 8c2a0cd5..dc41d01a 100644 --- a/lib/axlsx/workbook/worksheet/sheet_view.rb +++ b/lib/axlsx/workbook/worksheet/sheet_view.rb @@ -29,7 +29,7 @@ module Axlsx # @option options [Integer] zoom_scale_page_layout_view Zoom Scale Page Layout View # @option options [Integer] zoom_scale_sheet_layout_view Zoom Scale Page Break Preview def initialize(options = {}) - #defaults + # defaults @color_id = @top_left_cell = @pane = nil @right_to_left = @show_formulas = @show_outline_symbols = @show_white_space = @tab_selected = @window_protection = false @default_grid_color = @show_grid_lines = @show_row_col_headers = @show_ruler = @show_zeros = true diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb index f20d671d..60615f1c 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb @@ -25,7 +25,7 @@ module Axlsx serializable_attributes :display, :tooltip, :ref - #Cell location of hyperlink on worksheet. + # Cell location of hyperlink on worksheet. # @return [String] attr_reader :ref diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb index 4771efb1..44c6125a 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb @@ -1,5 +1,5 @@ module Axlsx - #A collection of hyperlink objects for a worksheet + # A collection of hyperlink objects for a worksheet class WorksheetHyperlinks < SimpleTypedList # Creates a new Hyperlinks collection # @param [Worksheet] worksheet the worksheet that owns these hyperlinks diff --git a/test/content_type/tc_content_type.rb b/test/content_type/tc_content_type.rb index f06554c8..c79352ff 100644 --- a/test/content_type/tc_content_type.rb +++ b/test/content_type/tc_content_type.rb @@ -15,7 +15,7 @@ class TestContentType < Test::Unit::TestCase o_path = "//xmlns:Override[@ContentType='%s']" d_path = "//xmlns:Default[@ContentType='%s']" - #default + # default assert_equal(@doc.xpath("//xmlns:Default").size, 2, "There should be 2 default types") node = @doc.xpath(d_path % Axlsx::XML_CT).first @@ -24,7 +24,7 @@ class TestContentType < Test::Unit::TestCase node = @doc.xpath(d_path % Axlsx::RELS_CT).first assert_equal(node["Extension"], "#{Axlsx::RELS_EX}", "relationships content type invalid") - #overrride + # overrride assert_equal(@doc.xpath("//xmlns:Override").size, 4, "There should be 4 Override types") node = @doc.xpath(o_path % Axlsx::APP_CT).first diff --git a/test/drawing/tc_pic.rb b/test/drawing/tc_pic.rb index 6760fa58..56042de5 100644 --- a/test/drawing/tc_pic.rb +++ b/test/drawing/tc_pic.rb @@ -18,7 +18,7 @@ class TestPic < Test::Unit::TestCase end def test_anchor_swapping - #swap from one cell to two cell when end_at is specified + # swap from one cell to two cell when end_at is specified assert(@image.anchor.is_a?(Axlsx::OneCellAnchor)) start_at = @image.anchor.from @image.end_at 10, 5 @@ -28,7 +28,7 @@ class TestPic < Test::Unit::TestCase assert_equal(10, @image.anchor.to.col) assert_equal(5, @image.anchor.to.row) - #swap from two cell to one cell when width or height are specified + # swap from two cell to one cell when width or height are specified @image.width = 200 assert(@image.anchor.is_a?(Axlsx::OneCellAnchor)) assert_equal(start_at.col, @image.anchor.from.col) diff --git a/test/drawing/tc_pie_series.rb b/test/drawing/tc_pie_series.rb index ce516f83..c3f5bb3a 100644 --- a/test/drawing/tc_pie_series.rb +++ b/test/drawing/tc_pie_series.rb @@ -27,5 +27,5 @@ class TestPieSeries < Test::Unit::TestCase doc = Nokogiri::XML(@series.to_xml_string) assert(doc.xpath("//srgbClr[@val='#{@series.colors[0]}']")) end - #TODO test unique serialization parts + # TODO test unique serialization parts end diff --git a/test/profile.rb b/test/profile.rb index 4805dad8..ef42c2f8 100644 --- a/test/profile.rb +++ b/test/profile.rb @@ -3,7 +3,7 @@ $:.unshift "#{File.dirname(__FILE__)}/../lib" require 'axlsx' require 'ruby-prof' -#RubyProf.measure_mode = RubyProf::MEMORY +# RubyProf.measure_mode = RubyProf::MEMORY # row = [] # Taking worst case scenario of all string data diff --git a/test/stylesheet/tc_styles.rb b/test/stylesheet/tc_styles.rb index 78e82354..1598a658 100644 --- a/test/stylesheet/tc_styles.rb +++ b/test/stylesheet/tc_styles.rb @@ -62,7 +62,7 @@ class TestStyles < Test::Unit::TestCase end def test_do_not_alter_options_in_add_style - #This should test all options, but for now - just the bits that we know caused some pain + # This should test all options, but for now - just the bits that we know caused some pain options = { :border => { :style => :thin, :color => "FF000000" } } @styles.add_style options assert_equal options[:border][:style], :thin, 'thin style is stil in option' diff --git a/test/tc_package.rb b/test/tc_package.rb index c8f35211..cc40a6e0 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -249,7 +249,7 @@ class TestPackage < Test::Unit::TestCase def test_parts p = @package.send(:parts) - #all parts have an entry + # all parts have an entry assert_equal(p.select { |part| part[:entry] =~ /_rels\/\.rels/ }.size, 1, "rels missing") assert_equal(p.select { |part| part[:entry] =~ /docProps\/core\.xml/ }.size, 1, "core missing") assert_equal(p.select { |part| part[:entry] =~ /docProps\/app\.xml/ }.size, 1, "app missing") @@ -267,10 +267,10 @@ class TestPackage < Test::Unit::TestCase assert_equal(p.select { |part| part[:entry] =~ /xl\/pivotTables\/_rels\/pivotTable\d\.xml.rels/ }.size, @package.workbook.worksheets.first.pivot_tables.size, "one or more pivot tables rels missing") assert_equal(p.select { |part| part[:entry] =~ /xl\/pivotCache\/pivotCacheDefinition\d\.xml/ }.size, @package.workbook.worksheets.first.pivot_tables.size, "one or more pivot tables missing") - #no mystery parts + # no mystery parts assert_equal(25, p.size) - #sorted for correct MIME detection + # sorted for correct MIME detection assert_equal("[Content_Types].xml", p[0][:entry], "first entry should be `[Content_Types].xml`") assert_equal("_rels/.rels", p[1][:entry], "second entry should be `_rels/.rels`") assert_match(/\Axl\//, p[2][:entry], "third entry should begin with `xl/`") @@ -278,7 +278,7 @@ class TestPackage < Test::Unit::TestCase def test_shared_strings_requires_part @package.use_shared_strings = true - @package.to_stream #ensure all cell_serializer paths are hit + @package.to_stream # ensure all cell_serializer paths are hit p = @package.send(:parts) assert_equal(p.select { |part| part[:entry] =~ /xl\/sharedStrings.xml/ }.size, 1, "shared strings table missing") end diff --git a/test/util/tc_simple_typed_list.rb b/test/util/tc_simple_typed_list.rb index abcacf26..fc1ab0a2 100644 --- a/test/util/tc_simple_typed_list.rb +++ b/test/util/tc_simple_typed_list.rb @@ -16,7 +16,7 @@ class TestSimpleTypedList < Test::Unit::TestCase end def test_indexed_based_assignment - #should not allow nil assignment + # should not allow nil assignment assert_raise(ArgumentError) { @list[0] = nil } assert_raise(ArgumentError) { @list[0] = "1" } assert_nothing_raised { @list[0] = 1 } @@ -57,7 +57,7 @@ class TestSimpleTypedList < Test::Unit::TestCase @list.push 4 assert_nothing_raised { @list.delete_at 3 } @list.unlock - #ignore garbage + # ignore garbage assert_nothing_raised { @list.delete 0 } assert_nothing_raised { @list.delete 9 } end diff --git a/test/util/tc_validators.rb b/test/util/tc_validators.rb index ba3edba6..7df2e41b 100644 --- a/test/util/tc_validators.rb +++ b/test/util/tc_validators.rb @@ -7,71 +7,71 @@ class TestValidators < Test::Unit::TestCase end def test_validators - #unsigned_int + # unsigned_int assert_nothing_raised { Axlsx.validate_unsigned_int 1 } assert_nothing_raised { Axlsx.validate_unsigned_int(+1) } assert_raise(ArgumentError) { Axlsx.validate_unsigned_int(-1) } assert_raise(ArgumentError) { Axlsx.validate_unsigned_int('1') } - #int + # int assert_nothing_raised { Axlsx.validate_int(1) } assert_nothing_raised { Axlsx.validate_int(-1) } assert_raise(ArgumentError) { Axlsx.validate_int('a') } assert_raise(ArgumentError) { Axlsx.validate_int(Array) } - #boolean (as 0 or 1, :true, :false, true, false, or "true," "false") + # boolean (as 0 or 1, :true, :false, true, false, or "true," "false") [0, 1, :true, :false, true, false, "true", "false"].each do |v| assert_nothing_raised { Axlsx.validate_boolean 0 } end assert_raise(ArgumentError) { Axlsx.validate_boolean 2 } - #string + # string assert_nothing_raised { Axlsx.validate_string "1" } assert_raise(ArgumentError) { Axlsx.validate_string 2 } assert_raise(ArgumentError) { Axlsx.validate_string false } - #float + # float assert_nothing_raised { Axlsx.validate_float 1.0 } assert_raise(ArgumentError) { Axlsx.validate_float 2 } assert_raise(ArgumentError) { Axlsx.validate_float false } - #pattern_type + # pattern_type assert_nothing_raised { Axlsx.validate_pattern_type :none } assert_raise(ArgumentError) { Axlsx.validate_pattern_type "none" } assert_raise(ArgumentError) { Axlsx.validate_pattern_type "crazy_pattern" } assert_raise(ArgumentError) { Axlsx.validate_pattern_type false } - #gradient_type + # gradient_type assert_nothing_raised { Axlsx.validate_gradient_type :path } assert_raise(ArgumentError) { Axlsx.validate_gradient_type nil } assert_raise(ArgumentError) { Axlsx.validate_gradient_type "fractal" } assert_raise(ArgumentError) { Axlsx.validate_gradient_type false } - #horizontal alignment + # horizontal alignment assert_nothing_raised { Axlsx.validate_horizontal_alignment :general } assert_raise(ArgumentError) { Axlsx.validate_horizontal_alignment nil } assert_raise(ArgumentError) { Axlsx.validate_horizontal_alignment "wavy" } assert_raise(ArgumentError) { Axlsx.validate_horizontal_alignment false } - #vertical alignment + # vertical alignment assert_nothing_raised { Axlsx.validate_vertical_alignment :top } assert_raise(ArgumentError) { Axlsx.validate_vertical_alignment nil } assert_raise(ArgumentError) { Axlsx.validate_vertical_alignment "dynamic" } assert_raise(ArgumentError) { Axlsx.validate_vertical_alignment false } - #contentType + # contentType assert_nothing_raised { Axlsx.validate_content_type Axlsx::WORKBOOK_CT } assert_raise(ArgumentError) { Axlsx.validate_content_type nil } assert_raise(ArgumentError) { Axlsx.validate_content_type "http://some.url" } assert_raise(ArgumentError) { Axlsx.validate_content_type false } - #relationshipType + # relationshipType assert_nothing_raised { Axlsx.validate_relationship_type Axlsx::WORKBOOK_R } assert_raise(ArgumentError) { Axlsx.validate_relationship_type nil } assert_raise(ArgumentError) { Axlsx.validate_relationship_type "http://some.url" } assert_raise(ArgumentError) { Axlsx.validate_relationship_type false } - #number_with_unit + # number_with_unit assert_nothing_raised { Axlsx.validate_number_with_unit "210mm" } assert_nothing_raised { Axlsx.validate_number_with_unit "8.5in" } assert_nothing_raised { Axlsx.validate_number_with_unit "29.7cm" } @@ -84,7 +84,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_number_with_unit "mm" } assert_raise(ArgumentError) { Axlsx.validate_number_with_unit "-29cm" } - #scale_10_400 + # scale_10_400 assert_nothing_raised { Axlsx.validate_scale_10_400 10 } assert_nothing_raised { Axlsx.validate_scale_10_400 100 } assert_nothing_raised { Axlsx.validate_scale_10_400 400 } @@ -93,7 +93,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_scale_10_400 400.1 } assert_raise(ArgumentError) { Axlsx.validate_scale_10_400 "99" } - #scale_0_10_400 + # scale_0_10_400 assert_nothing_raised { Axlsx.validate_scale_0_10_400 0 } assert_nothing_raised { Axlsx.validate_scale_0_10_400 10 } assert_nothing_raised { Axlsx.validate_scale_0_10_400 100 } @@ -103,7 +103,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_scale_0_10_400 400.1 } assert_raise(ArgumentError) { Axlsx.validate_scale_0_10_400 "99" } - #page_orientation + # page_orientation assert_nothing_raised { Axlsx.validate_page_orientation :default } assert_nothing_raised { Axlsx.validate_page_orientation :landscape } assert_nothing_raised { Axlsx.validate_page_orientation :portrait } @@ -111,7 +111,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_page_orientation 1 } assert_raise(ArgumentError) { Axlsx.validate_page_orientation "landscape" } - #data_validation_error_style + # data_validation_error_style [:information, :stop, :warning].each do |sym| assert_nothing_raised { Axlsx.validate_data_validation_error_style sym } end @@ -119,7 +119,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_data_validation_error_style 'warning' } assert_raise(ArgumentError) { Axlsx.validate_data_validation_error_style 0 } - #data_validation_operator + # data_validation_operator [:lessThan, :lessThanOrEqual, :equal, :notEqual, :greaterThanOrEqual, :greaterThan, :between, :notBetween].each do |sym| assert_nothing_raised { Axlsx.validate_data_validation_operator sym } end @@ -127,7 +127,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_data_validation_error_style 'lessThan' } assert_raise(ArgumentError) { Axlsx.validate_data_validation_error_style 0 } - #data_validation_type + # data_validation_type [:custom, :data, :decimal, :list, :none, :textLength, :date, :time, :whole].each do |sym| assert_nothing_raised { Axlsx.validate_data_validation_type sym } end @@ -135,7 +135,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_data_validation_error_style 'decimal' } assert_raise(ArgumentError) { Axlsx.validate_data_validation_error_style 0 } - #sheet_view_type + # sheet_view_type [:normal, :page_break_preview, :page_layout].each do |sym| assert_nothing_raised { Axlsx.validate_sheet_view_type sym } end @@ -143,7 +143,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_data_validation_error_style 'page_layout' } assert_raise(ArgumentError) { Axlsx.validate_data_validation_error_style 0 } - #active_pane_type + # active_pane_type [:bottom_left, :bottom_right, :top_left, :top_right].each do |sym| assert_nothing_raised { Axlsx.validate_pane_type sym } end @@ -151,7 +151,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_pane_type 'bottom_left' } assert_raise(ArgumentError) { Axlsx.validate_pane_type 0 } - #split_state_type + # split_state_type [:frozen, :frozen_split, :split].each do |sym| assert_nothing_raised { Axlsx.validate_split_state_type sym } end @@ -159,7 +159,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_split_state_type 'frozen_split' } assert_raise(ArgumentError) { Axlsx.validate_split_state_type 0 } - #display_blanks_as + # display_blanks_as [:gap, :span, :zero].each do |sym| assert_nothing_raised { Axlsx.validate_display_blanks_as sym } end @@ -167,7 +167,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_display_blanks_as 'other_blank' } assert_raise(ArgumentError) { Axlsx.validate_display_blanks_as 0 } - #view_visibility + # view_visibility [:visible, :hidden, :very_hidden].each do |sym| assert_nothing_raised { Axlsx.validate_view_visibility sym } end @@ -175,7 +175,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_view_visibility 'other_visibility' } assert_raise(ArgumentError) { Axlsx.validate_view_visibility 0 } - #marker_symbol + # marker_symbol [:default, :circle, :dash, :diamond, :dot, :picture, :plus, :square, :star, :triangle, :x].each do |sym| assert_nothing_raised { Axlsx.validate_marker_symbol sym } end diff --git a/test/workbook/tc_workbook.rb b/test/workbook/tc_workbook.rb index c5a72e48..c085ed91 100644 --- a/test/workbook/tc_workbook.rb +++ b/test/workbook/tc_workbook.rb @@ -90,7 +90,7 @@ class TestWorkbook < Test::Unit::TestCase end def test_relationships - #current relationship size is 1 due to style relation + # current relationship size is 1 due to style relation assert(@wb.relationships.size == 1) @wb.add_worksheet assert(@wb.relationships.size == 2) diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index a4aab11c..f5264115 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -112,7 +112,7 @@ class TestCell < Test::Unit::TestCase end def test_col_ref - #TODO move to axlsx spec + # TODO move to axlsx spec assert_equal(Axlsx.col_ref(0), "A") end diff --git a/test/workbook/worksheet/tc_col.rb b/test/workbook/worksheet/tc_col.rb index 80b228d0..908e9931 100644 --- a/test/workbook/worksheet/tc_col.rb +++ b/test/workbook/worksheet/tc_col.rb @@ -86,6 +86,6 @@ class TestCol < Test::Unit::TestCase assert_equal(@col.style, nil) @col.style = 1 assert_equal(@col.style, 1) - #TODO check that the style specified is actually in the styles xfs collection + # TODO check that the style specified is actually in the styles xfs collection end end diff --git a/test/workbook/worksheet/tc_conditional_formatting.rb b/test/workbook/worksheet/tc_conditional_formatting.rb index dcbb3ca6..2c8292ee 100644 --- a/test/workbook/worksheet/tc_conditional_formatting.rb +++ b/test/workbook/worksheet/tc_conditional_formatting.rb @@ -187,7 +187,7 @@ class TestConditionalFormatting < Test::Unit::TestCase end def test_percent - assert_raise(ArgumentError) { @cfr.percent = "10%" } #WRONG! + assert_raise(ArgumentError) { @cfr.percent = "10%" } # WRONG! assert_nothing_raised { @cfr.percent = true } assert_equal(@cfr.percent, true) end diff --git a/test/workbook/worksheet/tc_data_validation.rb b/test/workbook/worksheet/tc_data_validation.rb index 09ce8290..3dffee39 100644 --- a/test/workbook/worksheet/tc_data_validation.rb +++ b/test/workbook/worksheet/tc_data_validation.rb @@ -5,7 +5,7 @@ class TestDataValidation < Test::Unit::TestCase include CaptureWarnings def setup - #inverse defaults + # inverse defaults @boolean_options = { :allowBlank => false, :hideDropDown => true, :showErrorMessage => false, :showInputMessage => true } @nil_options = { :formula1 => 'foo', :formula2 => 'foo', :errorTitle => 'foo', :operator => :lessThan, :prompt => 'foo', :promptTitle => 'foo', :sqref => 'foo' } @type_option = { :type => :whole } @@ -171,7 +171,7 @@ class TestDataValidation < Test::Unit::TestCase doc = Nokogiri::XML.parse(@ws.to_xml_string) - #test attributes + # test attributes assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations[@count='1']/xmlns:dataValidation[@sqref='A1'] [@promptTitle='Be carful!'][@prompt='Only values between 5 and 10'][@operator='between'][@errorTitle='Wrong input'] [@error='Only values between 5 and 10'][@showErrorMessage=1][@allowBlank=1][@showInputMessage=1][@type='whole'] @@ -181,11 +181,11 @@ class TestDataValidation < Test::Unit::TestCase [@error='Only values between 5 and 10'][@showErrorMessage=1][@allowBlank=1][@showInputMessage=1] [@type='whole'][@errorStyle='information']") - #test forumula1 + # test forumula1 assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation/xmlns:formula1").size) assert doc.xpath("//xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation/xmlns:formula1='5'") - #test forumula2 + # test forumula2 assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation/xmlns:formula2").size) assert doc.xpath("//xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation/xmlns:formula2='10'") end @@ -200,7 +200,7 @@ class TestDataValidation < Test::Unit::TestCase doc = Nokogiri::XML.parse(@ws.to_xml_string) - #test attributes + # test attributes assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations[@count='1']/xmlns:dataValidation[@sqref='A1'] [@promptTitle='Be carful!'][@prompt='Only values from list'][@errorTitle='Wrong input'][@error='Only values from list'] [@showErrorMessage=1][@allowBlank=1][@showInputMessage=1][@showDropDown=1][@type='list'] @@ -209,7 +209,7 @@ class TestDataValidation < Test::Unit::TestCase [@promptTitle='Be carful!'][@prompt='Only values from list'][@errorTitle='Wrong input'][@error='Only values from list'] [@showErrorMessage=1][@allowBlank=1][@showInputMessage=1][@showDropDown=1][@type='list'][@errorStyle='stop']") - #test forumula1 + # test forumula1 assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation/xmlns:formula1").size) assert doc.xpath("//xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation/xmlns:formula1='A1:A5'") end @@ -224,7 +224,7 @@ class TestDataValidation < Test::Unit::TestCase doc = Nokogiri::XML.parse(@ws.to_xml_string) - #test attributes + # test attributes assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations[@count='1']/xmlns:dataValidation[@sqref='A1'][@promptTitle='Be carful!'] [@prompt='Only values corresponding formula'][@errorTitle='Wrong input'][@error='Only values corresponding formula'][@showErrorMessage=1] [@allowBlank=1][@showInputMessage=1][@type='custom'][@errorStyle='stop']").size) @@ -232,7 +232,7 @@ class TestDataValidation < Test::Unit::TestCase [@prompt='Only values corresponding formula'][@errorTitle='Wrong input'][@error='Only values corresponding formula'] [@showErrorMessage=1][@allowBlank=1][@showInputMessage=1][@type='custom'][@errorStyle='stop']") - #test forumula1 + # test forumula1 assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation/xmlns:formula1").size) assert doc.xpath("//xmlns:worksheet/xmlns:dataValidations/xmlns:dataValidation/xmlns:formula1='=5/2'") end @@ -251,7 +251,7 @@ class TestDataValidation < Test::Unit::TestCase doc = Nokogiri::XML.parse(@ws.to_xml_string) - #test attributes + # test attributes assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations[@count='2']/xmlns:dataValidation[@sqref='A1'] [@promptTitle='Be carful!'][@prompt='Only values between 5 and 10'][@operator='between'][@errorTitle='Wrong input'] [@error='Only values between 5 and 10'][@showErrorMessage=1][@allowBlank=1][@showInputMessage=1][@type='whole'] @@ -261,7 +261,7 @@ class TestDataValidation < Test::Unit::TestCase [@error='Only values between 5 and 10'][@showErrorMessage=1][@allowBlank=1][@showInputMessage=1] [@type='whole'][@errorStyle='information']") - #test attributes + # test attributes assert_equal(1, doc.xpath("//xmlns:worksheet/xmlns:dataValidations[@count='2']/xmlns:dataValidation[@sqref='B1'] [@promptTitle='Be carful!'][@prompt='Only values from list'][@errorTitle='Wrong input'][@error='Only values from list'] [@showErrorMessage=1][@allowBlank=1][@showInputMessage=1][@showDropDown=1][@type='list'] diff --git a/test/workbook/worksheet/tc_pane.rb b/test/workbook/worksheet/tc_pane.rb index fef1eb63..9a16866b 100644 --- a/test/workbook/worksheet/tc_pane.rb +++ b/test/workbook/worksheet/tc_pane.rb @@ -3,7 +3,7 @@ require 'tc_helper.rb' class TestPane < Test::Unit::TestCase def setup - #inverse defaults for booleans + # inverse defaults for booleans @nil_options = { :active_pane => :bottom_left, :state => :frozen, :top_left_cell => 'A2' } @int_0_options = { :x_split => 2, :y_split => 2 } @options = @nil_options.merge(@int_0_options) diff --git a/test/workbook/worksheet/tc_sheet_protection.rb b/test/workbook/worksheet/tc_sheet_protection.rb index 8d5452cc..b14f3e03 100644 --- a/test/workbook/worksheet/tc_sheet_protection.rb +++ b/test/workbook/worksheet/tc_sheet_protection.rb @@ -22,7 +22,7 @@ require 'tc_helper.rb' class TestSheetProtection < Test::Unit::TestCase def setup - #inverse defaults + # inverse defaults @boolean_options = { :sheet => false, :objects => true, :scenarios => true, :format_cells => false, :format_columns => false, :format_rows => false, :insert_columns => false, :insert_rows => false, :insert_hyperlinks => false, :delete_columns => false, :delete_rows => false, :select_locked_cells => true, diff --git a/test/workbook/worksheet/tc_sheet_view.rb b/test/workbook/worksheet/tc_sheet_view.rb index fb8367a8..03030d2c 100644 --- a/test/workbook/worksheet/tc_sheet_view.rb +++ b/test/workbook/worksheet/tc_sheet_view.rb @@ -3,7 +3,7 @@ require 'tc_helper.rb' class TestSheetView < Test::Unit::TestCase def setup - #inverse defaults for booleans + # inverse defaults for booleans @boolean_options = { :right_to_left => true, :show_formulas => true, :show_outline_symbols => true, :show_white_space => true, :tab_selected => true, :default_grid_color => false, :show_grid_lines => false, :show_row_col_headers => false, :show_ruler => false, :show_zeros => false, :window_protection => true } |
