Sha256: 0331ab093ff2baa0a9e85b357602e0a631d75b8a431dfecee088f234e0a713dc

Contents?: true

Size: 1.24 KB

Versions: 6

Compression:

Stored size: 1.24 KB

Contents

# The requested command is passed in here as @command
case @command

when "link:listen"
  t = Thread.new do
    OrigenLink::Listener.run!
  end
  Thread.new do
    # Get the current host
    host = `hostname`.strip.downcase
    if Origen.os.windows?
      domain = ''  # Not sure what to do in this case...
    else
      domain = `dnsdomainname`.strip
    end
    port = 20020
    puts ''
    sleep 0.5
    puts
    puts
    puts "*************************************************************"
    puts "Point your OrigenLink app to:  http://#{host}#{domain.empty? ? '' : '.' + domain}:#{port}"
    puts "*************************************************************"
    puts
    puts
  end

  # Fall through to the Origen interactive command to open up a console
  @command = "interactive"

# Always leave an else clause to allow control to fall back through to the Origen command handler.
# You probably want to also add the command details to the help shown via 'origen -h',
# you can do this bb adding the required text to @plugin_commands before handing control back to
# Origen.
else
  @plugin_commands << <<-EOT
 link:listen     Open a console and listen for OrigenLink requests over http (i.e. from a GUI)
  EOT

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
origen_link-0.4.2 config/shared_commands.rb
origen_link-0.4.1 config/shared_commands.rb
origen_link-0.4.0 config/shared_commands.rb
origen_link-0.3.1 config/shared_commands.rb
origen_link-0.3.0 config/shared_commands.rb
origen_link-0.2.0 config/shared_commands.rb