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

darky

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

darky

  • 0.0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Darky

yet another shell wrapper....

Syntax

 # Block
 Darky.new do |shell|
  shell['/usr/local'] do
    shell.exec "pwd" # "/usr/local"
  end
  shell.exec "pwd" # "/home/shuki"
  
  shell = shell['/usr/local']
  shell.exec "pwd" # "/usr/local"

  shell.chdir "/tmp" do
    shell.exec "pwd" # "/tmp"
  end
  shell.exec "pwd" # "/usr/local"
  
  shell.chdir! "/tmp"
  shell.exec "pwd" # "/tmp"
 end
 
 # Instance
 shell = Darky.new(:dir => '/tmp')
 shell.exec "pwd" # /tmp
 
 # By using shell.async, you can make calls asynchronously.
 obj = shell.async.ln_lrth # run `ls -lrth`
 obj.on_success { |resp| STDOUT.puts resp.out }
 obj.on_failure { |resp| STDOUT.puts response.err }
 

TODO

  • use send method to send commands + think about arguments
  • can be included to any class
  • support environment variables (sticky or non-sticky)
  • support eventmachine
  • support threads
  • support celluloid.io
  • support threads
  • support callbacks success, failure, or just .callback
  • exec without fork
  • support sudo prompt
  • exceptions - failure, permission denied
  • internal / external logger
  • logger should support filters, like ignore /shuki.*/
  • open4/3
  • timeout + handler
  • kill when using proxy object
  • save the state when using custom client
  • can be included into class - to describe a service

FAQs

Package last updated on 18 Nov 2012

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