Class: Rgversion::Instruction

Inherits:
Object
  • Object
show all
Defined in:
lib/rgversion/instruction.rb

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Instruction

Returns a new instance of Instruction.



3
4
5
# File 'lib/rgversion/instruction.rb', line 3

def initialize(command)
  @command = command
end

Instance Method Details

#renderObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/rgversion/instruction.rb', line 7

def render
  if @command.nil?
    puts "\nWarning: at this moment rgversion doesn't support copy to clipboard feature if your OS isn't macOS or Linux."
    puts "You can manually copy output above."
  elsif @command == :xclip
    puts "\nWarning: unable to copy to clipboard because #{@command} is missed."
    puts "Try the command below if you are on Ubuntu/Debian:"
    puts "sudo apt-get install #{@command}"
  end
end