module External

Overview

Module to deal with external stuffs in Crystal

Defined in:

external/open.cr
external/version.cr

Constant Summary

VERSION = "0.0.1"

Class Method Summary

Class Method Detail

def self.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"

[View source]
def self.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)

[View source]