summaryrefslogtreecommitdiffhomepage
path: root/test/util
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-25Fix StringConcatenation offenses (non-production)Geremia Taglialatela
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 ```
2023-05-23Enable Security copsGeremia Taglialatela
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
2023-05-10Fix `SimpleTypedList#to_a` and `SimpleTypedList#to_ary` returning the ↵Paul Kmiec
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.
2023-05-10Derive SimpleTypedList from ArrayPaul Kmiec
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 ```
2023-05-04Enable Style/FrozenStringLiteralComment and autocorrectPaul Kmiec
2023-05-03Fix Style/RedundantFileExtensionInRequire offenseGeremia Taglialatela
2023-05-03Fix boolean testGeremia 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-12Mock out external image requests to make the CI more stableKoza
2023-04-12improve validationSebastiano
add test cases
2023-04-10Fix Layout/LeadingCommentSpace offensesGeremia Taglialatela
``` rubocop --only Layout/LeadingCommentSpace -a ```
2023-04-09Fix offenses related to indentation consistencyGeremia Taglialatela
2023-04-08Fix space-related offensesGeremia Taglialatela
- Layout/SpaceAfterComma - Layout/SpaceAroundEqualsInParameterDefault - Layout/SpaceAroundOperators - Layout/SpaceBeforeBlockBraces - Layout/SpaceInsideBlockBraces - Layout/SpaceInsideHashLiteralBraces - Layout/SpaceInsideParens
2023-04-06Fix Layout/EmptyLineBetweenDefs offensesGeremia Taglialatela
``` rubocop --only Layout/EmptyLineBetweenDefs -a ```
2023-04-06Remove Layout/TrailingWhitespace offensesGeremia Taglialatela
``` rubocop --only Layout/TrailingWhitespace -a ```
2020-11-27Add casting to dateArtem Kozaev
Add tests
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.
2016-11-12fix warning: constant ::Fixnum is deprecatedtakkanm
fix Fixnum deprecated warning on Ruby2.4-preview3. Fixnum was unify into Integer. https://bugs.ruby-lang.org/issues/12005
2015-07-05Fix Axlsx::LineSeries#marker_symbol and add testsJonathan Tron
2015-07-03Extract mime type detection to an utility classmarc
2014-02-26Huge refactoringJurriaan Pruis
Do not create huge strings Let Row inherit from SimpleTypedList Optimized sanitizing Optimized validation And more..
2013-08-17add spec to ensure that serialized symbol values are cameled.Randy Morgan
2013-04-23Altered integerish test to use a ClassRandy Morgan
The validator will try to cast whatever it is fed to_i. Unfortunately in 1.8.7 Symbol supports to_i.
2013-04-19Added prep for 1.3.6 releaseRandy Morgan
2012-11-08fixed cell text run validation for u and familyRandy Morgan
2012-09-30Added validation spec for Range validatorRandy Morgan
2012-06-06Validator renameJan-Hendrik Hühne
2012-06-06New validators and tests.Jan-Hendrik Hühne
2012-06-06Missing validator tests.Jan-Hendrik Hühne
2012-06-06Validator renameing.Jan-Hendrik Hühne
2012-05-17fix ALL the warnings!Randy Morgan
2012-05-15bring coverage up to 100% and patch a few minor bugs in cell style overrides ↵Randy Morgan
and misnamed app attributes.
2012-05-03Add support for pageSetup.Stefan Daschek
2012-03-23move requires out of specs and into helper that prepends lib directory for ↵Randy Morgan
requires
2011-11-20first commitRandy Morgan