summaryrefslogtreecommitdiffhomepage
path: root/test/tc_package.rb
AgeCommit message (Collapse)Author
2023-06-10Fix safe Style/ColonMethodCall offensesGeremia Taglialatela
Caxlsx is using both `.` and `::`, 220 occurrences vs 280 to invoke methods on `Axlsx` module. This commit standardizes the approach towards `.`, which will also allow shorter lines. Performance is not affected ``` Comparison: Axlsx.validate: 8515252.3 i/s Axlsx::validate: 8512863.7 i/s - same-ish: difference falls within error ```
2023-05-22Use Ruby 1.9 hash syntax (non-production code)Geremia Taglialatela
2023-05-04Enable Style/FrozenStringLiteralComment and autocorrectPaul Kmiec
2023-05-03Fix unescaped dot in regexp and convert to includeGeremia Taglialatela
2023-05-03Introduce RuboCop performanceGeremia Taglialatela
Also fixes performance offences in non-production code
2023-05-03Fix non-production Style/NumericLiterals offensesGeremia Taglialatela
2023-05-03Fix Style/RedundantFileExtensionInRequire offenseGeremia Taglialatela
2023-05-03Add RuboCop MinitestGeremia Taglialatela
2023-05-03Fix offenses to non-production codeGeremia Taglialatela
- Lint/AmbiguousBlockAssociation - Lint/AmbiguousOperatorPrecedence - Lint/EmptyBlock - Lint/RedundantSplatExpansion - Lint/RedundantStringCoercion - Lint/SymbolConversion - Lint/UnusedBlockArgument - Style/BlockDelimiters - Style/CommentAnnotation - Style/EachForSimpleLoop - Style/EmptyMethod - Style/ExpandPathArguments - Style/FileWrite - Style/GlobalStdStream (UNSAFE) - Style/HashEachMethods (UNSAFE) - Style/NestedParenthesizedCalls - Style/NilComparison - Style/NumericLiteralPrefix (manually fixed) - Style/ParallelAssignment - Style/PreferredHashMethods (UNSAFE) - Style/RedundantInterpolation (UNSAFE) - Style/RedundantParentheses (UNSAFE) - Style/RegexpLiteral - Style/RescueStandardError - Style/SpecialGlobalVars (UNSAFE) - Style/SymbolProc (UNSAFE) - Style/ZeroLengthPredicate (UNSAFE)
2023-04-10Fix Layout/LeadingCommentSpace offensesGeremia Taglialatela
``` rubocop --only Layout/LeadingCommentSpace -a ```
2023-04-08Fix space-related offensesGeremia Taglialatela
- Layout/SpaceAfterComma - Layout/SpaceAroundEqualsInParameterDefault - Layout/SpaceAroundOperators - Layout/SpaceBeforeBlockBraces - Layout/SpaceInsideBlockBraces - Layout/SpaceInsideHashLiteralBraces - Layout/SpaceInsideParens
2023-04-08Fix EmptyLines related offensesGeremia Taglialatela
2023-04-06Fix Layout/EmptyLines offensesGeremia Taglialatela
``` rubocop --only Layout/EmptyLines -a ```
2023-04-06Fix Style/Encoding offensesGeremia Taglialatela
``` rubocop --only Style/Encoding -a ```
2022-10-12Resolve all TODOsWeston Ganger
2022-07-12Move "capture warning" test helper to its own moduleKoza
2022-04-07Sort archive entries for correct MIME detection with file commandytjmt
2022-03-02instance_values -> instance_values_forpjskennedy
2022-03-02Update references to use new class methodpjskennedy
2022-01-21Check string encoding for validity _and_ valueDan DeBruler
2021-12-28Return output stream in binmodeDan DeBruler
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.
2021-02-17Merge pull request #57 from rylwin/change-serialize-signatureNoel Peden
Deprecate using `#serialize` with boolean argument
2020-09-11Restructure examples folder (#47)Zsolt Kozaroczy
Split examples into separate markdown files, each containing a description, sample code, and a screenshot of the resulting xlsx document. The script `generate.rb` is provided to actually generate the example documents by executing the sample code contained in the markdown files.
2020-08-29Avoid warning when using `capture_warnings` more than onceRyan Winograd
2020-08-29Update #serialize to accept 3 argumentsRyan Winograd
2020-08-29Assert how contents are zippedRyan Winograd
Previously we tested that either rubyzip or shelling out to zip produced the expected xlsx file, but we never explicitly checked whether rubyzip or shell zip was used. I noticed that rubyzip always sets a far future date, whereas `zip` uses today's date. I'm using this as a heuristic to determine which zip method was used.
2020-08-20Actual fix for older rubiesRyan Winograd
2020-08-20Fix for older rubies?Ryan Winograd
2020-08-20Deprecate using `#serialize` with boolean argumentRyan Winograd
Update `Axlsx::Package#serialize` to accept the second argument as a boolean (being deprecated) or an options hash. In order to transition toward using keyword arguments for `Axlsx::Package#serialize`, change the documented method signature to an options hash, while still parsing the second argument as `confirm_valid` if a boolean is provided (in which case we also warn the user that a boolean argument is deprecated).
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
2020-08-19Remove unnecessary rescue in testsRyan Winograd
Back in `1e5388ce`, a rescue block was added to `#test_serialization` to prevent the test from breaking on boxes where the file system is not writable. This extra protection doesn't seem necessary anymore, so we are removing the protection in favor of letting the test error in this case.
2019-10-02Cache relationship in Hash rather than in Array.Vladimir Kochnev
Also cacle only ids, not entire instances.
2019-10-02Fix Relationship.instances cache.Vladimir Kochnev
This PR aims to fix several issues with Relationship cache: 1) It's not threadsafe, so I propose to use a TLS variable for this. 2) Memory obtained by cache remains non-freed before the next run of `serialize`. I think it should be freed immediately. 3) Memory should be freed in `ensure` block to prevent memory bloating in case of exception. *There are only two hard things in Computer Science: cache invalidation and naming things.*
2018-02-08chore(coverage) increase coverage and cleanuprandym
2017-05-10Add spec coverage for correct MIME detectionChi-Fung Fan
2015-01-12Fix #fit_to to work correctly and fix tests under Ruby 2.2.0Jurriaan Pruis
9999 is too big
2013-10-09Add support for bubble chartsJean-Philippe Moal
2013-09-29Integrate workbook views and alter serializationRandy Morgan
This integrates workbook views and sheet state into serialization. I also noticed that we were populating defined names during serialization. While it is good to delay this as late as possible as there is always the chance that some conditional programming by the consumer adds, and then removes an autofilter, I am choosing to risk it at this point for cleaner code.
2013-09-13repair pivot table data ref populate and bring coverage back up to 100%Randy Morgan
2013-09-13Fixes for anchor swapping when adding images. - Two -> One swap still pending.Randy Morgan
2013-08-29upgrade to rubyzip 1.0.0Delwyn de Villiers
2013-07-12use 1.8.7 syntaxRandy Morgan
2013-07-08Implement Relationship.clear_cached_instances, use it before serializing the ↵Stefan Daschek
package. This is necessary to make serialization idempotent (i.e. make sure that Relationship instances are generated with the same IDs everytime the package is serialized). It also fixes a memory leak if Axlsx is used in a long running server process (eg a Rails app).
2013-07-08Make sure serializing axlsx packages with identical contents always results ↵Stefan Daschek
in identical zip files. This improves the possibilites for caching and/or consolidating the generated zip (xlsx) files. Up to now, serializing the same package at different times resulted in different zip files because of the timestamp in the zip entry metadata. Note: To generate identical packages (and thus identical zip files), you'll have set Core#created explicitly, eg. with `Package.new(created_at: Time.local(2013, 1, 1)`.
2013-06-12Allow overriding the 'created' timestamp in the docprops.Stefan Daschek
Can be specified as option to Package#new: ``` Axlsx::Package.new :created_at => time ``` If omitted, the current time at the moment the document is serialized will be used. This change is therefore fully backward compatible.
2012-12-19changed outline_row to outline_level_row to minimize confusion with bordersRandy Morgan
2012-12-15Added methods to simplify outlining with specsRandy Morgan
worksheet#outline_rows worksheet#outline_columns
2012-12-04Moved defined names in workbook to be serialized before pivot tablesRandy Morgan
This fixes https://github.com/randym/axlsx/issues/150
2012-11-28Commented out defined_name testRandy Morgan
Seems the validation crashes on this, and it should not. Need to dig in and work it out.