Module: Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeDiff
- Includes:
- TreeToList
- Included in:
- Command::DSL
- Defined in:
- lib/eco/api/usecases/graphql/samples/location/service/tree_diff.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/heading.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/inputable.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/helpers.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
Overview
Service to spot the differences between an input file and a locations tree. def process compare end
private
def custom_input_csv_transform(csv) csv.add_column('archived') end
def custom_input_row_transform(row) row['archived'] = !as_boolean(row['active']) end end
Defined Under Namespace
Modules: Convertible
Constant Summary
Constants included from Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList::Converter::Discarded
Constants included from Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList::Converter::NodeAttrMaps
Constants included from Helpers::Location::Base::TreeTracking
Helpers::Location::Base::TreeTracking::TAGTREE_BACKUP
Constants included from Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList::Output
Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList::Output::OUT_FILENAME, Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList::Output::OUT_FOLDER, Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList::Output::OUT_HEADER, Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList::Output::OUT_TIME_FORMAT
Instance Attribute Summary
Attributes included from Lib::ErrorHandling
Attributes included from Language::AuxiliarLogger
Attributes included from Helpers::Location::Base::TreeTracking
Instance Method Summary collapse
- #compare ⇒ Object
- #comparer(source_1 = live_nodes_list, source_2 = file_nodes_list) ⇒ Object
- #process ⇒ Object
Methods included from Helpers::Location::Base
#live_tree, #session_live_tree, #tagtree_id, #target_structure_id, #target_structure_id_const
Methods included from Language::AuxiliarLogger
Methods included from Helpers::Location::Base::TreeTracking
#backup_tree, #track_current_tree, #track_current_tree?
Instance Method Details
#compare ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/eco/api/usecases/graphql/samples/location/service/tree_diff.rb', line 62 def compare comparer.tap do |cmp| puts comparer.diffs_details if print_diff_details? && cmp.diffs? log(:info) { cmp.diffs_summary } sleep(5) end end |
#comparer(source_1 = live_nodes_list, source_2 = file_nodes_list) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/eco/api/usecases/graphql/samples/location/service/tree_diff.rb', line 70 def comparer( source_1 = live_nodes_list, source_2 = file_nodes_list ) @comparer ||= nodes_diff_class.new( source_1, source_2, original_tree: input_tagtree, logger: logger ).tap do log(:info) { "Comparing #{source_1.count} nodes with #{source_2.count} file nodes." } end end |
#process ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/eco/api/usecases/graphql/samples/location/service/tree_diff.rb', line 54 def process with_error_handling do next unless compare_live_with_file? compare end end |