Sha256: f48b77463d1721e71725dbd012cd30f5bef382b76399b2fd486d0cee5135b0c9
Contents?: true
Size: 896 Bytes
Versions: 8
Compression:
Stored size: 896 Bytes
Contents
# frozen_string_literal: true require "sod" module Pennyworth module CLI module Actions # Handles the Standard Gem action. class StandardGem < Sod::Action include Import[:io] ENDPOINTS = { "all" => "stdgems.json", "default" => "default_gems.json", "bundled" => "bundled_gems.json" }.freeze description "Render Alfred Standard Gems script filter." on "--standard_gems", argument: "[KIND]", allow: %w[all default bundled], default: "all" def initialize(processor: Processor.for_standard_gems, endpoints: ENDPOINTS, **) super(**) @processor = processor @endpoints = endpoints end def call(kind = default) = io.puts processor.call(endpoints.fetch(kind)).to_json private attr_reader :processor, :endpoints end end end end
Version data entries
8 entries across 8 versions & 1 rubygems