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.1.15 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.14 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.13 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.12 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.11 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.10 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.9 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.8 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.7 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.6 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.5 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.4 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.3 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.2 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.1 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.1.0 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.43 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.42 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.41 lib/bullet_train/terminal_commands.rb
bullet_train-super_scaffolding-1.0.40 lib/bullet_train/terminal_commands.rb