haileys/rbs
ruby port of Python's pbs
{ "createdAt": "2012-09-04T05:54:41Z", "defaultBranch": "master", "description": "ruby port of Python's pbs", "fullName": "haileys/rbs", "homepage": null, "language": "Ruby", "name": "rbs", "pushedAt": "2012-09-04T07:12:54Z", "stargazersCount": 2, "topics": [], "updatedAt": "2015-03-12T15:46:23Z", "url": "https://github.com/haileys/rbs"}rbs is a Ruby port of Python’s pbs.
It tries to make shelling out easier and nicer.
This sounds good!! how do I get it???
Section titled “This sounds good!! how do I get it???”gem install rbsQuick Examples
Section titled “Quick Examples”Query the en0 network interface:
require "rbs"puts rbs.ifconfig "en0"Check gcc’s version:
require "rbs"puts rbs.gcc(:version).lines.firstPOST some JSON to an API:
require "rbs"rbs.curl(:X, "POST", :"data-ascii", %{{"my":["example","json","document"]}})Features
Section titled “Features”-
rbs supports importing certain commands into the global namespace:
require "rbs"rbs :echoecho "hello world" -
rbs tries to be smart about programs that have dashes in their names:
require "rbs"rbs.llvm_gcc # tries `llvm_gcc` first, and then tries `llvm-gcc` -
For programs with really funky names, you can use the
[]operator:require "rbs"rbs["ruby-1.9.3-p194", :version] # executes `ruby-1.9.3-p194 --version` -
rbs supports scopes, so if you’d like to run a bunch of commands as root:
require "rbs"rbs.sudo doputs rbs.whoamirbs.rm :r, :f, "/"end -
You can also pass a
Hashinto an rbs command and it will be decomposed into arguments:require "rbs"rbs.configure prefix: "/usr/local", with_zlib_dir: "/path/to/zlib"# executes: `configure --prefix=/usr/local --with-zlib-dir=/path/to/zlib`