Sha256: 57ac030ee0d55251bebecafcdfcd9865b95171d62a59a9c2c5cbdde4fa6b4401
Contents?: true
Size: 912 Bytes
Versions: 10
Compression:
Stored size: 912 Bytes
Contents
# frozen_string_literal: true require "sod" module SublimeTextKit module CLI module Actions # Handles snippets action. class Snippets < Sod::Action include Import[:configuration, :logger] description "View snippets." on %w[-s --snippets], argument: "[FORMAT]", allow: %w[markdown ascii_doc] default { Container[:configuration].snippets_format } def initialize(printer: SublimeTextKit::Snippets::Printer.new, **) super(**) @printer = printer end def call kind = nil kind ||= default case kind when "ascii_doc" then printer.call "*" when "markdown" then printer.call "-" else logger.error { "Invalid snippet format: #{kind}. Use ascii_doc or markdown." } end end private attr_reader :printer end end end end
Version data entries
10 entries across 10 versions & 1 rubygems