diff --git a/mrblib/rf/cli.rb b/mrblib/rf/cli.rb index ae5c8a2..d3a10a8 100644 --- a/mrblib/rf/cli.rb +++ b/mrblib/rf/cli.rb @@ -4,6 +4,7 @@ class Cli def run(argv) @config = Config.parse(argv) + Rf.add_features Runner.run({ command: config.command, filter:, diff --git a/mrblib/rf/features.rb b/mrblib/rf/features.rb index 423d42d..dc65297 100644 --- a/mrblib/rf/features.rb +++ b/mrblib/rf/features.rb @@ -14,6 +14,13 @@ class Float module Rf class << self + def add_features + add_features_to_integer + add_features_to_float + add_features_to_hash + add_features_to_json + end + def add_features_to_integer extend_op(Integer, :to_i) end diff --git a/mrblib/rf/runner.rb b/mrblib/rf/runner.rb index d3646b8..b6ea3d3 100644 --- a/mrblib/rf/runner.rb +++ b/mrblib/rf/runner.rb @@ -28,18 +28,10 @@ def setup_container end def run - add_features do_action post_action end - def add_features - Rf.add_features_to_integer - Rf.add_features_to_float - Rf.add_features_to_hash - Rf.add_features_to_json - end - def do_action filter.each_record do |record, index, fields| container.record = record