Sha256: f832f7c6fc38a8dd9bbd194bfa9a9400520fc79335d9cdc87a6c75a234651864
Contents?: true
Size: 650 Bytes
Versions: 12
Compression:
Stored size: 650 Bytes
Contents
# frozen_string_literal: true class CmdletDao attr_reader :k_builder def initialize(k_builder) @k_builder = k_builder end def all_cmdlets data_access .category .categories.flat_map { |category| read_cmdlets(category[:name]) } .compact .uniq .sort_by { |r| [r[:category], r[:name]] } end private def read_cmdlets(category_name) file_name = k_builder.target_folders.join(:builder_data, 'cmdlets', "#{category_name}.json") return JSON.parse(File.read(file_name), symbolize_names: true)[:cmdlets] if File.exist?(file_name) puts "Cmdlet file #{file_name} not found" nil end end
Version data entries
12 entries across 12 versions & 1 rubygems