summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx.rb
AgeCommit message (Collapse)Author
2023-10-02Set escape_formulas as "true" as a global default.johnnyshields
2023-07-04Merge pull request #289 from tagliala/chore/282-require-cgi-at-module-levelZsolt Kozaroczy
Require 'cgi' at module level
2023-07-02Require 'cgi' at module levelGeremia Taglialatela
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
2023-07-01Fix Style/PreferredHashMethods offenseGeremia Taglialatela
`Gem.loaded_specs` is a hash, so it is safe to use `key?` and enable this cop
2023-05-31Use Ruby 1.9 hash syntaxGeremia Taglialatela
2023-05-24Fix axlsx_styler gem errorWeston Ganger
2023-05-21Improve commentsGeremia Taglialatela
- Use https where possible - Capitalize Excel
2023-05-18Fix YARD warningsGeremia Taglialatela
- `should_use_same_id_as?` has been replaced by `ids_cache_key` in 913003e Also fixes a typo [ci skip]
2023-05-17Merge branch 'master' into serializedAttributesZsolt Kozaroczy
2023-05-15Booleanize as string instead of 0 / 1 only to call to_sPaul Kmiec
The `booleanize` method is always used to pipe values to str, so it is safe to return the boolean values as strings.
2023-05-15Serialize attributes more efficientlyPaul Kmiec
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.
2023-05-15Also cache row_refPaul Kmiec
The `row_ref` method is called once for each column in a row and once at the row level.
2023-05-15Corrected rubocop offenses in lib/axlsx.rb / test/tc_axlsx.rbPaul Kmiec
2023-05-15Cache col_ref to avoid allocationsPaul Kmiec
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`
2023-05-05Introduce BufferedZipOutputStream to avoid lots of small writes to ↵Paul Kmiec
Zip::OutputStream The BufferedZipOutputStream is a drop-in replacement for Zip::OutputStream similar to ZipCommand.
2023-05-04Fix tests / code to work with frozen string literalsPaul Kmiec
2023-05-04Enable Style/FrozenStringLiteralComment and autocorrectPaul Kmiec
2023-04-12Fix warnings with Ruby 2.xKoza
2023-04-13Merge branch 'master' into escape-formulas-improvementJohnny Shields
2023-04-10Fix Layout/LeadingCommentSpace offensesGeremia Taglialatela
``` rubocop --only Layout/LeadingCommentSpace -a ```
2023-04-09Fix Layout/ExtraSpacing offensesGeremia Taglialatela
Configure with `AllowBeforeTrailingComments: true`
2023-04-08Fix space-related offensesGeremia Taglialatela
- Layout/SpaceAfterComma - Layout/SpaceAroundEqualsInParameterDefault - Layout/SpaceAroundOperators - Layout/SpaceBeforeBlockBraces - Layout/SpaceInsideBlockBraces - Layout/SpaceInsideHashLiteralBraces - Layout/SpaceInsideParens
2023-04-06Fix Style/Encoding offensesGeremia Taglialatela
``` rubocop --only Style/Encoding -a ```
2023-04-01Fix global setting of escape_formulasjohnnyshields
2023-03-31Add settings for escape_formulas at global, workbook, worksheet, row and ↵johnnyshields
cell levels.
2022-10-12Add example images, Fix axlsx_styler checkWeston Ganger
2022-10-09ImprovementsWeston Ganger
2022-10-09Remove active_support dependency from axlsx_stylerWeston Ganger
2022-03-02instance_values -> instance_values_forpjskennedy
2022-03-02Remove monkey patch on Objectpjskennedy
2021-12-29Fix Worksheet#name_to_cell bug which returned reversed row/col indexesWeston Ganger
2021-04-26Optimize Axlsx.cell_range (#94)Oleg Yakovenko
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).
2021-03-27Replace mimemagic with marcel (#95)Jorne Kandziora
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.
2020-08-19Add option to `#serialize` with system zip commandRyan Winograd
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
2019-12-03Remove unused / stubbed code related to parsing xlsx filesStefan Daschek
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.
2018-02-07Merge branch 'master' into release-3.0.0randym
2017-11-30Axlsx.sanitize() writes in place or copies on writeWinfield Peterson
Depending on whether a string is frozen, either a new string is created sanitized or the existing string is modified in place.
2017-11-29Axlsx.sanitize uses delete() vs. delete!() for frozen stringsWinfield Peterson
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.
2017-04-01chore(string): remove patching of Stringrandym
2015-07-03Extract mime type detection to an utility classmarc
2015-07-03Validates whether an image is acceptable through mime typemarc
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.
2014-04-04Fix boolean values so the output matches Excel and works on NumbersJurriaan Pruis
Use 1 or 0 instead of 'true' or 'false' in the XML output
2014-02-26Huge refactoringJurriaan Pruis
Do not create huge strings Let Row inherit from SimpleTypedList Optimized sanitizing Optimized validation And more..
2013-08-29upgrade to rubyzip 1.0.0Delwyn de Villiers
2013-08-17Extracted control char sanitization to module level and applied to shared ↵Randy Morgan
strings table output.
2013-02-04Added docs for Axlsx#range_to_aRandy Morgan
2013-01-10added documentation for trust_input and gemspec update.Randy Morgan
2013-01-10reduced processing of 3000 rows from 3+ seconds to just under 2Randy Morgan
2012-11-27Can configure a pivot table when creating itAlex Rothenberg
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
2012-10-14Refactored options parse into module and applied it to border_rbRandy Morgan
This should be done for all classes that use this same peice of repeated code.