Sha256: e2e7e9e2dd5e20cb6b958729b40cc78a513ffba25df5789895914cacabc2fa9a

Contents?: true

Size: 410 Bytes

Versions: 35

Compression:

Stored size: 410 Bytes

Contents

module TerminalCommands
  def self.open_file_or_link(file_or_link, options = {})
    command = if macosx?
      "open"
    elsif linux?
      "xdg-open"
    end
    `#{command} #{file_or_link}`
  end

  def self.os
    Gem::Platform.local.os
  end

  def self.macosx?
    os == macosx
  end

  def self.linux?
    os == linux
  end

  def self.macosx
    "darwin"
  end

  def self.linux
    "linux"
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
bullet_train-super_scaffolding-1.0.39 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.38 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.37 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.36 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.35 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.34 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.33 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.32 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.31 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.30 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.29 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.28 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.27 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.26 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.25 lib/bullet_train/terminal_commands.rb