Sha256: e02582d8be944436bcbe8e4b0dd66a345174f75a96c408a744dd2be815fa553e
Contents?: true
Size: 1020 Bytes
Versions: 3
Compression:
Stored size: 1020 Bytes
Contents
# frozen_string_literal: true module RubyJard module Commands ## # Show a screen class ShowCommand < Pry::ClassCommand description 'Show a screen' banner <<-BANNER Usage: jard show [-h] [screen] BANNER match 'show' def initialize(context = {}) super(context) @screens = context[:screens] || RubyJard::Screens @config = context[:config] || RubyJard.config end def process screen = args.first.to_s.strip if screen.empty? raise Pry::CommandError, "Please input one of the following: #{@screens.names.join(', ')}" end unless @screens.names.include?(screen) raise Pry::CommandError, "Screen `#{screen}` not found. Please input one of the following: #{@screens.names.join(', ')}" end @config.enabled_screens << screen @config.enabled_screens.uniq! RubyJard::ControlFlow.dispatch(:list) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ruby_jard-0.3.1 | lib/ruby_jard/commands/jard/show_command.rb |
ruby_jard-0.3.0 | lib/ruby_jard/commands/jard/show_command.rb |
ruby_jard-0.2.3 | lib/ruby_jard/commands/jard/show_command.rb |