diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-05 17:17:07 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-04-06 09:54:44 +0200 |
| commit | 7e90a46d43fefcf5ff7c76c14b29b6998245cfc5 (patch) | |
| tree | 0562b39547ee41e86504bf661390ce0d571ff066 /lib/axlsx | |
| parent | e9496a58dbf17d4b9bb615f3cb630f1e32574ece (diff) | |
| download | caxlsx-7e90a46d43fefcf5ff7c76c14b29b6998245cfc5.tar.gz caxlsx-7e90a46d43fefcf5ff7c76c14b29b6998245cfc5.zip | |
Remove Layout/TrailingWhitespace offenses
```
rubocop --only Layout/TrailingWhitespace -a
```
Diffstat (limited to 'lib/axlsx')
35 files changed, 177 insertions, 177 deletions
diff --git a/lib/axlsx/doc_props/core.rb b/lib/axlsx/doc_props/core.rb index bb2da676..e0025f12 100644 --- a/lib/axlsx/doc_props/core.rb +++ b/lib/axlsx/doc_props/core.rb @@ -5,7 +5,7 @@ module Axlsx # @note Packages manage their own core object. # @see Package#core class Core - + # Creates a new Core object. # @option options [String] creator # @option options [Time] created diff --git a/lib/axlsx/drawing/axes.rb b/lib/axlsx/drawing/axes.rb index dff87a9b..6e66dcc0 100644 --- a/lib/axlsx/drawing/axes.rb +++ b/lib/axlsx/drawing/axes.rb @@ -1,5 +1,5 @@ module Axlsx - + # The Axes class creates and manages axis information and # serialization for charts. class Axes @@ -16,7 +16,7 @@ module Axlsx end # [] provides assiciative access to a specic axis store in an axes - # instance. + # instance. # @return [Axis] def [](name) axes.assoc(name)[1] @@ -27,12 +27,12 @@ module Axlsx # @param [Hash] options # @option options ids # If the ids option is specified only the axis identifier is - # serialized. Otherwise, each axis is serialized in full. + # serialized. Otherwise, each axis is serialized in full. def to_xml_string(str = '', options = {}) if options[:ids] # CatAxis must come first in the XML (for Microsoft Excel at least) sorted = axes.sort_by { |name, axis| axis.kind_of?(CatAxis) ? 0 : 1 } - sorted.each { |axis| str << ('<c:axId val="' << axis[1].id.to_s << '"/>') } + sorted.each { |axis| str << ('<c:axId val="' << axis[1].id.to_s << '"/>') } else axes.each { |axis| axis[1].to_xml_string(str) } end diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb index b2bb8fe7..e4bcf9a4 100644 --- a/lib/axlsx/drawing/axis.rb +++ b/lib/axlsx/drawing/axis.rb @@ -83,14 +83,14 @@ module Axlsx # the title for the axis. This can be a cell or a fixed string. attr_reader :title - # The color for this axis. This value is used when rendering the axis line in the chart. + # The color for this axis. This value is used when rendering the axis line in the chart. # colors should be in 6 character rbg format # @return [String] the rbg color assinged. # @see color def color=(color_rgb) @color = color_rgb end - + # The crossing axis for this axis # @param [Axis] axis def cross_axis=(axis) diff --git a/lib/axlsx/drawing/d_lbls.rb b/lib/axlsx/drawing/d_lbls.rb index 0fb3c6ad..0c8185f0 100644 --- a/lib/axlsx/drawing/d_lbls.rb +++ b/lib/axlsx/drawing/d_lbls.rb @@ -7,7 +7,7 @@ module Axlsx class DLbls include Axlsx::Accessors - include Axlsx::OptionsParser + include Axlsx::OptionsParser # creates a new DLbls object def initialize(chart_type, options={}) raise ArgumentError, 'chart_type must inherit from Chart' unless [Chart, LineChart].include?(chart_type.superclass) @@ -18,31 +18,31 @@ module Axlsx # These attributes are all boolean so I'm doing a bit of a hand # waving magic show to set up the attriubte accessors - # @note - # not all charts support all methods! + # @note + # not all charts support all methods! # Bar3DChart and Line3DChart and ScatterChart do not support d_lbl_pos or show_leader_lines - # - boolean_attr_accessor :show_legend_key, - :show_val, - :show_cat_name, - :show_ser_name, - :show_percent, - :show_bubble_size, + # + boolean_attr_accessor :show_legend_key, + :show_val, + :show_cat_name, + :show_ser_name, + :show_percent, + :show_bubble_size, :show_leader_lines # Initialize all the values to false as Excel requires them to # explicitly be disabled or all will show. def initialize_defaults - [:show_legend_key, :show_val, :show_cat_name, - :show_ser_name, :show_percent, :show_bubble_size, + [:show_legend_key, :show_val, :show_cat_name, + :show_ser_name, :show_percent, :show_bubble_size, :show_leader_lines].each do |attr| self.send("#{attr}=", false) end end - # The chart type that is using this data lables instance. + # The chart type that is using this data lables instance. # This affects the xml output as not all chart types support the - # same data label attributes. + # same data label attributes. attr_reader :chart_type # The position of the data labels in the chart @@ -65,7 +65,7 @@ module Axlsx @d_lbl_pos = label_position end - + # serializes the data labels # @return [String] def to_xml_string(str = '') @@ -74,7 +74,7 @@ module Axlsx instance_vals = Axlsx.instance_values_for(self) %w(d_lbl_pos show_legend_key show_val show_cat_name show_ser_name show_percent show_bubble_size show_leader_lines).each do |key| next unless instance_vals.keys.include?(key) && instance_vals[key] != nil - str << "<c:#{Axlsx::camel(key, false)} val='#{instance_vals[key]}' />" + str << "<c:#{Axlsx::camel(key, false)} val='#{instance_vals[key]}' />" end str << '</c:dLbls>' end diff --git a/lib/axlsx/drawing/view_3D.rb b/lib/axlsx/drawing/view_3D.rb index 2223d501..cfb44166 100644 --- a/lib/axlsx/drawing/view_3D.rb +++ b/lib/axlsx/drawing/view_3D.rb @@ -71,7 +71,7 @@ module Axlsx alias :hPercent= :h_percent= # @see rot_y - def rot_y=(v) + def rot_y=(v) RangeValidator.validate "View3D.rot_y", 0, 360, v @rot_y = v end diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index 6baaa173..613c92de 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -102,7 +102,7 @@ module Axlsx # File.open('example_streamed.xlsx', 'wb') { |f| f.write(s.read) } def serialize(output, options = {}, secondary_options = nil) if !workbook.styles_applied - workbook.apply_styles + workbook.apply_styles end confirm_valid, zip_command = parse_serialize_options(options, secondary_options) @@ -127,7 +127,7 @@ module Axlsx # @return [StringIO|Boolean] False if confirm_valid and validation errors exist. rewound string IO if not. def to_stream(confirm_valid=false) if !workbook.styles_applied - workbook.apply_styles + workbook.apply_styles end return false unless !confirm_valid || self.validate.empty? diff --git a/lib/axlsx/rels/relationship.rb b/lib/axlsx/rels/relationship.rb index 157f316e..dc7c5307 100644 --- a/lib/axlsx/rels/relationship.rb +++ b/lib/axlsx/rels/relationship.rb @@ -3,7 +3,7 @@ module Axlsx # A relationship defines a reference between package parts. # @note Packages automatically manage relationships. class Relationship - + class << self # Keeps track of relationship ids in use. # @return [Array] @@ -12,27 +12,27 @@ module Axlsx end # Initialize cached ids. - # + # # This should be called before serializing a package (see {Package#serialize} and - # {Package#to_stream}) to make sure that serialization is idempotent (i.e. + # {Package#to_stream}) to make sure that serialization is idempotent (i.e. # Relationship instances are generated with the same IDs everytime the package # is serialized). def initialize_ids_cache Thread.current[:axlsx_relationship_ids_cache] = {} end - + # Clear cached ids. - # + # # This should be called after serializing a package (see {Package#serialize} and # {Package#to_stream}) to free the memory allocated for cache. - # - # Also, calling this avoids memory leaks (cached ids lingering around - # forever). + # + # Also, calling this avoids memory leaks (cached ids lingering around + # forever). def clear_ids_cache Thread.current[:axlsx_relationship_ids_cache] = nil end - - # Generate and return a unique id (eg. `rId123`) Used for setting {#Id}. + + # Generate and return a unique id (eg. `rId123`) Used for setting {#Id}. # # The generated id depends on the number of previously cached ids, so using # {clear_ids_cache} will automatically reset the generated ids, too. @@ -42,12 +42,12 @@ module Axlsx end end - # The id of the relationship (eg. "rId123"). Most instances get their own unique id. + # The id of the relationship (eg. "rId123"). Most instances get their own unique id. # However, some instances need to share the same id – see {#should_use_same_id_as?} # for details. # @return [String] attr_reader :Id - + # The location of the relationship target # @return [String] attr_reader :Target @@ -77,8 +77,8 @@ module Axlsx # The source object the relations belongs to (e.g. a hyperlink, drawing, ...). Needed when # looking up the relationship for a specific object (see {Relationships#for}). attr_reader :source_obj - - # Initializes a new relationship. + + # Initializes a new relationship. # @param [Object] source_obj see {#source_obj} # @param [String] type The type of the relationship # @param [String] target The target for the relationship @@ -108,12 +108,12 @@ module Axlsx str << (h.map { |key, value| '' << key.to_s << '="' << Axlsx::coder.encode(value.to_s) << '"'}.join(' ')) str << '/>' end - + # A key that determines whether this relationship should use already generated id. # # Instances designating the same relationship need to use the same id. We can not simply - # compare the {#Target} attribute, though: `foo/bar.xml`, `../foo/bar.xml`, - # `../../foo/bar.xml` etc. are all different but probably mean the same file (this + # compare the {#Target} attribute, though: `foo/bar.xml`, `../foo/bar.xml`, + # `../../foo/bar.xml` etc. are all different but probably mean the same file (this # is especially an issue for relationships in the context of pivot tables). So lets # just ignore this attribute for now (except when {#TargetMode} is set to `:External` – # then {#Target} will be an absolute URL and thus can safely be compared). @@ -125,6 +125,6 @@ module Axlsx key << self.Target if self.TargetMode == :External key end - + end end diff --git a/lib/axlsx/stylesheet/cell_alignment.rb b/lib/axlsx/stylesheet/cell_alignment.rb index 715a0b3e..f1675141 100644 --- a/lib/axlsx/stylesheet/cell_alignment.rb +++ b/lib/axlsx/stylesheet/cell_alignment.rb @@ -1,16 +1,16 @@ # encoding: UTF-8 module Axlsx - - + + # CellAlignment stores information about the cell alignment of a style Xf Object. # @note Using Styles#add_style is the recommended way to manage cell alignment. # @see Styles#add_style class CellAlignment - + include Axlsx::SerializedAttributes include Axlsx::OptionsParser - + serializable_attributes :horizontal, :vertical, :text_rotation, :wrap_text, :indent, :relative_indent, :justify_last_line, :shrink_to_fit, :reading_order # Create a new cell_alignment object # @option options [Symbol] horizontal diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index f6305fa9..188f0960 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -137,7 +137,7 @@ module Axlsx # @option options [Integer] family The font family to use. # @option options [String] font_name The name of the font to use # @option options [Integer] num_fmt The number format to apply - # @option options [String] format_code The formatting to apply. + # @option options [String] format_code The formatting to apply. # @option options [Integer|Hash] border The border style to use. # borders support style, color and edges options @see parse_border_options # @option options [String] bg_color The background color to apply to the cell @@ -241,8 +241,8 @@ module Axlsx if options[:type] == :xf # Check to see if style in cache already - - font_defaults = {name: @fonts.first.name, sz: @fonts.first.sz, family: @fonts.first.family} + + font_defaults = {name: @fonts.first.name, sz: @fonts.first.sz, family: @fonts.first.family} raw_style = {type: :xf}.merge(font_defaults).merge(options) @@ -349,12 +349,12 @@ module Axlsx # parses Style#add_style options for borders. # @note noop if :border is not specified in options - # @option options [Hash|Integer] A border style definition hash or the index of an existing border. - # Border style definition hashes must include :style and :color key-value entries and - # may include an :edges entry that references an array of symbols identifying which border edges + # @option options [Hash|Integer] A border style definition hash or the index of an existing border. + # Border style definition hashes must include :style and :color key-value entries and + # may include an :edges entry that references an array of symbols identifying which border edges # you wish to apply the style or any other valid Border initializer options. # If the :edges entity is not provided the style is applied to all edges of cells that reference this style. - # Also available :border_top, :border_right, :border_bottom and :border_left options with :style and/or :color + # Also available :border_top, :border_right, :border_bottom and :border_left options with :style and/or :color # key-value entries, which override :border values. # @example # #apply a thick red border to the top and bottom @@ -444,8 +444,8 @@ module Axlsx end border.prs << BorderPr.new({ - :name => edge, - :style => edge_b_opts[:style], + :name => edge, + :style => edge_b_opts[:style], :color => Color.new(:rgb => edge_b_opts[:color]) }, ) end diff --git a/lib/axlsx/util/accessors.rb b/lib/axlsx/util/accessors.rb index a678b041..5062b0d4 100644 --- a/lib/axlsx/util/accessors.rb +++ b/lib/axlsx/util/accessors.rb @@ -51,7 +51,7 @@ module Axlsx # @param [Array] symbols The names of the attributes to create # @param [String] validator The axlsx validation method to use when # validating assignation. - # @see lib/axlsx/util/validators.rb + # @see lib/axlsx/util/validators.rb def validated_attr_accessor(symbols, validator) symbols.each do |symbol| attr_reader symbol diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb index 06d1697a..75712de1 100644 --- a/lib/axlsx/util/serialized_attributes.rb +++ b/lib/axlsx/util/serialized_attributes.rb @@ -11,7 +11,7 @@ module Axlsx # class methods applied to all includers module ClassMethods - # This is the method to be used in inheriting classes to specify + # This is the method to be used in inheriting classes to specify # which of the instance values are serializable def serializable_attributes(*symbols) @xml_attributes = symbols @@ -43,7 +43,7 @@ module Axlsx end end - # serializes the instance values of the defining object based on the + # serializes the instance values of the defining object based on the # list of serializable attributes. # @param [String] str The string instance to append this # serialization to. diff --git a/lib/axlsx/util/simple_typed_list.rb b/lib/axlsx/util/simple_typed_list.rb index 77bed775..5f5dbffa 100644 --- a/lib/axlsx/util/simple_typed_list.rb +++ b/lib/axlsx/util/simple_typed_list.rb @@ -55,7 +55,7 @@ module Axlsx end result end - + # Lock this list at the current size # @return [self] def lock @@ -69,7 +69,7 @@ module Axlsx @locked_at = nil self end - + def to_ary @list end @@ -82,9 +82,9 @@ module Axlsx # one of the allowed types # @return [SimpleTypedList] def +(v) - v.each do |item| + v.each do |item| DataTypeValidator.validate :SimpleTypedList_plus, @allowed_types, item - @list << item + @list << item end end @@ -96,10 +96,10 @@ module Axlsx DataTypeValidator.validate :SimpleTypedList_push, @allowed_types, v @list << v @list.size - 1 - end - + end + alias :push :<< - + # delete the item from the list # @param [Any] v The item to be deleted. @@ -164,7 +164,7 @@ module Axlsx end } end - + def to_xml_string(str = '') classname = @allowed_types[0].name.split('::').last el_name = serialize_as.to_s || (classname[0,1].downcase + classname[1..-1]) diff --git a/lib/axlsx/util/storage.rb b/lib/axlsx/util/storage.rb index 6c16bdcf..b3815dbb 100644 --- a/lib/axlsx/util/storage.rb +++ b/lib/axlsx/util/storage.rb @@ -16,46 +16,46 @@ module Axlsx }.freeze # Creates a byte string for this storage - # @return [String] + # @return [String] def to_s - data = [@name.concat(Array.new([email protected], 0)), - @name_size, - @type, - @color, - @left, - @right, - @child, + data = [@name.concat(Array.new([email protected], 0)), + @name_size, + @type, + @color, + @left, + @right, + @child, @created, - @modified, - @sector, + @modified, + @sector, @size].flatten data.pack(PACKING) end # storage colors COLORS = { - :red=>0, + :red=>0, :black=>1 } # The color of this node in the directory tree. Defaults to black if not specified # @return [Integer] color attr_reader :color - + # Sets the color for this storage # @param [Integer] v Must be one of the COLORS constant hash values def color=(v) - RestrictionValidator.validate :storage_color, COLORS.values, v + RestrictionValidator.validate :storage_color, COLORS.values, v @color = v end # The size of the name for this node. - # interesting to see that office actually uses 'R' for the root directory and lists the size as 2 bytes - thus is it *NOT* null + # interesting to see that office actually uses 'R' for the root directory and lists the size as 2 bytes - thus is it *NOT* null # terminated. I am making this r/w so that I can override the size # @return [Integer] color attr_reader :name_size - # the name of the stream + # the name of the stream attr_reader :name # sets the name of the stream. @@ -87,16 +87,16 @@ module Axlsx # @return [Integer] sector attr_accessor :sector - # The 0 based index in the directoies chain for this the left sibling of this storage. - + # The 0 based index in the directoies chain for this the left sibling of this storage. + # @return [Integer] left - attr_accessor :left + attr_accessor :left - # The 0 based index in the directoies chain for this the right sibling of this storage. + # The 0 based index in the directoies chain for this the right sibling of this storage. # @return [Integer] right - attr_accessor :right + attr_accessor :right - # The 0 based index in the directoies chain for the child of this storage. + # The 0 based index in the directoies chain for the child of this storage. # @return [Integer] child attr_accessor :child @@ -113,14 +113,14 @@ module Axlsx # @return [Integer] type attr_reader :type - # Sets the type for this storage. - # @param [Integer] v the type to specify must be one of the TYPES constant hash values. + # Sets the type for this storage. + # @param [Integer] v the type to specify must be one of the TYPES constant hash values. def type=(v) - RestrictionValidator.validate :storage_type, TYPES.values, v + RestrictionValidator.validate :storage_type, TYPES.values, v @type = v end - # Creates a new storage object. + # Creates a new storage object. # @param [String] name the name of the storage # @option options [Integer] color (black) # @option options [Integer] type (storage) @@ -141,6 +141,6 @@ module Axlsx @type ||= (data.nil? ? TYPES[:storage] : TYPES[:stream]) self.name = name end - + end end diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb index 71f08a2f..61957df0 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb @@ -52,7 +52,7 @@ module Axlsx end # Sets the col_id attribute for this filter column. - # @param [Integer | Cell] column_index The zero based index of the column to which this filter applies. + # @param [Integer | Cell] column_index The zero based index of the column to which this filter applies. # When you specify a cell, the column index will be read off the cell # @return [Integer] def col_id=(column_index) diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb index faa22374..215b66fe 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb @@ -1,6 +1,6 @@ module Axlsx - # When multiple values are chosen to filter by, or when a group of date values are chosen to filter by, + # When multiple values are chosen to filter by, or when a group of date values are chosen to filter by, # this object groups those criteria together. class Filters include Axlsx::OptionsParser @@ -29,7 +29,7 @@ module Axlsx # @return [Boolean] attr_reader :blank - # Calendar type for date grouped items. + # Calendar type for date grouped items. # Used to interpret the values in dateGroupItem. # This is the calendar type used to evaluate all dates in the filter column, # even when those dates are not using the same calendar system / date formatting. @@ -81,7 +81,7 @@ module Axlsx str << '</filters>' end - # not entirely happy with this. + # not entirely happy with this. # filter_items should be a simple typed list that overrides << etc # to create Filter objects from the inserted values. However this # is most likely so rarely used...(really? do you know that?) @@ -200,7 +200,7 @@ include Axlsx::SerializedAttributes end # The day value for the date group item - # This must be between 1 and 31 + # This must be between 1 and 31 # @note no attempt is made to ensure the date value is valid for any given month def day=(value) RangeValidator.validate "DateGroupItem.day", 0, 31, value diff --git a/lib/axlsx/workbook/worksheet/border_creator.rb b/lib/axlsx/workbook/worksheet/border_creator.rb index bbd30473..2830eaff 100644 --- a/lib/axlsx/workbook/worksheet/border_creator.rb +++ b/lib/axlsx/workbook/worksheet/border_creator.rb @@ -13,7 +13,7 @@ module Axlsx if @edges == :all @edges = Axlsx::Border::EDGES elsif [email protected]_a?(Array) - raise ArgumentError.new("Invalid edges provided, #{@edges}") + raise ArgumentError.new("Invalid edges provided, #{@edges}") else @edges = @edges.map{|x| x&.to_sym}.uniq @@ -26,15 +26,15 @@ module Axlsx def draw if @cells.size == 1 @worksheet.add_style( - first_cell, + first_cell, { border: {style: @style, color: @color, edges: @edges} } ) else - @edges.each do |edge| + @edges.each do |edge| @worksheet.add_style( - border_cells[edge], + border_cells[edge], { border: {style: @style, color: @color, edges: [edge]} } diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 125ca051..301ce22f 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -104,7 +104,7 @@ module Axlsx self.raw_style = new_style wb = row.worksheet.workbook - + wb.styled_cells << self end diff --git a/lib/axlsx/workbook/worksheet/col_breaks.rb b/lib/axlsx/workbook/worksheet/col_breaks.rb index 2f1ec1b0..c803fc70 100644 --- a/lib/axlsx/workbook/worksheet/col_breaks.rb +++ b/lib/axlsx/workbook/worksheet/col_breaks.rb @@ -1,7 +1,7 @@ module Axlsx # A collection of Brake objects. - # Please do not use this class directly. Instead use + # Please do not use this class directly. Instead use # Worksheet#add_break class ColBreaks < SimpleTypedList @@ -12,7 +12,7 @@ module Axlsx # A column break specific helper for adding a break. # @param [Hash] options A list of options to pass into the Break object - # The max and man options are fixed, however any other valid option for + # The max and man options are fixed, however any other valid option for # Break will be passed to the created break object. # @see Break def add_break(options) diff --git a/lib/axlsx/workbook/worksheet/color_scale.rb b/lib/axlsx/workbook/worksheet/color_scale.rb index 287e6869..127b3e96 100644 --- a/lib/axlsx/workbook/worksheet/color_scale.rb +++ b/lib/axlsx/workbook/worksheet/color_scale.rb @@ -28,7 +28,7 @@ module Axlsx # A builder for three tone color gradient # @example # #this creates a three tone color scale - # color_scale = Axlsx::ColorScale.three_tone + # color_scale = Axlsx::ColorScale.three_tone # @see examples/example.rb conditional formatting examples. def three_tone self.new({:type => :min, :val => 0, :color => 'FFF8696B'}, diff --git a/lib/axlsx/workbook/worksheet/comment.rb b/lib/axlsx/workbook/worksheet/comment.rb index e5dbe41c..5230c940 100644 --- a/lib/axlsx/workbook/worksheet/comment.rb +++ b/lib/axlsx/workbook/worksheet/comment.rb @@ -82,7 +82,7 @@ module Axlsx pos = Axlsx::name_to_indices(ref) @vml_shape = VmlShape.new(:row => pos[1], :column => pos[0], :visible => @visible) do |vml| vml.left_column = vml.column - vml.right_column = vml.column + 2 + vml.right_column = vml.column + 2 vml.top_row = vml.row vml.bottom_row = vml.row + 4 end diff --git a/lib/axlsx/workbook/worksheet/conditional_formatting.rb b/lib/axlsx/workbook/worksheet/conditional_formatting.rb index 7b1783bd..0ed065e6 100644 --- a/lib/axlsx/workbook/worksheet/conditional_formatting.rb +++ b/lib/axlsx/workbook/worksheet/conditional_formatting.rb @@ -7,7 +7,7 @@ module Axlsx class ConditionalFormatting include Axlsx::OptionsParser - + # Creates a new {ConditionalFormatting} object # @option options [Array] rules The rules to apply # @option options [String] sqref The range to apply the rules to diff --git a/lib/axlsx/workbook/worksheet/dimension.rb b/lib/axlsx/workbook/worksheet/dimension.rb index a7f9b792..48b3a1c2 100644 --- a/lib/axlsx/workbook/worksheet/dimension.rb +++ b/lib/axlsx/workbook/worksheet/dimension.rb @@ -1,7 +1,7 @@ module Axlsx # This class manages the dimensions for a worksheet. - # While this node is optional in the specification some readers like + # While this node is optional in the specification some readers like # LibraOffice require this node to render the sheet class Dimension @@ -31,7 +31,7 @@ module Axlsx # @return [String] def sqref "#{first_cell_reference}:#{last_cell_reference}" - end + end # serialize the object # @return [String] diff --git a/lib/axlsx/workbook/worksheet/pane.rb b/lib/axlsx/workbook/worksheet/pane.rb index 2bc77495..321294da 100644 --- a/lib/axlsx/workbook/worksheet/pane.rb +++ b/lib/axlsx/workbook/worksheet/pane.rb @@ -24,16 +24,16 @@ module Axlsx # Active Pane # The pane that is active. - # Options are + # Options are # * bottom_left: Bottom left pane, when both vertical and horizontal # splits are applied. This value is also used when only - # a horizontal split has been applied, dividing the pane - # into upper and lower regions. In that case, this value + # a horizontal split has been applied, dividing the pane + # into upper and lower regions. In that case, this value # specifies the bottom pane. # * bottom_right: Bottom right pane, when both vertical and horizontal # splits are applied. # * top_left: Top left pane, when both vertical and horizontal splits - # are applied. This value is also used when only a horizontal + # are applied. This value is also used when only a horizontal # split has been applied, dividing the pane into upper and lower # regions. In that case, this value specifies the top pane. # This value is also used when only a vertical split has @@ -41,8 +41,8 @@ module Axlsx # regions. In that case, this value specifies the left pane # * top_right: Top right pane, when both vertical and horizontal # splits are applied. This value is also used when only - # a vertical split has been applied, dividing the pane - # into right and left regions. In that case, this value + # a vertical split has been applied, dividing the pane + # into right and left regions. In that case, this value # specifies the right pane. # @see type # @return [Symbol] @@ -51,12 +51,12 @@ module Axlsx # Split State - # Indicates whether the pane has horizontal / vertical + # Indicates whether the pane has horizontal / vertical # splits, and whether those splits are frozen. - # Options are + # Options are # * frozen: Panes are frozen, but were not split being frozen. In # this state, when the panes are unfrozen again, a single - # pane results, with no split. In this state, the split + # pane results, with no split. In this state, the split # bars are not adjustable. # * frozen_split: Panes are frozen and were split before being frozen. In # this state, when the panes are unfrozen again, the split @@ -69,7 +69,7 @@ module Axlsx attr_reader :state # Top Left Visible Cell - # Location of the top left visible cell in the bottom + # Location of the top left visible cell in the bottom # right pane (when in Left-To-Right mode). # @see type # @return [String] @@ -78,7 +78,7 @@ module Axlsx # Horizontal Split Position # Horizontal position of the split, in 1/20th of a point; 0 (zero) - # if none. If the pane is frozen, this value indicates the number + # if none. If the pane is frozen, this value indicates the number # of columns visible in the top pane. # @see type # @return [Integer] @@ -86,7 +86,7 @@ module Axlsx attr_reader :x_split # Vertical Split Position - # Vertical position of the split, in 1/20th of a point; 0 (zero) + # Vertical position of the split, in 1/20th of a point; 0 (zero) # if none. If the pane is frozen, this value indicates the number # of rows visible in the left pane. # @see type diff --git a/lib/axlsx/workbook/worksheet/protected_range.rb b/lib/axlsx/workbook/worksheet/protected_range.rb index e990f1cb..492b2254 100644 --- a/lib/axlsx/workbook/worksheet/protected_range.rb +++ b/lib/axlsx/workbook/worksheet/protected_range.rb @@ -42,6 +42,6 @@ module Axlsx # objects created during serialization def to_xml_string(str="") serialized_tag 'protectedRange', str - end + end end end diff --git a/lib/axlsx/workbook/worksheet/row.rb b/lib/axlsx/workbook/worksheet/row.rb index 63a8d328..62ceb59c 100644 --- a/lib/axlsx/workbook/worksheet/row.rb +++ b/lib/axlsx/workbook/worksheet/row.rb @@ -6,7 +6,7 @@ module Axlsx class Row < SimpleTypedList include SerializedAttributes include Accessors - + # No support is provided for the following attributes # spans # thickTop @@ -64,7 +64,7 @@ module Axlsx # @see Row#s def s=(v) Axlsx.validate_unsigned_numeric(v) - @custom_format = true + @custom_format = true @s = v end @@ -73,7 +73,7 @@ module Axlsx Axlsx.validate_unsigned_numeric(v) @outline_level = v end - + alias :outlineLevel= :outline_level= # The index of this row in the worksheet @@ -126,7 +126,7 @@ module Axlsx @ht = v end end - + # return cells def cells self diff --git a/lib/axlsx/workbook/worksheet/row_breaks.rb b/lib/axlsx/workbook/worksheet/row_breaks.rb index c6ec89a9..0e6e8646 100644 --- a/lib/axlsx/workbook/worksheet/row_breaks.rb +++ b/lib/axlsx/workbook/worksheet/row_breaks.rb @@ -17,7 +17,7 @@ module Axlsx self << Break.new(options.merge(:max => 16383, :man => true)) last end - + # <rowBreaks count="3" manualBreakCount="3"> # <brk id="1" max="16383" man="1"/> # <brk id="7" max="16383" man="1"/> diff --git a/lib/axlsx/workbook/worksheet/selection.rb b/lib/axlsx/workbook/worksheet/selection.rb index fcb06c13..753b3a35 100644 --- a/lib/axlsx/workbook/worksheet/selection.rb +++ b/lib/axlsx/workbook/worksheet/selection.rb @@ -40,16 +40,16 @@ module Axlsx # Pane # The pane to which this selection belongs. - # Options are + # Options are # * bottom_left: Bottom left pane, when both vertical and horizontal # splits are applied. This value is also used when only - # a horizontal split has been applied, dividing the pane - # into upper and lower regions. In that case, this value + # a horizontal split has been applied, dividing the pane + # into upper and lower regions. In that case, this value # specifies the bottom pane. # * bottom_right: Bottom right pane, when both vertical and horizontal # splits are applied. # * top_left: Top left pane, when both vertical and horizontal splits - # are applied. This value is also used when only a horizontal + # are applied. This value is also used when only a horizontal # split has been applied, dividing the pane into upper and lower # regions. In that case, this value specifies the top pane. # This value is also used when only a vertical split has @@ -57,8 +57,8 @@ module Axlsx # regions. In that case, this value specifies the left pane # * top_right: Top right pane, when both vertical and horizontal # splits are applied. This value is also used when only - # a vertical split has been applied, dividing the pane - # into right and left regions. In that case, this value + # a vertical split has been applied, dividing the pane + # into right and left regions. In that case, this value # specifies the right pane. # @see type # @return [Symbol] diff --git a/lib/axlsx/workbook/worksheet/sheet_data.rb b/lib/axlsx/workbook/worksheet/sheet_data.rb index a7b8735b..0b697fbb 100644 --- a/lib/axlsx/workbook/worksheet/sheet_data.rb +++ b/lib/axlsx/workbook/worksheet/sheet_data.rb @@ -9,7 +9,7 @@ module Axlsx raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet) @worksheet = worksheet end - + attr_reader :worksheet # Serialize the sheet data @@ -17,11 +17,11 @@ module Axlsx # @return [String] def to_xml_string(str = '') str << '<sheetData>' - worksheet.rows.each_with_index do |row, index| - row.to_xml_string(index, str) + worksheet.rows.each_with_index do |row, index| + row.to_xml_string(index, str) end str << '</sheetData>' end - + end end diff --git a/lib/axlsx/workbook/worksheet/sheet_format_pr.rb b/lib/axlsx/workbook/worksheet/sheet_format_pr.rb index 12c2e3b2..f7cff58c 100644 --- a/lib/axlsx/workbook/worksheet/sheet_format_pr.rb +++ b/lib/axlsx/workbook/worksheet/sheet_format_pr.rb @@ -42,7 +42,7 @@ module Axlsx boolean_attr_accessor :custom_height, :zero_height, :thick_top, :thick_bottom - unsigned_int_attr_accessor :base_col_width, :outline_level_row, :outline_level_col + unsigned_int_attr_accessor :base_col_width, :outline_level_row, :outline_level_col # serializes this object to an xml string # @param [String] str The string this objects serialization will be appended to diff --git a/lib/axlsx/workbook/worksheet/sheet_pr.rb b/lib/axlsx/workbook/worksheet/sheet_pr.rb index fd6dad2b..e369cb52 100644 --- a/lib/axlsx/workbook/worksheet/sheet_pr.rb +++ b/lib/axlsx/workbook/worksheet/sheet_pr.rb @@ -62,7 +62,7 @@ module Axlsx def page_setup_pr @page_setup_pr ||= PageSetUpPr.new end - + # The OutlinePr for this sheet pr object # @return [OutlinePr] def outline_pr diff --git a/lib/axlsx/workbook/worksheet/sheet_protection.rb b/lib/axlsx/workbook/worksheet/sheet_protection.rb index c6142be5..b7aa56b6 100644 --- a/lib/axlsx/workbook/worksheet/sheet_protection.rb +++ b/lib/axlsx/workbook/worksheet/sheet_protection.rb @@ -50,9 +50,9 @@ module Axlsx # default nil attr_reader :password - # This block is intended to implement the salt_value, hash_value and spin count as per the ECMA-376 standard. - # However, it does not seem to actually work in EXCEL - instead they are using their old retro algorithm shown below - # defined in the transitional portion of the speck. I am leaving this code in in the hope that someday Ill be able to + # This block is intended to implement the salt_value, hash_value and spin count as per the ECMA-376 standard. + # However, it does not seem to actually work in EXCEL - instead they are using their old retro algorithm shown below + # defined in the transitional portion of the speck. I am leaving this code in in the hope that someday Ill be able to # figure out why it does not work, and if Excel even supports it. # def propper_password=(v) # @algorithm_name = v == nil ? nil : 'SHA-1' diff --git a/lib/axlsx/workbook/worksheet/sheet_view.rb b/lib/axlsx/workbook/worksheet/sheet_view.rb index 434f7b7a..f7b0f7bf 100644 --- a/lib/axlsx/workbook/worksheet/sheet_view.rb +++ b/lib/axlsx/workbook/worksheet/sheet_view.rb @@ -5,7 +5,7 @@ module Axlsx # @note The recommended way to manage the sheet view is via Worksheet#sheet_view # @see Worksheet#sheet_view class SheetView - + include Axlsx::OptionsParser include Axlsx::Accessors include Axlsx::SerializedAttributes @@ -66,11 +66,11 @@ module Axlsx # @return [Hash] attr_reader :selections - # + # # Color Id # Index to the color value for row/column - # text headings and gridlines. This is an - # 'index color value' (ICV) rather than + # text headings and gridlines. This is an + # 'index color value' (ICV) rather than # rgb value. # @see type # @return [Integer] @@ -78,18 +78,18 @@ module Axlsx attr_reader :color_id # Top Left Visible Cell - # Location of the top left visible cell Location + # Location of the top left visible cell Location # of the top left visible cell in the bottom right # pane (when in Left-to-Right mode). # @see type # @return [String] # default nil attr_reader :top_left_cell - - + + # View Type # Indicates the view type. - # Options are + # Options are # * normal: Normal view # * page_break_preview: Page break preview # * page_layout: Page Layout View @@ -99,62 +99,62 @@ module Axlsx attr_reader :view # Workbook View Index - # Zero-based index of this workbook view, pointing + # Zero-based index of this workbook view, pointing # to a workbookView element in the bookViews collection. # @see type - # @return [Integer] + # @return [Integer] # default 0 attr_reader :workbook_view_id # Zoom Scale - # Window zoom magnification for current view + # Window zoom magnification for current view # representing percent values. This attribute - # is restricted to values ranging from 10 to 400. + # is restricted to values ranging from 10 to 400. # Horizontal & Vertical scale together. - # Current view can be Normal, Page Layout, or + # Current view can be Normal, Page Layout, or # Page Break Preview. # @see type - # @return [Integer] + # @return [Integer] # default 100 attr_reader :zoom_scale # Zoom Scale Normal View - # Zoom magnification to use when in normal view, - # representing percent values. This attribute is - # restricted to values ranging from 10 to 400. + # Zoom magnification to use when in normal view, + # representing percent values. This attribute is + # restricted to values ranging from 10 to 400. # Horizontal & Vertical scale together. - # Applies for worksheets only; zero implies the + # Applies for worksheets only; zero implies the # automatic setting. # @see type - # @return [Integer] + # @return [Integer] # default 0 attr_reader :zoom_scale_normal # Zoom Scale Page Layout View - # Zoom magnification to use when in page layout - # view, representing percent values. This attribute - # is restricted to values ranging from 10 to 400. + # Zoom magnification to use when in page layout + # view, representing percent values. This attribute + # is restricted to values ranging from 10 to 400. # Horizontal & Vertical scale together. - # Applies for worksheets only; zero implies + # Applies for worksheets only; zero implies # the automatic setting. # @see type - # @return [Integer] + # @return [Integer] # default 0 attr_reader :zoom_scale_page_layout_view # Zoom Scale Page Break Preview - # Zoom magnification to use when in page break - # preview, representing percent values. This - # attribute is restricted to values ranging + # Zoom magnification to use when in page break + # preview, representing percent values. This + # attribute is restricted to values ranging # from 10 to 400. Horizontal & Vertical scale # together. - # Applies for worksheet only; zero implies + # Applies for worksheet only; zero implies # the automatic setting. # @see type - # @return [Integer] + # @return [Integer] # default 0 attr_reader :zoom_scale_sheet_layout_view @@ -172,7 +172,7 @@ module Axlsx # @see top_left_cell def top_left_cell=(v) cell = (v.class == Axlsx::Cell ? v.r_abs : v) - Axlsx::validate_string(cell) + Axlsx::validate_string(cell) @top_left_cell = cell end diff --git a/lib/axlsx/workbook/worksheet/table.rb b/lib/axlsx/workbook/worksheet/table.rb index 992486d2..881f12e7 100644 --- a/lib/axlsx/workbook/worksheet/table.rb +++ b/lib/axlsx/workbook/worksheet/table.rb @@ -64,7 +64,7 @@ module Axlsx end end - # TableStyleInfo for the table. + # TableStyleInfo for the table. # initialization can be fed via the :style_info option def table_style_info @table_style_info ||= TableStyleInfo.new diff --git a/lib/axlsx/workbook/worksheet/table_style_info.rb b/lib/axlsx/workbook/worksheet/table_style_info.rb index 22d85d41..c4678310 100644 --- a/lib/axlsx/workbook/worksheet/table_style_info.rb +++ b/lib/axlsx/workbook/worksheet/table_style_info.rb @@ -15,7 +15,7 @@ module Axlsx # @option [Boolean] show_column_stripes indicates if column stripes should # be shown # @option [Boolean] show_row_stripes indicates if row stripes should be shown - # @option [String] name The name of the style to apply to your table. + # @option [String] name The name of the style to apply to your table. # Only predefined styles are currently supported. # @see Annex G. (normative) Predefined SpreadsheetML Style Definitions in part 1 of the specification. def initialize(options = {}) diff --git a/lib/axlsx/workbook/worksheet/worksheet_comments.rb b/lib/axlsx/workbook/worksheet/worksheet_comments.rb index f9e4c8cd..c6dd5545 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_comments.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_comments.rb @@ -24,7 +24,7 @@ module Axlsx # @see Comments#add_comment def add_comment(options={}) comments.add_comment(options) - end + end # The relationships defined by this objects comments collection # @return [Relationships] |
