Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

splat

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

splat

  • 0.1.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= splat

small gem to provide an adapter for various platform specific features.

This is done by adding the following methods to String:

  • to_editor
  • to_browser
  • to_clipboard
  • to_speech
  • to_launcher
  • to_player
  • to_os_path

== installation

gem install splat

== load

require 'splat'

== launch editor

'current content'.to_editor

Defaults to notepad on windows and vim everywhere else. Set "EDITOR" environment variable to override this.

== clipboard

'some new content'.to_clipboard

Copies the string to the os clipboard. Requires 'xclip' on linux.

== default application launcher

'http://google.com'.to_launcher 'textfile.txt'.to_launcher 'audiofile.mp3'.to_launcher

Launches the referenced content with the default system application. Requires 'gnome-open' on linux.

== audio player

'audio.mp3'.to_player

Uses 'afplay' on mac os x, 'mpg123' on windows and 'mplayer' on linux.

== text to speech

"I'm afraid. I'm afraid, Dave. Dave, my mind is going.".to_speech

Uses 'say' on mac os x, win32 sapi on windows and espeak on linux.

== path cleaning

'c:/a/path/that/might/upset/some/windows.application'.to_os_path

This will simply replace '/' characters with '' on windows and otherwise leave the path as is.

Note that this is only necessary for passing a path to native windows applications on windows.

== Future plans for world domination

  • detect other platforms
  • more configurable
  • determine 1.9 compatibility

FAQs

Package last updated on 09 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc