| Age | Commit message (Collapse) | Author |
|
No performance gain, this can be seen as a cosmetic change to have
shorter lines
|
|
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
```
|
|
Fix negated if offenses
|
|
Should also provide a negligible performance improvement, about 3%
on Ruby 3.2 and 6% on Ruby 2.6 (M1 Pro)
|
|
- Style/ParenthesesAroundCondition
- Style/RedundantParentheses
- Style/TernaryParentheses
`Style/ParenthesesAroundCondition` may be questionable, but a majority
of comparison where not using parentheses, so offenses have been fixed
for uniformity across the codebase
|
|
|
|
Also refactors Page margins to avoid code duplication
|
|
|
|
Fix Style/ZeroLengthPredicate unsafe offenses
|
|
Remove minor safe offenses
|
|
- Use https where possible
- Capitalize Excel
|
|
|
|
- Style/RaiseArgs
- Style/RedundantCondition
- Style/RedundantReturn
- Style/SelfAssignment
- Style/SoleNestedConditional
|
|
Zip::OutputStream
The BufferedZipOutputStream is a drop-in replacement for Zip::OutputStream similar
to ZipCommand.
|
|
|
|
- Lint/RedundantStringCoercion
- Style/CommentAnnotation offenses
- Style/DefWithParentheses
- Style/EvalWithLocation
- Style/MethodCallWithoutArgsParentheses
- Style/MethodDefParentheses
- Style/NilComparison
- Style/Semicolon
|
|
|
|
Add RuboCop (and fix simple whitespace, magic comment, trailing comma offenses)
|
|
```
rubocop --only Layout/LeadingCommentSpace -a
```
|
|
Configure with `AllowBeforeTrailingComments: true`
|
|
|
|
```
rubocop --only Layout/ArgumentAlignment -a
```
|
|
If argument starts with a pipe character (`'|'`) and the receiver is
the `IO` class, a subprocess is created in the same way as
`Kernel#open`, and its output is returned. `Kernel#open` may allow
unintentional command injection, which is the reason these `IO` methods
are a security risk. Consider to use `File.read` to disable the
behavior of subprocess invocation.
Close #193
Ref: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Security/IoMethods
|
|
```
rubocop --only Layout/EmptyLineAfterGuardClause -a
```
|
|
- Layout/SpaceAfterComma
- Layout/SpaceAroundEqualsInParameterDefault
- Layout/SpaceAroundOperators
- Layout/SpaceBeforeBlockBraces
- Layout/SpaceInsideBlockBraces
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideParens
|
|
```
rubocop --only Layout/MultilineOperationIndentation -a
```
|
|
```
rubocop --only Layout/SpaceAroundKeyword -a
```
|
|
```
rubocop --only Layout/FirstArrayElementIndentation -a
```
|
|
```
rubocop --only Layout/EmptyLineBetweenDefs -a
```
|
|
```
rubocop --only Layout/EmptyLines -a
```
|
|
```
rubocop --only Style/Encoding -a
```
|
|
```
rubocop --only Layout/TrailingWhitespace -a
```
|
|
|
|
Not using binary mode can cause encoding issues, see #138.
|
|
|
|
|
|
|
|
|
|
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).
|
|
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
|
|
|
|
|
|
See https://github.com/randym/axlsx/pull/606
|
|
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.
|
|
Also cacle only ids, not entire instances.
|
|
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.*
|
|
|
|
|
|
|
|
|