| Age | Commit message (Collapse) | Author |
|
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
```
|
|
Prefer interpolation over concatenation
```
Comparison ("String#{'String'}" vs 'String' + 'String'):
interpolation: 11821321.0 i/s
concatenation: 8849491.7 i/s - 1.34x (± 0.00) slower
```
|
|
Also fixes a Security/Open offense that couldn't be exploited, because
the only invocation of `get_mime_type_from_uri` was validating the
input with a `URI::DEFAULT_PARSER` regexp
|
|
internal list instance
The `to_a` and `to_ary` now work more like standard Array methods with `to_a` returning a
new array containing the elements of self and `to_ary` returning self.
|
|
Currently the SimpleTypedList is wrapping `@list` Array and re-implementing
certain methods to add type / value checking and delegating all the
non-destrutive methods to the internal @list.
Most everything that ends up being serialized to the excel file is derived
from SimpleTypedList (for example, a Row is a SimpleTypedList of Cells). This
means that many of the delegated methods are hit over and over again especially
`[]`. This extra delegation really adds up.
We can avoid the delegation by having SimpleTypedList extend Array and still
remove any un-safe methods.
It is possible to re-introduce an unsafe method in a subclass of SimpleTypedList
if needed. Here is one way,
```ruby
class MyList < SimpleTypedList
def clear
@clear_method ||= Array.instance_method(:clear).bind(self)
@clear_method.call
end
end
```
|
|
|
|
|
|
|
|
|
|
- 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)
|
|
|
|
add test cases
|
|
```
rubocop --only Layout/LeadingCommentSpace -a
```
|
|
|
|
- Layout/SpaceAfterComma
- Layout/SpaceAroundEqualsInParameterDefault
- Layout/SpaceAroundOperators
- Layout/SpaceBeforeBlockBraces
- Layout/SpaceInsideBlockBraces
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideParens
|
|
```
rubocop --only Layout/EmptyLineBetweenDefs -a
```
|
|
```
rubocop --only Layout/TrailingWhitespace -a
```
|
|
Add tests
|
|
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.
|
|
fix Fixnum deprecated warning on Ruby2.4-preview3.
Fixnum was unify into Integer.
https://bugs.ruby-lang.org/issues/12005
|
|
|
|
|
|
Do not create huge strings
Let Row inherit from SimpleTypedList
Optimized sanitizing
Optimized validation
And more..
|
|
|
|
The validator will try to cast whatever it is fed to_i. Unfortunately
in 1.8.7 Symbol supports to_i.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and misnamed app attributes.
|
|
|
|
requires
|
|
|