Skip to content

Commit

Permalink
BUGFIX: :warn_unnested private method call from project using kiba-ex…
Browse files Browse the repository at this point in the history
…tend (#109)

* BUGFIX: make Kiba::Extend.warn_unnested a public method
  • Loading branch information
kspurgin authored Sep 23, 2022
1 parent 4a42e3f commit df9ad34
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ These changes are merged into the `main` branch, but have not been released. Aft

== Releases

=== 3.2.2 - 2022-09-23

==== Added
* `Fraction::ToDecimal` transform (and supporting `Utils::ExtractFractions` and `Data::ConvertibleFraction` classes) (PR#108)
* `yardspec` gem to support running YARD examples as RSpec tests (PR#107)
* Branch coverage to `simplecov` setup (PR#107)

==== Changed
* Tests for the `Prepend::ToFieldValue` transform converted to use `yardspec` (PR#107)

==== Bugfixes
* No longer falls over when a project has nested job config settings (scope changes when used in a project, and the private :warn_unnested method couldn't be called)

=== 3.2.1 - 2022-09-21

==== Added
Expand Down Expand Up @@ -277,4 +290,3 @@ These will now give warnings if used.

- `Delete::FieldsExcept` `keepfields` keyword parameter. Change to `fields` (in https://github.com/lyrasis/kiba-extend/pull/57[PR#57])
- `Delete::EmptyFieldValues` `sep` keyword parameter. Change to `delim` (in https://github.com/lyrasis/kiba-extend/pull/57[PR#57])

2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
kiba-extend (3.2.1)
kiba-extend (3.2.2)
activesupport (~> 6)
amazing_print (~> 1.4)
csv (~> 3)
Expand Down
23 changes: 11 additions & 12 deletions lib/kiba/extend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def reload!
# key 'foo': 'ns\__foo'. With parent namespace 'ns', child namespace 'child', and registered key 'foo':
# 'ns\__child\__foo'
setting :registry_namespace_separator, default: '__', reader: true

# @!method source
# Default source class for jobs. Must meet implementation criteria in [Kiba wiki](https://github.com/thbar/kiba/wiki/Implementing-ETL-sources)
setting :source, default: Kiba::Common::Sources::CSV, reader: true
Expand All @@ -123,26 +123,26 @@ def reload!
#
# If configured properly, the pre-job task is run when a job is run via Thor invocation. This includes
# `run:job`, `run:jobs`, and `jobs:tagged -r tagvalue`. The task is run once when the Thor task is
# invoked.
# invoked.

# @return [Boolean] whether to use Kiba::Extend's pre-job task functionality. The default is `false`
# for backward compatibility, as existing projects may not have the required settings configured.
setting :pre_job_task_run, default: false, reader: true

# @return [String] full path to directory to which files will be moved if `pre_job_task_action ==
# :backup`. The directory will be created if it does not exist.
setting :pre_job_task_backup_dir, default: nil, reader: true

# @return [Array<String>] full paths to directories that will be affected by the specified pre-task action
setting :pre_job_task_directories, default: [], reader: true

# @return [:backup, :nuke] Controls what happens when pre-job task is run
#
# - :backup - Moves all existing files in specified directories to backup directory created in your `:datadir`
# - :nuke - Deletes all existing files in specified directories when a job is run. **Make sure you only
# specify directories that contain derived/generated files!**
setting :pre_job_task_action, default: :backup, reader: true

# @return [:job, nil, anyValue]
#
#Controls whether pre-job task is run
Expand All @@ -159,15 +159,15 @@ def reload!

# @return [Boolean] whether to have computer audibly say something when job is complete
setting :job_tell_me, default: false, reader: true

# @return [:debug, :normal, :minimal] how much output about jobs to output to STDOUT
#
# - :debug - tells you A LOT - helpful when developing pipelines and debugging
# - :normal - reports what is running, from where, and the results
# - :minimal - bare minimum
setting :job_verbosity, default: :normal, reader: true


# The section below is for backward comapatibility only

# @since 3.2.1
Expand All @@ -178,7 +178,6 @@ def warn_unnested(name, value)
warn("#{Kiba::Extend.warning_label}: #{msg}")
value
end
private_class_method :warn_unnested

setting :job, reader: true do
setting :show_me, default: Kiba::Extend.job_show_me, reader: true,
Expand All @@ -189,7 +188,7 @@ def warn_unnested(name, value)
constructor: proc{ |name, value| Kiba::Extend.warn_unnested(name, value) }
end


# strips, collapses multiple spaces, removes terminal commas, strips again
# removes "NULL"/treats as nilValue
CSV::Converters[:stripplus] = lambda { |s|
Expand Down Expand Up @@ -241,7 +240,7 @@ def warn_unnested(name, value)
s
end
}

end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/kiba/extend/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Kiba
module Extend
VERSION = '3.2.1'
VERSION = '3.2.2'
end
end

0 comments on commit df9ad34

Please sign in to comment.