Sha256: 5eb3418053bd10b90eb6f3ac698349534e36d5de181b06e61966ebddfd327b3f

Contents?: true

Size: 974 Bytes

Versions: 4

Compression:

Stored size: 974 Bytes

Contents

#!/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

tree = TreeNode.from_h(extensions)
tree.print

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
legionio-0.3.2 bin/test
legionio-0.3.1 bin/test
legionio-0.3.0 bin/test
legionio-0.2.0 bin/test