Class: EnvCommand

Inherits:
Command show all
Defined in:
lib/replicant/commands/env_command.rb

Constant Summary

Constants included from Styles

Styles::CONSOLE_WIDTH, Styles::REPL_OUT, Styles::STYLES

Instance Attribute Summary

Attributes inherited from Command

#args

Instance Method Summary collapse

Methods inherited from Command

all, #description, #execute, inherited, #initialize, load, #name, #usage

Methods included from Styles

#create_style, #end_style, #styled_text

Constructor Details

This class inherits a constructor from Command

Instance Method Details

#runObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/replicant/commands/env_command.rb', line 7

def run
  env = "Package: #{@repl.default_package || 'Not set'}\n"
  env << "Device: "
  device = @repl.default_device
  env << if device
    "#{device.name} (#{device.id})"
  else
    'Not set'
  end
  output env
end

#valid_args?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/replicant/commands/env_command.rb', line 3

def valid_args?
  args.blank?
end