bin/test in legionio-0.1.1 vs bin/test in legionio-0.2.0

- old
+ new

@@ -1,5 +1,32 @@ #!/usr/bin/env ruby # frozen_string_literal: true # rubocop:disable all +require 'cli-tree' +# require File.expand_path('lib/legion.rb') +# Legion.setup +require 'legion/json' +require 'legion/logging' +require 'legion/settings' +require 'legion/data' +Legion::Logging.setup(level: 'debug') +Legion::Settings.load +Legion::Settings.merge_settings('data', Legion::Data::Settings.default) +Legion::Data.setup +extensions = {name: 'extensions', children: []} +Legion::Data::Model::Extension.each do | extension| + runners = [] + extension.runners.each do |runner| + functions = [] + runner.functions.each do |function| + functions.push function.values[:name] + end + # runners.push runner.values[:name] + runners.push({name: runner.values[:name], children: functions}) + end + child = {name: extension.values[:name], children: runners} + # extensions[:children].push extension.values[:name] + extensions[:children].push child +end -require File.expand_path('lib/legion.rb') +tree = TreeNode.from_h(extensions) +tree.print \ No newline at end of file