| Age | Commit message (Collapse) | Author |
|
|
|
Require 'cgi' at module level
|
|
Previously, `require 'cgi'` was only called in `cell.rb`, but there are
other components in the Axlsx module that also use this dependency,
including `Axlsx::SeriesTitle`, `Axlsx::StrVal`, `Axlsx::Title`
(drawing), `Axlsx::Comment`, `Axlsx::ConditionalFormattingRule`, and
`Axlsx::HeaderFooter`.
By requiring cgi at the module level, we ensure that this dependency is
available to all components in the Axlsx module, which can prevent
issues if someone is requiring specific components that depend on cgi.
This change improves the maintainability and reliability of the codebase
by ensuring that all components have access to the required
dependencies.
Close #282
|
|
`Gem.loaded_specs` is a hash, so it is safe to use `key?` and enable
this cop
|
|
|
|
|
|
- Use https where possible
- Capitalize Excel
|
|
- `should_use_same_id_as?` has been replaced by `ids_cache_key` in 913003e
Also fixes a typo
[ci skip]
|
|
|
|
The `booleanize` method is always used to pipe values
to str, so it is safe to return the boolean values as
strings.
|
|
The attributes in rows, cells, styles, etc are pre-defined for each
type and almost never change. The current code, however, does not
take that into account by reading all instance variables (via
declared_attributes), filtering out the blank one and ones that are
not xml attributes, and by camelizing each one.
We can avoid all this extra work by computing the camels and ivars for
xml attributes once and directly read the instance variables we care
about.
|
|
The `row_ref` method is called once for each column in a row and once at the
row level.
|
|
|
|
In cases with lots of rows, each column will ask for its col_ref which will
always be the same for the same column_index. We can cache this to avoid
lots of small string allocations.
Modified `CellSerializer` to use `#col_ref` and `#row_ref` avoiding the string
allocation caused by `#col_r`
|
|
Zip::OutputStream
The BufferedZipOutputStream is a drop-in replacement for Zip::OutputStream similar
to ZipCommand.
|
|
|
|
|
|
|
|
|
|
```
rubocop --only Layout/LeadingCommentSpace -a
```
|
|
Configure with `AllowBeforeTrailingComments: true`
|
|
- Layout/SpaceAfterComma
- Layout/SpaceAroundEqualsInParameterDefault
- Layout/SpaceAroundOperators
- Layout/SpaceBeforeBlockBraces
- Layout/SpaceInsideBlockBraces
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideParens
|
|
```
rubocop --only Style/Encoding -a
```
|
|
|
|
cell levels.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Optimize Axlsx.cell_range by using minmax_by instead of sorting the cells (the sorted cells are not used for anything else in this method).
|
|
Mimemagic requires users to download or install additional files.
Rails used Marcel as an abstration layer on this library. Marcel
was updated to another file matching database. Following Rails in
this matter will remove the need for users to do additional work,
just to use caxlsx.
|
|
Add a `:zip_command` option to `Axlsx::Package#serialize` that allows
the user to specify an alternate command to use to perform the zip
operation on the XLSX file contents.
The default zip operation is provided by RubyZip. On large documents
users may experience faster zip times using a zip binary.
Resolves #55
|
|
This code was added in 3def8f8895 (back in 2011). It has never been worked on further since; `Axlsx::Parser` is not used anywhere in the whole codebase.
Currently there are no plans to support parsing xlsx file anytime soon, so let‘s remove all of this dead code.
|
|
|
|
Depending on whether a string is frozen, either a new string is created sanitized or the existing string is modified in place.
|
|
Whenever a frozen string is passed as an input to any sanitized value, we are modifying it in place which raised a RuntimeError if that string is frozen (as you might expect constants like header or workbook names to be). Use the safer delete() method which creates a new, modified copy of the string.
|
|
|
|
|
|
image/jpeg, image/png & image/gif are considered the allowed mime types
for an image. mimemagic gem is added as dependency in order to do the
checking.
Added tests to check against three supported mime types. A fake jpg
fixture (created with 'touch' command) has been added to test that
extension is no longer used.
|
|
Use 1 or 0 instead of 'true' or 'false' in the XML output
|
|
Do not create huge strings
Let Row inherit from SimpleTypedList
Optimized sanitizing
Optimized validation
And more..
|
|
|
|
strings table output.
|
|
|
|
|
|
|
|
see examples/pivot_table.rb
wb.add_worksheet(:name => "Data Sheet") do |sheet|
sheet.add_row ['Month', 'Year', 'Type', 'Sales', 'Region']
30.times { sheet.add_row [month, year, type, sales, region] }
sheet.add_pivot_table 'G4:L17', "A1:E31" do |pivot_table|
pivot_table.rows = ['Month', 'Year']
pivot_table.columns = ['Type']
pivot_table.data = ['Sales']
pivot_table.pages = ['Region']
end
end
|
|
This should be done for all classes that use this same peice of
repeated code.
|