diff --git a/.rubocop.yml b/.rubocop.yml index 4ae261e8a..d219daf7b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,5 +2,10 @@ AllCops: TargetRubyVersion: 2.7.3 SuggestExtensions: rubocop-rake: false +Metrics/BlockLength: + Exclude: + - kiba-extend.gemspec + - spec/kiba/extend_spec.rb + - spec/kiba/extend/**/* Naming/MethodParameterName: AllowedNames: i, v diff --git a/Gemfile.lock b/Gemfile.lock index 544f9a48a..553936527 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - kiba-extend (1.15.2) + kiba-extend (1.15.3) activesupport kiba (>= 4.0.0) kiba-common (>= 1.5.0) diff --git a/docs/Kiba.html b/docs/Kiba.html index 7d0000422..8e4e02da2 100644 --- a/docs/Kiba.html +++ b/docs/Kiba.html @@ -79,7 +79,7 @@
Defined in:
lib/kiba/extend.rb,
- lib/kiba/extend/version.rb,
lib/kiba/extend/fieldset.rb,
lib/kiba/extend/utils/lookup.rb,
lib/kiba/extend/transforms/copy.rb,
lib/kiba/extend/destinations/csv.rb,
lib/kiba/extend/transforms/clean.rb,
lib/kiba/extend/transforms/merge.rb,
lib/kiba/extend/transforms/split.rb,
lib/kiba/extend/transforms/append.rb,
lib/kiba/extend/transforms/cspace.rb,
lib/kiba/extend/transforms/delete.rb,
lib/kiba/extend/transforms/rename.rb,
lib/kiba/extend/transforms/explode.rb,
lib/kiba/extend/transforms/prepend.rb,
lib/kiba/extend/transforms/replace.rb,
lib/kiba/extend/transforms/reshape.rb,
lib/kiba/extend/transforms/ms_access.rb,
lib/kiba/extend/transforms/deduplicate.rb,
lib/kiba/extend/transforms/filter_rows.rb,
lib/kiba/extend/transforms/combine_values.rb
+ lib/kiba/extend/version.rb,
lib/kiba/extend/fieldset.rb,
lib/kiba/extend/utils/lookup.rb,
lib/kiba/extend/transforms/copy.rb,
lib/kiba/extend/destinations/csv.rb,
lib/kiba/extend/transforms/clean.rb,
lib/kiba/extend/transforms/merge.rb,
lib/kiba/extend/transforms/split.rb,
lib/kiba/extend/transforms/append.rb,
lib/kiba/extend/transforms/cspace.rb,
lib/kiba/extend/transforms/delete.rb,
lib/kiba/extend/transforms/rename.rb,
lib/kiba/extend/transforms/explode.rb,
lib/kiba/extend/transforms/helpers.rb,
lib/kiba/extend/transforms/prepend.rb,
lib/kiba/extend/transforms/replace.rb,
lib/kiba/extend/transforms/reshape.rb,
lib/kiba/extend/transforms/ms_access.rb,
lib/kiba/extend/transforms/deduplicate.rb,
lib/kiba/extend/transforms/filter_rows.rb,
lib/kiba/extend/transforms/combine_values.rb
@@ -123,7 +123,7 @@

Overview

diff --git a/docs/Kiba/Extend.html b/docs/Kiba/Extend.html index 9e5a41892..d2cdf5681 100644 --- a/docs/Kiba/Extend.html +++ b/docs/Kiba/Extend.html @@ -79,7 +79,7 @@
Defined in:
lib/kiba/extend.rb,
- lib/kiba/extend/version.rb,
lib/kiba/extend/fieldset.rb,
lib/kiba/extend/utils/lookup.rb,
lib/kiba/extend/transforms/copy.rb,
lib/kiba/extend/destinations/csv.rb,
lib/kiba/extend/transforms/clean.rb,
lib/kiba/extend/transforms/merge.rb,
lib/kiba/extend/transforms/split.rb,
lib/kiba/extend/transforms/append.rb,
lib/kiba/extend/transforms/cspace.rb,
lib/kiba/extend/transforms/delete.rb,
lib/kiba/extend/transforms/rename.rb,
lib/kiba/extend/transforms/explode.rb,
lib/kiba/extend/transforms/prepend.rb,
lib/kiba/extend/transforms/replace.rb,
lib/kiba/extend/transforms/reshape.rb,
lib/kiba/extend/transforms/ms_access.rb,
lib/kiba/extend/transforms/deduplicate.rb,
lib/kiba/extend/transforms/filter_rows.rb,
lib/kiba/extend/transforms/combine_values.rb
+ lib/kiba/extend/version.rb,
lib/kiba/extend/fieldset.rb,
lib/kiba/extend/utils/lookup.rb,
lib/kiba/extend/transforms/copy.rb,
lib/kiba/extend/destinations/csv.rb,
lib/kiba/extend/transforms/clean.rb,
lib/kiba/extend/transforms/merge.rb,
lib/kiba/extend/transforms/split.rb,
lib/kiba/extend/transforms/append.rb,
lib/kiba/extend/transforms/cspace.rb,
lib/kiba/extend/transforms/delete.rb,
lib/kiba/extend/transforms/rename.rb,
lib/kiba/extend/transforms/explode.rb,
lib/kiba/extend/transforms/helpers.rb,
lib/kiba/extend/transforms/prepend.rb,
lib/kiba/extend/transforms/replace.rb,
lib/kiba/extend/transforms/reshape.rb,
lib/kiba/extend/transforms/ms_access.rb,
lib/kiba/extend/transforms/deduplicate.rb,
lib/kiba/extend/transforms/filter_rows.rb,
lib/kiba/extend/transforms/combine_values.rb
@@ -136,7 +136,7 @@

diff --git a/docs/Kiba/Extend/Destinations.html b/docs/Kiba/Extend/Destinations.html index 315853f48..9726aa533 100644 --- a/docs/Kiba/Extend/Destinations.html +++ b/docs/Kiba/Extend/Destinations.html @@ -105,7 +105,7 @@

Defined Under Namespace

diff --git a/docs/Kiba/Extend/Destinations/CSV.html b/docs/Kiba/Extend/Destinations/CSV.html index debd63659..5b5a72ed9 100644 --- a/docs/Kiba/Extend/Destinations/CSV.html +++ b/docs/Kiba/Extend/Destinations/CSV.html @@ -615,7 +615,7 @@

diff --git a/docs/Kiba/Extend/Fieldset.html b/docs/Kiba/Extend/Fieldset.html index 6690352ca..26a108778 100644 --- a/docs/Kiba/Extend/Fieldset.html +++ b/docs/Kiba/Extend/Fieldset.html @@ -551,7 +551,7 @@

diff --git a/docs/Kiba/Extend/Transforms.html b/docs/Kiba/Extend/Transforms.html index 4dc862867..2eedd43f1 100644 --- a/docs/Kiba/Extend/Transforms.html +++ b/docs/Kiba/Extend/Transforms.html @@ -79,7 +79,7 @@
Defined in:
lib/kiba/extend/transforms/copy.rb,
- lib/kiba/extend/transforms/clean.rb,
lib/kiba/extend/transforms/merge.rb,
lib/kiba/extend/transforms/split.rb,
lib/kiba/extend/transforms/append.rb,
lib/kiba/extend/transforms/cspace.rb,
lib/kiba/extend/transforms/delete.rb,
lib/kiba/extend/transforms/rename.rb,
lib/kiba/extend/transforms/explode.rb,
lib/kiba/extend/transforms/prepend.rb,
lib/kiba/extend/transforms/replace.rb,
lib/kiba/extend/transforms/reshape.rb,
lib/kiba/extend/transforms/ms_access.rb,
lib/kiba/extend/transforms/deduplicate.rb,
lib/kiba/extend/transforms/filter_rows.rb,
lib/kiba/extend/transforms/combine_values.rb
+ lib/kiba/extend/transforms/clean.rb,
lib/kiba/extend/transforms/merge.rb,
lib/kiba/extend/transforms/split.rb,
lib/kiba/extend/transforms/append.rb,
lib/kiba/extend/transforms/cspace.rb,
lib/kiba/extend/transforms/delete.rb,
lib/kiba/extend/transforms/rename.rb,
lib/kiba/extend/transforms/explode.rb,
lib/kiba/extend/transforms/helpers.rb,
lib/kiba/extend/transforms/prepend.rb,
lib/kiba/extend/transforms/replace.rb,
lib/kiba/extend/transforms/reshape.rb,
lib/kiba/extend/transforms/ms_access.rb,
lib/kiba/extend/transforms/deduplicate.rb,
lib/kiba/extend/transforms/filter_rows.rb,
lib/kiba/extend/transforms/combine_values.rb
@@ -89,7 +89,7 @@

Defined Under Namespace

- Modules: Append, Clean, CombineValues, Copy, Cspace, Deduplicate, Delete, Explode, FilterRows, Merge, MsAccess, Prepend, Rename, Replace, Reshape, Split + Modules: Append, Clean, CombineValues, Copy, Cspace, Deduplicate, Delete, Explode, FilterRows, Helpers, Merge, MsAccess, Prepend, Rename, Replace, Reshape, Split @@ -107,7 +107,7 @@

Defined Under Namespace

diff --git a/docs/Kiba/Extend/Transforms/Append.html b/docs/Kiba/Extend/Transforms/Append.html index 5f04f9bbb..c79d76169 100644 --- a/docs/Kiba/Extend/Transforms/Append.html +++ b/docs/Kiba/Extend/Transforms/Append.html @@ -116,7 +116,7 @@

Overview

diff --git a/docs/Kiba/Extend/Transforms/Append/NilFields.html b/docs/Kiba/Extend/Transforms/Append/NilFields.html index 5a2a3ae5a..686c962fd 100644 --- a/docs/Kiba/Extend/Transforms/Append/NilFields.html +++ b/docs/Kiba/Extend/Transforms/Append/NilFields.html @@ -193,7 +193,7 @@

diff --git a/docs/Kiba/Extend/Transforms/Append/ToFieldValue.html b/docs/Kiba/Extend/Transforms/Append/ToFieldValue.html index 97b159564..df63ad8a2 100644 --- a/docs/Kiba/Extend/Transforms/Append/ToFieldValue.html +++ b/docs/Kiba/Extend/Transforms/Append/ToFieldValue.html @@ -195,7 +195,7 @@

diff --git a/docs/Kiba/Extend/Transforms/Clean.html b/docs/Kiba/Extend/Transforms/Clean.html index c10a76ad2..46520ff45 100644 --- a/docs/Kiba/Extend/Transforms/Clean.html +++ b/docs/Kiba/Extend/Transforms/Clean.html @@ -83,12 +83,21 @@ -

Defined Under Namespace

+

Overview

+
+ +

Transformations to clean up data

+ + +
+
+
+ + +

Defined Under Namespace

- Modules: Helpers - Classes: AlphabetizeFieldValues, ClearFields, DelimiterOnlyFields, DowncaseFieldValues, EmptyFieldGroups, RegexpFindReplaceFieldVals, StripFields @@ -107,7 +116,7 @@

Defined Under Namespace

diff --git a/docs/Kiba/Extend/Transforms/Clean/AlphabetizeFieldValues.html b/docs/Kiba/Extend/Transforms/Clean/AlphabetizeFieldValues.html index 419535357..a8b92b000 100644 --- a/docs/Kiba/Extend/Transforms/Clean/AlphabetizeFieldValues.html +++ b/docs/Kiba/Extend/Transforms/Clean/AlphabetizeFieldValues.html @@ -89,7 +89,7 @@
Includes:
-
Helpers
+
Helpers
@@ -104,7 +104,26 @@ +

Overview

+
+ +
+ Note: +
+

This transformation does NOT sort the ROWS in a dataset. It sorts values within individual fields of a row

+
+
+ + +

Sorts the multiple values within a field alphabetically

+ +
+
+
+ + +
@@ -122,7 +141,7 @@

  • - #initialize(fields:, delim:) ⇒ AlphabetizeFieldValues + #initialize(fields:, delim:, usenull: false, direction: :asc) ⇒ AlphabetizeFieldValues @@ -157,15 +176,15 @@

    -

    Methods included from Helpers

    -

    #delim_only?

    +

    Methods included from Helpers

    +

    #delim_only?, #field_values

    Constructor Details

    - #initialize(fields:, delim:) ⇒ AlphabetizeFieldValues + #initialize(fields:, delim:, usenull: false, direction: :asc) ⇒ AlphabetizeFieldValues @@ -191,14 +210,18 @@

    19 20 21 -22 +22 +23 +24
    # File 'lib/kiba/extend/transforms/clean.rb', line 19
     
    -def initialize(fields:, delim:)
    +def initialize(fields:, delim:, usenull: false, direction: :asc)
       @fields = fields
       @delim = delim
    +  @usenull = usenull
    +  @direction = direction
     end
    @@ -211,7 +234,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Clean/ClearFields.html b/docs/Kiba/Extend/Transforms/Clean/ClearFields.html index b27166702..8dbc9775d 100644 --- a/docs/Kiba/Extend/Transforms/Clean/ClearFields.html +++ b/docs/Kiba/Extend/Transforms/Clean/ClearFields.html @@ -172,13 +172,13 @@

     
     
    -41
    -42
    -43
    -44
    +50 +51 +52 +53 -
    # File 'lib/kiba/extend/transforms/clean.rb', line 41
    +      
    # File 'lib/kiba/extend/transforms/clean.rb', line 50
     
     def initialize(fields:, if_equals: nil)
       @fields = fields
    @@ -195,7 +195,7 @@ 

    diff --git a/docs/Kiba/Extend/Transforms/Clean/DelimiterOnlyFields.html b/docs/Kiba/Extend/Transforms/Clean/DelimiterOnlyFields.html index eca13cded..c7feabd61 100644 --- a/docs/Kiba/Extend/Transforms/Clean/DelimiterOnlyFields.html +++ b/docs/Kiba/Extend/Transforms/Clean/DelimiterOnlyFields.html @@ -89,7 +89,7 @@
    Includes:
    -
    Helpers
    +
    Helpers
    @@ -157,8 +157,8 @@

    -

    Methods included from Helpers

    -

    #delim_only?

    +

    Methods included from Helpers

    +

    #delim_only?, #field_values

    Constructor Details

    @@ -188,13 +188,13 @@

     
     
    -61
    -62
    -63
    -64
    +70 +71 +72 +73 -
    # File 'lib/kiba/extend/transforms/clean.rb', line 61
    +      
    # File 'lib/kiba/extend/transforms/clean.rb', line 70
     
     def initialize(delim:, use_nullvalue: false)
       @delim = delim
    @@ -211,7 +211,7 @@ 

    diff --git a/docs/Kiba/Extend/Transforms/Clean/DowncaseFieldValues.html b/docs/Kiba/Extend/Transforms/Clean/DowncaseFieldValues.html index 3f580b987..386ed6644 100644 --- a/docs/Kiba/Extend/Transforms/Clean/DowncaseFieldValues.html +++ b/docs/Kiba/Extend/Transforms/Clean/DowncaseFieldValues.html @@ -172,12 +172,12 @@

     
     
    -76
    -77
    -78
    +85 +86 +87 -
    # File 'lib/kiba/extend/transforms/clean.rb', line 76
    +      
    # File 'lib/kiba/extend/transforms/clean.rb', line 85
     
     def initialize(fields:)
       @fields = fields
    @@ -193,7 +193,7 @@ 

    diff --git a/docs/Kiba/Extend/Transforms/Clean/EmptyFieldGroups.html b/docs/Kiba/Extend/Transforms/Clean/EmptyFieldGroups.html index 9dd79fadb..05fb7268d 100644 --- a/docs/Kiba/Extend/Transforms/Clean/EmptyFieldGroups.html +++ b/docs/Kiba/Extend/Transforms/Clean/EmptyFieldGroups.html @@ -172,14 +172,14 @@

     
     
    -97
    -98
    -99
    -100
    -101
    +106 +107 +108 +109 +110

    -
    # File 'lib/kiba/extend/transforms/clean.rb', line 97
    +      
    # File 'lib/kiba/extend/transforms/clean.rb', line 106
     
     def initialize(groups:, sep:, use_nullvalue: false)
       @groups = groups
    @@ -197,7 +197,7 @@ 

    diff --git a/docs/Kiba/Extend/Transforms/Clean/RegexpFindReplaceFieldVals.html b/docs/Kiba/Extend/Transforms/Clean/RegexpFindReplaceFieldVals.html index 82733a1ed..f2b013217 100644 --- a/docs/Kiba/Extend/Transforms/Clean/RegexpFindReplaceFieldVals.html +++ b/docs/Kiba/Extend/Transforms/Clean/RegexpFindReplaceFieldVals.html @@ -172,18 +172,18 @@

     
     
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    +170 +171 +172 +173 +174 +175 +176 +177 +178

    -
    # File 'lib/kiba/extend/transforms/clean.rb', line 161
    +      
    # File 'lib/kiba/extend/transforms/clean.rb', line 170
     
     def initialize(fields:, find:, replace:, casesensitive: true, multival: false, sep: nil, debug: false)
       @fields = fields
    @@ -205,7 +205,7 @@ 

    diff --git a/docs/Kiba/Extend/Transforms/Clean/StripFields.html b/docs/Kiba/Extend/Transforms/Clean/StripFields.html index dee3dcdfa..e0b817b55 100644 --- a/docs/Kiba/Extend/Transforms/Clean/StripFields.html +++ b/docs/Kiba/Extend/Transforms/Clean/StripFields.html @@ -172,12 +172,12 @@

     
     
    -203
    -204
    -205
    +212 +213 +214

    -
    # File 'lib/kiba/extend/transforms/clean.rb', line 203
    +      
    # File 'lib/kiba/extend/transforms/clean.rb', line 212
     
     def initialize(fields:)
       @fields = fields
    @@ -193,7 +193,7 @@ 

    diff --git a/docs/Kiba/Extend/Transforms/CombineValues.html b/docs/Kiba/Extend/Transforms/CombineValues.html index a994aab0f..6f6776eb4 100644 --- a/docs/Kiba/Extend/Transforms/CombineValues.html +++ b/docs/Kiba/Extend/Transforms/CombineValues.html @@ -105,7 +105,7 @@

    Defined Under Namespace

    diff --git a/docs/Kiba/Extend/Transforms/CombineValues/AcrossFieldGroup.html b/docs/Kiba/Extend/Transforms/CombineValues/AcrossFieldGroup.html index f7c58cfa7..568b79739 100644 --- a/docs/Kiba/Extend/Transforms/CombineValues/AcrossFieldGroup.html +++ b/docs/Kiba/Extend/Transforms/CombineValues/AcrossFieldGroup.html @@ -341,7 +341,7 @@

    More on fieldmap paramete diff --git a/docs/Kiba/Extend/Transforms/CombineValues/FromFieldsWithDelimiter.html b/docs/Kiba/Extend/Transforms/CombineValues/FromFieldsWithDelimiter.html index fda6c4d93..f3f547159 100644 --- a/docs/Kiba/Extend/Transforms/CombineValues/FromFieldsWithDelimiter.html +++ b/docs/Kiba/Extend/Transforms/CombineValues/FromFieldsWithDelimiter.html @@ -346,7 +346,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/CombineValues/FullRecord.html b/docs/Kiba/Extend/Transforms/CombineValues/FullRecord.html index b82b7979a..01f62b07e 100644 --- a/docs/Kiba/Extend/Transforms/CombineValues/FullRecord.html +++ b/docs/Kiba/Extend/Transforms/CombineValues/FullRecord.html @@ -269,7 +269,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Copy.html b/docs/Kiba/Extend/Transforms/Copy.html index 0f0d38f0a..9d15ac00e 100644 --- a/docs/Kiba/Extend/Transforms/Copy.html +++ b/docs/Kiba/Extend/Transforms/Copy.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Copy/Field.html b/docs/Kiba/Extend/Transforms/Copy/Field.html index cf8885892..057ec0b9b 100644 --- a/docs/Kiba/Extend/Transforms/Copy/Field.html +++ b/docs/Kiba/Extend/Transforms/Copy/Field.html @@ -250,7 +250,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Cspace.html b/docs/Kiba/Extend/Transforms/Cspace.html index 3cfeb88a1..dc0704d46 100644 --- a/docs/Kiba/Extend/Transforms/Cspace.html +++ b/docs/Kiba/Extend/Transforms/Cspace.html @@ -146,7 +146,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Cspace/ConvertToID.html b/docs/Kiba/Extend/Transforms/Cspace/ConvertToID.html index eaa86a102..5a700ec4b 100644 --- a/docs/Kiba/Extend/Transforms/Cspace/ConvertToID.html +++ b/docs/Kiba/Extend/Transforms/Cspace/ConvertToID.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Cspace/FlagInvalidCharacters.html b/docs/Kiba/Extend/Transforms/Cspace/FlagInvalidCharacters.html index 4d82af4bd..c65e44b94 100644 --- a/docs/Kiba/Extend/Transforms/Cspace/FlagInvalidCharacters.html +++ b/docs/Kiba/Extend/Transforms/Cspace/FlagInvalidCharacters.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Cspace/NormalizeForID.html b/docs/Kiba/Extend/Transforms/Cspace/NormalizeForID.html index f4829f8a1..174b9e1db 100644 --- a/docs/Kiba/Extend/Transforms/Cspace/NormalizeForID.html +++ b/docs/Kiba/Extend/Transforms/Cspace/NormalizeForID.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Deduplicate.html b/docs/Kiba/Extend/Transforms/Deduplicate.html index 5c58fdad0..79e271d2a 100644 --- a/docs/Kiba/Extend/Transforms/Deduplicate.html +++ b/docs/Kiba/Extend/Transforms/Deduplicate.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Deduplicate/FieldValues.html b/docs/Kiba/Extend/Transforms/Deduplicate/FieldValues.html index 94053a9c9..690b64f67 100644 --- a/docs/Kiba/Extend/Transforms/Deduplicate/FieldValues.html +++ b/docs/Kiba/Extend/Transforms/Deduplicate/FieldValues.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Deduplicate/Fields.html b/docs/Kiba/Extend/Transforms/Deduplicate/Fields.html index dc9bb2c7c..b3aa5fcc0 100644 --- a/docs/Kiba/Extend/Transforms/Deduplicate/Fields.html +++ b/docs/Kiba/Extend/Transforms/Deduplicate/Fields.html @@ -201,7 +201,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Deduplicate/Flag.html b/docs/Kiba/Extend/Transforms/Deduplicate/Flag.html index b14034072..6b3b2e69f 100644 --- a/docs/Kiba/Extend/Transforms/Deduplicate/Flag.html +++ b/docs/Kiba/Extend/Transforms/Deduplicate/Flag.html @@ -197,7 +197,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Deduplicate/GroupedFieldValues.html b/docs/Kiba/Extend/Transforms/Deduplicate/GroupedFieldValues.html index 1c1c2473e..fd871076c 100644 --- a/docs/Kiba/Extend/Transforms/Deduplicate/GroupedFieldValues.html +++ b/docs/Kiba/Extend/Transforms/Deduplicate/GroupedFieldValues.html @@ -197,7 +197,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Delete.html b/docs/Kiba/Extend/Transforms/Delete.html index 836102f96..8db24353b 100644 --- a/docs/Kiba/Extend/Transforms/Delete.html +++ b/docs/Kiba/Extend/Transforms/Delete.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Delete/EmptyFieldValues.html b/docs/Kiba/Extend/Transforms/Delete/EmptyFieldValues.html index 04415c64d..8d66f0170 100644 --- a/docs/Kiba/Extend/Transforms/Delete/EmptyFieldValues.html +++ b/docs/Kiba/Extend/Transforms/Delete/EmptyFieldValues.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Delete/FieldValueContainingString.html b/docs/Kiba/Extend/Transforms/Delete/FieldValueContainingString.html index bb5ff5f42..bb67c5c53 100644 --- a/docs/Kiba/Extend/Transforms/Delete/FieldValueContainingString.html +++ b/docs/Kiba/Extend/Transforms/Delete/FieldValueContainingString.html @@ -197,7 +197,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Delete/FieldValueIfEqualsOtherField.html b/docs/Kiba/Extend/Transforms/Delete/FieldValueIfEqualsOtherField.html index ead8ae1fe..d6a36c11d 100644 --- a/docs/Kiba/Extend/Transforms/Delete/FieldValueIfEqualsOtherField.html +++ b/docs/Kiba/Extend/Transforms/Delete/FieldValueIfEqualsOtherField.html @@ -203,7 +203,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Delete/FieldValueMatchingRegexp.html b/docs/Kiba/Extend/Transforms/Delete/FieldValueMatchingRegexp.html index 3fb78cff0..bcb41050b 100644 --- a/docs/Kiba/Extend/Transforms/Delete/FieldValueMatchingRegexp.html +++ b/docs/Kiba/Extend/Transforms/Delete/FieldValueMatchingRegexp.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Delete/Fields.html b/docs/Kiba/Extend/Transforms/Delete/Fields.html index ba8278537..675c67f91 100644 --- a/docs/Kiba/Extend/Transforms/Delete/Fields.html +++ b/docs/Kiba/Extend/Transforms/Delete/Fields.html @@ -193,7 +193,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Delete/FieldsExcept.html b/docs/Kiba/Extend/Transforms/Delete/FieldsExcept.html index 3ac773ff4..43b3b1359 100644 --- a/docs/Kiba/Extend/Transforms/Delete/FieldsExcept.html +++ b/docs/Kiba/Extend/Transforms/Delete/FieldsExcept.html @@ -193,7 +193,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Explode.html b/docs/Kiba/Extend/Transforms/Explode.html index da8e9cdbf..cf90c855f 100644 --- a/docs/Kiba/Extend/Transforms/Explode.html +++ b/docs/Kiba/Extend/Transforms/Explode.html @@ -118,7 +118,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Explode/ColumnsRemappedInNewRows.html b/docs/Kiba/Extend/Transforms/Explode/ColumnsRemappedInNewRows.html index 9ecd8d9a1..9f8a9ad4b 100644 --- a/docs/Kiba/Extend/Transforms/Explode/ColumnsRemappedInNewRows.html +++ b/docs/Kiba/Extend/Transforms/Explode/ColumnsRemappedInNewRows.html @@ -273,7 +273,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Explode/FieldValuesToNewRows.html b/docs/Kiba/Extend/Transforms/Explode/FieldValuesToNewRows.html index 057001cac..63f005a4a 100644 --- a/docs/Kiba/Extend/Transforms/Explode/FieldValuesToNewRows.html +++ b/docs/Kiba/Extend/Transforms/Explode/FieldValuesToNewRows.html @@ -315,7 +315,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Explode/RowsFromMultivalField.html b/docs/Kiba/Extend/Transforms/Explode/RowsFromMultivalField.html index 5ac46a334..326ace8a4 100644 --- a/docs/Kiba/Extend/Transforms/Explode/RowsFromMultivalField.html +++ b/docs/Kiba/Extend/Transforms/Explode/RowsFromMultivalField.html @@ -290,7 +290,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/FilterRows.html b/docs/Kiba/Extend/Transforms/FilterRows.html index a3a14e00f..553bbed01 100644 --- a/docs/Kiba/Extend/Transforms/FilterRows.html +++ b/docs/Kiba/Extend/Transforms/FilterRows.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/FilterRows/FieldEqualTo.html b/docs/Kiba/Extend/Transforms/FilterRows/FieldEqualTo.html index eee401953..e5f1059b4 100644 --- a/docs/Kiba/Extend/Transforms/FilterRows/FieldEqualTo.html +++ b/docs/Kiba/Extend/Transforms/FilterRows/FieldEqualTo.html @@ -197,7 +197,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/FilterRows/FieldMatchRegexp.html b/docs/Kiba/Extend/Transforms/FilterRows/FieldMatchRegexp.html index 704ec81f7..bffa4e699 100644 --- a/docs/Kiba/Extend/Transforms/FilterRows/FieldMatchRegexp.html +++ b/docs/Kiba/Extend/Transforms/FilterRows/FieldMatchRegexp.html @@ -208,7 +208,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/FilterRows/FieldPopulated.html b/docs/Kiba/Extend/Transforms/FilterRows/FieldPopulated.html index ecee100ed..4715ba404 100644 --- a/docs/Kiba/Extend/Transforms/FilterRows/FieldPopulated.html +++ b/docs/Kiba/Extend/Transforms/FilterRows/FieldPopulated.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/FilterRows/FieldValueGreaterThan.html b/docs/Kiba/Extend/Transforms/FilterRows/FieldValueGreaterThan.html index f8b101861..e4d718d8c 100644 --- a/docs/Kiba/Extend/Transforms/FilterRows/FieldValueGreaterThan.html +++ b/docs/Kiba/Extend/Transforms/FilterRows/FieldValueGreaterThan.html @@ -197,7 +197,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Helpers.html b/docs/Kiba/Extend/Transforms/Helpers.html new file mode 100644 index 000000000..b7a17990e --- /dev/null +++ b/docs/Kiba/Extend/Transforms/Helpers.html @@ -0,0 +1,487 @@ + + + + + + + Module: Kiba::Extend::Transforms::Helpers + + — Kiba-Extend Documentation + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Kiba::Extend::Transforms::Helpers + + + +

    +
    + + + + +
    +
    Extended by:
    +
    Helpers
    +
    + + + + + + +
    +
    Included in:
    +
    Clean::AlphabetizeFieldValues, Clean::DelimiterOnlyFields, Helpers
    +
    + + + +
    +
    Defined in:
    +
    lib/kiba/extend/transforms/helpers.rb
    +
    + +
    + +

    Overview

    +
    + +

    utility functions across Transforms

    + + +
    +
    +
    + + +
    + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Instance Method Details

    + + +
    +

    + + #delim_only?(val, delim, usenull = false) ⇒ false, true + + + + + +

    +
    + +

    Indicates whether a field value is delimiter-only. If usenull is set to true, the %NULLVALUE% string is treated as empty in detecting delimiter-only-ness

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + val + + + (String) + + + + — +
      +

      The field value to check

      +
      + +
    • + +
    • + + delim + + + (String) + + + + — +
      +

      The multivalue delimiter

      +
      + +
    • + +
    • + + usenull + + + (Boolean) + + + (defaults to: false) + + + — +
      +

      If true, replaces '%NULLVALUE%' with '' to make determination

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (false) + + + + — +
      +

      if value is nil, empty, or contains characters other than delimiter(s) and leading/trailing spaces

      +
      + +
    • + +
    • + + + (true) + + + + — +
      +

      if value contains only delimiter(s) and leading/trailing spaces

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +
    +
    # File 'lib/kiba/extend/transforms/helpers.rb', line 17
    +
    +def delim_only?(val, delim, usenull = false)
    +  return false if val.nil?
    +  return false if val.strip.empty?
    +  
    +  chk = val.gsub(delim, '').strip
    +  chk = chk.gsub('%NULLVALUE%', '').strip if usenull
    +  chk.empty?
    +end
    +
    +
    + +
    +

    + + #field_values(row:, fields:, discard: %i[nil empty delim], delim: DELIM, usenull: false) ⇒ Hash{Symbol=>String,Nil}l + + + + + +

    +
    + +

    Returns of field data for fields that meet keep criteria.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + row + + + (Hash{Symbol=>String,Nil}l) + + + + — +
      +

      A row of data

      +
      + +
    • + +
    • + + fields + + + (Array(Symbol)) + + + + — +
      +

      Names of fields to process

      +
      + +
    • + +
    • + + discard + + + (:nil, :empty, :delim) + + + (defaults to: %i[nil empty delim]) + + + — +
      +

      Types of field values to remove from returned hash

      +
      + +
    • + +
    • + + delim + + + (String) + + + (defaults to: DELIM) + + + — +
      +

      Multivalue delimiter used to split fields

      +
      + +
    • + +
    • + + usenull + + + (Boolean) + + + (defaults to: false) + + + — +
      +

      If true, replaces '%NULLVALUE%' with '' to make determination

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (Hash{Symbol=>String,Nil}l) + + + + — +
      +

      of field data for fields that meet keep criteria

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +
    +
    # File 'lib/kiba/extend/transforms/helpers.rb', line 32
    +
    +def field_values(row:, fields:, discard: %i[nil empty delim], delim: DELIM, usenull: false)
    +  field_vals = fields.map{ |field| [field, row.fetch(field, nil)] }.to_h
    +  return field_vals if discard.blank?
    +  
    +  field_vals = field_vals.reject{ |field, val| val.nil? } if discard.any?(:nil)
    +  keep = keep_fields(field_vals, discard, delim, usenull)
    +  field_vals.select{ |field, val| keep.any?(field) }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/Kiba/Extend/Transforms/Merge.html b/docs/Kiba/Extend/Transforms/Merge.html index ca8711da9..50b5e3fbd 100644 --- a/docs/Kiba/Extend/Transforms/Merge.html +++ b/docs/Kiba/Extend/Transforms/Merge.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Merge/CompareFieldsFlag.html b/docs/Kiba/Extend/Transforms/Merge/CompareFieldsFlag.html index c9c46b9f0..df341a59f 100644 --- a/docs/Kiba/Extend/Transforms/Merge/CompareFieldsFlag.html +++ b/docs/Kiba/Extend/Transforms/Merge/CompareFieldsFlag.html @@ -201,7 +201,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Merge/ConstantValue.html b/docs/Kiba/Extend/Transforms/Merge/ConstantValue.html index 77ee69d01..6fb9f14e5 100644 --- a/docs/Kiba/Extend/Transforms/Merge/ConstantValue.html +++ b/docs/Kiba/Extend/Transforms/Merge/ConstantValue.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Merge/ConstantValueConditional.html b/docs/Kiba/Extend/Transforms/Merge/ConstantValueConditional.html index ff07b0e00..677b4b3e1 100644 --- a/docs/Kiba/Extend/Transforms/Merge/ConstantValueConditional.html +++ b/docs/Kiba/Extend/Transforms/Merge/ConstantValueConditional.html @@ -208,7 +208,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Merge/CountOfMatchingRows.html b/docs/Kiba/Extend/Transforms/Merge/CountOfMatchingRows.html index 0a19ea90e..fc87ffdca 100644 --- a/docs/Kiba/Extend/Transforms/Merge/CountOfMatchingRows.html +++ b/docs/Kiba/Extend/Transforms/Merge/CountOfMatchingRows.html @@ -201,7 +201,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Merge/MultiRowLookup.html b/docs/Kiba/Extend/Transforms/Merge/MultiRowLookup.html index 4ef4ec959..099fb4139 100644 --- a/docs/Kiba/Extend/Transforms/Merge/MultiRowLookup.html +++ b/docs/Kiba/Extend/Transforms/Merge/MultiRowLookup.html @@ -218,7 +218,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Merge/MultivalueConstant.html b/docs/Kiba/Extend/Transforms/Merge/MultivalueConstant.html index 87f609963..3a8142249 100644 --- a/docs/Kiba/Extend/Transforms/Merge/MultivalueConstant.html +++ b/docs/Kiba/Extend/Transforms/Merge/MultivalueConstant.html @@ -201,7 +201,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/MsAccess.html b/docs/Kiba/Extend/Transforms/MsAccess.html index 5d34a8286..9c42c7ba8 100644 --- a/docs/Kiba/Extend/Transforms/MsAccess.html +++ b/docs/Kiba/Extend/Transforms/MsAccess.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/MsAccess/ScientificNotationToNumberString.html b/docs/Kiba/Extend/Transforms/MsAccess/ScientificNotationToNumberString.html index afd7ff29a..94943f4d2 100644 --- a/docs/Kiba/Extend/Transforms/MsAccess/ScientificNotationToNumberString.html +++ b/docs/Kiba/Extend/Transforms/MsAccess/ScientificNotationToNumberString.html @@ -193,7 +193,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Prepend.html b/docs/Kiba/Extend/Transforms/Prepend.html index 58f2fbc85..5dd63c1d9 100644 --- a/docs/Kiba/Extend/Transforms/Prepend.html +++ b/docs/Kiba/Extend/Transforms/Prepend.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Prepend/FieldToFieldValue.html b/docs/Kiba/Extend/Transforms/Prepend/FieldToFieldValue.html index 34e3cf9b3..f4f137bf4 100644 --- a/docs/Kiba/Extend/Transforms/Prepend/FieldToFieldValue.html +++ b/docs/Kiba/Extend/Transforms/Prepend/FieldToFieldValue.html @@ -432,7 +432,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Prepend/FieldToFieldValue/MissingDelimiterError.html b/docs/Kiba/Extend/Transforms/Prepend/FieldToFieldValue/MissingDelimiterError.html index 505092f60..47bbda403 100644 --- a/docs/Kiba/Extend/Transforms/Prepend/FieldToFieldValue/MissingDelimiterError.html +++ b/docs/Kiba/Extend/Transforms/Prepend/FieldToFieldValue/MissingDelimiterError.html @@ -223,7 +223,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Prepend/ToFieldValue.html b/docs/Kiba/Extend/Transforms/Prepend/ToFieldValue.html index f833de2d7..42f1f02dc 100644 --- a/docs/Kiba/Extend/Transforms/Prepend/ToFieldValue.html +++ b/docs/Kiba/Extend/Transforms/Prepend/ToFieldValue.html @@ -280,7 +280,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Rename.html b/docs/Kiba/Extend/Transforms/Rename.html index 58da1212d..410df24c8 100644 --- a/docs/Kiba/Extend/Transforms/Rename.html +++ b/docs/Kiba/Extend/Transforms/Rename.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Rename/Field.html b/docs/Kiba/Extend/Transforms/Rename/Field.html index 944713b35..0670e781b 100644 --- a/docs/Kiba/Extend/Transforms/Rename/Field.html +++ b/docs/Kiba/Extend/Transforms/Rename/Field.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Replace.html b/docs/Kiba/Extend/Transforms/Replace.html index 63fc3b545..5de7e2d6c 100644 --- a/docs/Kiba/Extend/Transforms/Replace.html +++ b/docs/Kiba/Extend/Transforms/Replace.html @@ -118,7 +118,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Replace/EmptyFieldValues.html b/docs/Kiba/Extend/Transforms/Replace/EmptyFieldValues.html index 181500079..2adee1bad 100644 --- a/docs/Kiba/Extend/Transforms/Replace/EmptyFieldValues.html +++ b/docs/Kiba/Extend/Transforms/Replace/EmptyFieldValues.html @@ -195,7 +195,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Replace/FieldValueWithStaticMapping.html b/docs/Kiba/Extend/Transforms/Replace/FieldValueWithStaticMapping.html index 7ef37ce9b..e4ced09de 100644 --- a/docs/Kiba/Extend/Transforms/Replace/FieldValueWithStaticMapping.html +++ b/docs/Kiba/Extend/Transforms/Replace/FieldValueWithStaticMapping.html @@ -209,7 +209,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Reshape.html b/docs/Kiba/Extend/Transforms/Reshape.html index 8f21b12d1..86aca2ba0 100644 --- a/docs/Kiba/Extend/Transforms/Reshape.html +++ b/docs/Kiba/Extend/Transforms/Reshape.html @@ -118,7 +118,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Reshape/CollapseMultipleFieldsToOneTypedFieldPair.html b/docs/Kiba/Extend/Transforms/Reshape/CollapseMultipleFieldsToOneTypedFieldPair.html index e7f7629d3..113a41605 100644 --- a/docs/Kiba/Extend/Transforms/Reshape/CollapseMultipleFieldsToOneTypedFieldPair.html +++ b/docs/Kiba/Extend/Transforms/Reshape/CollapseMultipleFieldsToOneTypedFieldPair.html @@ -377,7 +377,7 @@

    diff --git a/docs/Kiba/Extend/Transforms/Split.html b/docs/Kiba/Extend/Transforms/Split.html index cb8de6a94..e2da4eee6 100644 --- a/docs/Kiba/Extend/Transforms/Split.html +++ b/docs/Kiba/Extend/Transforms/Split.html @@ -116,7 +116,7 @@

    Overview

    diff --git a/docs/Kiba/Extend/Transforms/Split/IntoMultipleColumns.html b/docs/Kiba/Extend/Transforms/Split/IntoMultipleColumns.html index 926918a64..4099b4da8 100644 --- a/docs/Kiba/Extend/Transforms/Split/IntoMultipleColumns.html +++ b/docs/Kiba/Extend/Transforms/Split/IntoMultipleColumns.html @@ -378,7 +378,7 @@

    diff --git a/docs/Kiba/Extend/Utils.html b/docs/Kiba/Extend/Utils.html index 5d710aa73..b95b3a24e 100644 --- a/docs/Kiba/Extend/Utils.html +++ b/docs/Kiba/Extend/Utils.html @@ -105,7 +105,7 @@

    Defined Under Namespace

    diff --git a/docs/Kiba/Extend/Utils/Lookup.html b/docs/Kiba/Extend/Utils/Lookup.html index 26d1f25db..bcb425316 100644 --- a/docs/Kiba/Extend/Utils/Lookup.html +++ b/docs/Kiba/Extend/Utils/Lookup.html @@ -270,7 +270,7 @@

    diff --git a/docs/Kiba/Extend/Utils/Lookup/CriteriaChecker.html b/docs/Kiba/Extend/Utils/Lookup/CriteriaChecker.html index 60e7f664c..0919a4a1d 100644 --- a/docs/Kiba/Extend/Utils/Lookup/CriteriaChecker.html +++ b/docs/Kiba/Extend/Utils/Lookup/CriteriaChecker.html @@ -391,7 +391,7 @@

    diff --git a/docs/Kiba/Extend/Utils/Lookup/FieldEmptiness.html b/docs/Kiba/Extend/Utils/Lookup/FieldEmptiness.html index 2f15960ae..c8d716b86 100644 --- a/docs/Kiba/Extend/Utils/Lookup/FieldEmptiness.html +++ b/docs/Kiba/Extend/Utils/Lookup/FieldEmptiness.html @@ -285,7 +285,7 @@

    diff --git a/docs/Kiba/Extend/Utils/Lookup/MultivalPairs.html b/docs/Kiba/Extend/Utils/Lookup/MultivalPairs.html index 32a1f79d4..76bf4f2df 100644 --- a/docs/Kiba/Extend/Utils/Lookup/MultivalPairs.html +++ b/docs/Kiba/Extend/Utils/Lookup/MultivalPairs.html @@ -321,7 +321,7 @@

    diff --git a/docs/Kiba/Extend/Utils/Lookup/PairEquality.html b/docs/Kiba/Extend/Utils/Lookup/PairEquality.html index a6eb072dd..22605ae45 100644 --- a/docs/Kiba/Extend/Utils/Lookup/PairEquality.html +++ b/docs/Kiba/Extend/Utils/Lookup/PairEquality.html @@ -335,7 +335,7 @@

    diff --git a/docs/Kiba/Extend/Utils/Lookup/PairInclusion.html b/docs/Kiba/Extend/Utils/Lookup/PairInclusion.html index 65d680a03..937b017b9 100644 --- a/docs/Kiba/Extend/Utils/Lookup/PairInclusion.html +++ b/docs/Kiba/Extend/Utils/Lookup/PairInclusion.html @@ -333,7 +333,7 @@

    diff --git a/docs/Kiba/Extend/Utils/Lookup/RowSelector.html b/docs/Kiba/Extend/Utils/Lookup/RowSelector.html index ac2876036..67e1cedfd 100644 --- a/docs/Kiba/Extend/Utils/Lookup/RowSelector.html +++ b/docs/Kiba/Extend/Utils/Lookup/RowSelector.html @@ -274,7 +274,7 @@

    diff --git a/docs/Kiba/Extend/Utils/Lookup/SetChecker.html b/docs/Kiba/Extend/Utils/Lookup/SetChecker.html index 138135601..23888fb94 100644 --- a/docs/Kiba/Extend/Utils/Lookup/SetChecker.html +++ b/docs/Kiba/Extend/Utils/Lookup/SetChecker.html @@ -441,7 +441,7 @@

    diff --git a/docs/_index.html b/docs/_index.html index 4902cbd52..d24c174cd 100644 --- a/docs/_index.html +++ b/docs/_index.html @@ -403,16 +403,16 @@

    Namespace Listing A-Z

  • - Fields + Fields - (Kiba::Extend::Transforms::Delete) + (Kiba::Extend::Transforms::Deduplicate)
  • - Fields + Fields - (Kiba::Extend::Transforms::Deduplicate) + (Kiba::Extend::Transforms::Delete)
  • @@ -489,9 +489,9 @@

    Namespace Listing A-Z