module

External

Module to deal with external stuffs in Crystal

Constants

VERSION = "0.0.1"

Class methods

open(something : String, app = nil, platform = nil)

Opens something externally in manner of your OS. In OS X, it uses 'open' command. In Windows, it uses 'start' command. In Linux or other *nix OS, it uses 'xdg-open' command included in this repository.

  External::open "http://crystal-lang.org/"
  External::open "file:///Users/foo/Documents/somedoc.pdf"
  External::open "../../README.md"
  External::open "musics/bar.mp3"
Source
opener(app = nil, platform = nil)

Returns the command string to open something externally.

  External::opener
  External::opener("Google Chrome")
  External::opener("Google Chrome", :darwin)
  External::opener("Google Chrome", :windows)
  External::opener("Google Chrome", :linux)
Source