summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/util/validators.rb
AgeCommit message (Collapse)Author
2023-07-01Fix Lint/NonLocalExitFromIterator offenseGeremia Taglialatela
Uses `Array#any?` instead of `Array#each`. According to benchmarks, `any?` is slightly faster when validation fails (3%) and noticeably faster when validation passes (up to 60%)
2023-06-13Fix safe Style/Lambda offensesGeremia Taglialatela
- Use literal syntax on single line - Use lambda method on multiple lines Ref: https://rubystyle.guide/#lambda-multi-line
2023-06-05Prefer `Kernel#format` to `String#%`Geremia Taglialatela
This commit fixes cases that cannot be detected by RuboCop Ref: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FormatString
2023-06-05Fix Style/FormatString offensesGeremia Taglialatela
`Kernel#format` is faster and will avoid to allocate an array compared to `String#%`. ``` IPS: kernel_format: 3877614.2 i/s string_percent: 3531475.0 i/s - 1.10x (± 0.00) slower Memory: kernel_format: 160 allocated string_percent: 200 allocated - 1.25x more ```
2023-05-31Remove redundant parenthesesGeremia Taglialatela
- 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
2023-05-23Improve Regexp validatorGeremia Taglialatela
Replace `.match` with `.match?`
2023-05-20Remove minor safe offensesGeremia Taglialatela
- Style/RaiseArgs - Style/RedundantCondition - Style/RedundantReturn - Style/SelfAssignment - Style/SoleNestedConditional
2023-05-15Remove ability to set `u=` to true in favor of :singlePaul Kmiec
The `u=` would convert `true` to `:single` for backwards compatibility. However, it is more explicit to set it to `:single` or one of the other underline options instead of relying on the conversion.
2023-05-15Improve boolean validation constants (i.e. Axlsx::VALID_BOOLEAN_VALUES)Paul Kmiec
Added VALID_BOOLEAN_TRUE_VALUES and VALID_BOOLEAN_FALSE_VALUES so that those can be re-used in other placed and have the same notion of what a valid boolean value is. For example, we can use the true values in `Cell#u=`. Additionally, since validate_boolean / BOOLEAN_VALIDATOR are invoked so frequently, putting the likely values at the front can actually make a non-trivial difference. Since VALID_BOOLEAN_VALUES is derived from VALID_BOOLEAN_TRUE_VALUES and VALID_BOOLEAN_FALSE_VALUES, we use `Array#zip` to still end up with good order.
2023-05-10Move definition of valid values and validator lambdas out of the methods to ↵Koza
reduce memory consumption
2023-05-04Enable Style/FrozenStringLiteralComment and autocorrectPaul Kmiec
2023-04-09Fix offenses related to indentation consistencyGeremia Taglialatela
2023-04-08Fix Layout/EmptyLineAfterGuardClause offensesGeremia Taglialatela
``` rubocop --only Layout/EmptyLineAfterGuardClause -a ```
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-06Fix Layout/EmptyLines offensesGeremia Taglialatela
``` rubocop --only Layout/EmptyLines -a ```
2023-04-06Fix Style/Encoding offensesGeremia Taglialatela
``` rubocop --only Style/Encoding -a ```
2020-11-27Allow to set cell type to `date`Artem Kozaev
2019-10-29Remove a typo from commentvzvu3k6k
Fixnum is removed by 12d6433, but this typo was remained.
2017-04-01chore(doc): document some membersrandym
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
2014-07-29Allow custom marker symbol shapes on chartmfrank01
2014-02-26Huge refactoringJurriaan Pruis
Do not create huge strings Let Row inherit from SimpleTypedList Optimized sanitizing Optimized validation And more..
2013-09-29add validation for Worksheet#state and WorkbookView#visibilityRandy Morgan
2013-06-23provide a better default for dispBlanksAs and allow it to be configuredMoses Hohman
2013-01-10reduced processing of 3000 rows from 3+ seconds to just under 2Randy Morgan
2012-11-27Merge pull request #148 from alexrothenberg/pivot_tableRandy Morgan (@morgan_randy)
Create a simple Pivot Table
2012-11-27Create a simple Pivot TableAlex Rothenberg
* an example can be run with `ruby examples/pivot_table.rb` * right now you cannot set options on the pivot table to make it useful (coming soon...)
2012-11-25Updated readme and docs for pre 1.3.4 releaseRandy Morgan
2012-11-08fixed cell text run validation for u and familyRandy Morgan
2012-09-30patched range validatorRandy Morgan
2012-09-26pre-release readme updates and more work on auto_filter preset valuesRandy Morgan
2012-09-25more work on deep autofilter implementationRandy Morgan
Adding in Filters, Filter, DateGroupItem and FilterColumns. Still needs more specs/docs but we are almost there.
2012-07-141.1.8 release prepRandy 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-24BugfixJan-Hendrik Hühne
2012-05-22First try of the data validation feature.Jan-Hendrik Hühne
2012-05-13cleaning up comments for pre-releaseRandy Morgan
2012-05-08documentation for comments.Randy Morgan
2012-05-08worksheet comments step 2. Needs docs and specs - but it works in ExcelRandy Morgan
2012-05-04Merge branch 'master' of github.com:randym/axlsxRandy Morgan
2012-05-04add comment relationship typeRandy Morgan
2012-05-03Add support for pageSetup.Stefan Daschek
2012-05-03use string casting and matching for regex validations.Randy Morgan
2012-04-25label rotation and conditional formatting examplesRandy Morgan
2012-04-21adding in icon set and MOAR examples for conditional formatting.Randy Morgan
2012-04-21adding in color scale for conditional formattingRandy Morgan