module Recipe
Module name must be filename, minus .rb, in CamelCase.
Public Class Methods
ack()
click to toggle source
# File lib/aspects/ack.rb, line 2 def self.ack 'ack --version' end
arch()
click to toggle source
# File lib/specs.rb, line 144 def self.arch "ruby -rrbconfig -e \"puts RbConfig::CONFIG['arch']\"" end
as()
click to toggle source
# File lib/aspects/as.rb, line 2 def self.as # Windows if Os.windows? 'as -version' # Assume OS is a Unix variant. # as hangs by default, waiting for stdin to end; # Send EOF via /dev/null. # # Don't create spurious a.out file. else 'as -o /dev/null -version < /dev/null' end end
bios()
click to toggle source
# File lib/aspects/bios.rb, line 2 def self.bios if Os.windows? 'systeminfo | findstr /B /C:"BIOS Version"' end end
boot2docker()
click to toggle source
# File lib/aspects/docker.rb, line 6 def self.boot2docker 'boot2docker version' end
bundler()
click to toggle source
# File lib/aspects/ruby.rb, line 12 def self.bundler 'bundle --version' end
cabal()
click to toggle source
# File lib/aspects/haskell.rb, line 10 def self.cabal 'cabal --version' end
chicken()
click to toggle source
# File lib/aspects/chicken.rb, line 14 def self.chicken [eggs, csi] end
chocolatey()
click to toggle source
# File lib/aspects/chocolatey.rb, line 2 def self.chocolatey if Os.windows? 'chocolatey version' end end
chrome()
click to toggle source
# File lib/aspects/chrome.rb, line 2 def self.chrome # Assumes Chrome installed in default directory. if Os.mac? '/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --version 2>&1 | grep -v Unsure' # Redirect stderr to stdout elsif Os.windows? 'reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Google\\Update\\Clients\\{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}"' # Assumes # * binary is google-chrome. # * binary is in PATH. else 'google-chrome --version' end end
classpath()
click to toggle source
# File lib/aspects/java.rb, line 10 def self.classpath if Os.windows? && !Os.mingw? 'echo %CLASSPATH' else 'echo $CLASSPATH' end end
clj()
click to toggle source
# File lib/aspects/clojure.rb, line 6 def self.clj 'lein exec -e \'(println "Clojure " (clojure-version))\'' end
clojure()
click to toggle source
# File lib/aspects/clojure.rb, line 10 def self.clojure [clj, lein] end
command_not_found()
click to toggle source
# File lib/specs.rb, line 116 def self.command_not_found # Windows but not MinGW if Os.windows? && !Os.mingw? 'not recognized as an internal or external command' # MinGW or other Unix variant. else 'command not found' end end
cpan()
click to toggle source
# File lib/aspects/perl.rb, line 2 def self.cpan 'cpan --version' end
cpu()
click to toggle source
# File lib/aspects/cpu.rb, line 2 def self.cpu if Os.windows? 'wmic cpu get NumberOfCores, NumberOfLogicalProcessors' elsif Os.mac? [ 'system_profiler | grep Cores: ', 'system_profiler | grep Processors:' ] else 'cat /proc/cpuinfo | grep processor | wc -l' end end
csc()
click to toggle source
# File lib/aspects/chicken.rb, line 10 def self.csc 'csc -version' end
csi()
click to toggle source
# File lib/aspects/chicken.rb, line 6 def self.csi 'csi -version' end
dmake()
click to toggle source
# File lib/aspects/dmake.rb, line 2 def self.dmake 'dmake -V' end
docker()
click to toggle source
# File lib/aspects/docker.rb, line 10 def self.docker if Os.linux? [dockerv] else [dockerv, boot2docker, 'vagrant --version', virtualbox] end end
dockerv()
click to toggle source
# File lib/aspects/docker.rb, line 2 def self.dockerv 'docker version' end
eggs()
click to toggle source
# File lib/aspects/chicken.rb, line 2 def self.eggs 'chicken-install -version' end
emacs()
click to toggle source
# File lib/aspects/emacs.rb, line 8 def self.emacs 'emacs --version' end
erl()
click to toggle source
# File lib/aspects/erlang.rb, line 6 def self.erl 'erl -eval \'erlang:display(erlang:system_info(otp_release)), halt().\' -noshell' end
erlang()
click to toggle source
# File lib/aspects/erlang.rb, line 10 def self.erlang [rebar, erl] end
es()
click to toggle source
# File lib/aspects/es.rb, line 2 def self.es 'curl -s http://localhost:9200/ | grep number' end
fabric()
click to toggle source
# File lib/aspects/fabric.rb, line 2 def self.fabric 'fab --version' end
firefox()
click to toggle source
# File lib/aspects/firefox.rb, line 2 def self.firefox # Assumes Firefox is installed in the default directory. if Os.windows? 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox --version' elsif Os.mac? '/Applications/Firefox.app/Contents/MacOS/firefox --version' # Assumes firefox in PATH. else 'firefox --version' end end
ghc()
click to toggle source
# File lib/aspects/haskell.rb, line 14 def self.ghc 'ghc --version' end
go()
click to toggle source
# File lib/aspects/go.rb, line 2 def self.go 'go version' end
hadoop()
click to toggle source
# File lib/aspects/hadoop.rb, line 22 def self.hadoop [hadoophome, hadoopversion, hadoopcommand] end
hadoopcommand()
click to toggle source
# File lib/aspects/hadoop.rb, line 18 def self.hadoopcommand 'hadoop version' end
hadoophome()
click to toggle source
# File lib/aspects/hadoop.rb, line 2 def self.hadoophome if Os.windows? && !Os.mingw? 'echo %HADOOP_PREFIX%' else 'echo $HADOOP_PREFIX' end end
hadoopversion()
click to toggle source
# File lib/aspects/hadoop.rb, line 10 def self.hadoopversion if Os.windows? && !Os.mingw? 'echo %HADOOP_VERSION%' else 'echo $HADOOP_VERSION' end end
hardware()
click to toggle source
ModuleName.command returns the appropriate command line instruction for returning the relevant specifications. OS-contextual instructions can be modulated by querying the Os
module (see the root specs Ruby code).
# File lib/aspects/hardware.rb, line 5 def self.hardware # Use environment variable. if Os.windows? 'systeminfo | findstr /B /C:"System Manufacturer" /C:"System Model"' # Produces a noticeable delay. elsif Os.mac? 'system_profiler 2>&1 | grep \'Model Identifier\'' # Assume: # * OS is a Unix variant. # * dmidecode is installed. else 'sudo dmidecode -t system | grep \'Manufacturer\\|Product\'' end end
haskell()
click to toggle source
# File lib/aspects/haskell.rb, line 26 def self.haskell if Os.mac? [cabal, ghc] else [cabal, ghc, haskellplatform] end end
haskellplatform()
click to toggle source
# File lib/aspects/haskell.rb, line 18 def self.haskellplatform if Os.linux? Package.apt('haskell-platform') else 'ghc-pkg field haskell-platform version' end end
hd()
click to toggle source
# File lib/aspects/hd.rb, line 2 def self.hd if Os.windows? 'fsutil fsinfo drives' else 'df -h' end end
ie()
click to toggle source
# File lib/aspects/ie.rb, line 2 def self.ie if Os.windows? 'reg query "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Internet Explorer" /v Version' end end
inkscape()
click to toggle source
# File lib/aspects/inkscape.rb, line 2 def self.inkscape case Os.os_name when :windows if Os.x86_64? 'C:\\Program Files (x86)\\Inkscape\\inkscape --version' else '"C:\\Program Files\\Inkscape\\inkscape" --version' end when :mac '/Applications/Inkscape.app/Contents/Resources/bin/inkscape --version' else 'inkscape --version' end end
iojs()
click to toggle source
# File lib/aspects/iojs.rb, line 6 def self.iojs [npm, iojs_v] end
iojs_v()
click to toggle source
# File lib/aspects/iojs.rb, line 2 def self.iojs_v 'iojs --version' end
java()
click to toggle source
# File lib/aspects/java.rb, line 34 def self.java [mvn, classpath, javahome, oakc, oak] end
javahome()
click to toggle source
# File lib/aspects/java.rb, line 18 def self.javahome if Os.windows? && !Os.mingw? 'echo %JAVA_HOME%' else 'echo $JAVA_HOME' end end
kafka()
click to toggle source
# File lib/aspects/kafka.rb, line 2 def self.kafka if Os.mac? [Package::brew('kafka')] end end
lacheck()
click to toggle source
# File lib/aspects/lacheck.rb, line 2 def self.lacheck 'lacheck | grep lacheck.lex' end
latex()
click to toggle source
# File lib/aspects/latex.rb, line 2 def self.latex if Os.unix? 'pdflatex --version' end end
ld()
click to toggle source
# File lib/aspects/ld.rb, line 2 def self.ld 'ld -v' end
lein()
click to toggle source
# File lib/aspects/clojure.rb, line 2 def self.lein 'lein --version' end
links()
click to toggle source
# File lib/aspects/links.rb, line 2 def self.links 'links -version' end
lua()
click to toggle source
# File lib/aspects/lua.rb, line 2 def self.lua 'lua -v' end
maven()
click to toggle source
# File lib/aspects/java.rb, line 2 def self.maven mvn end
memcached()
click to toggle source
# File lib/aspects/memcached.rb, line 2 def self.memcached 'echo version | nc localhost 11211' end
mvn()
click to toggle source
# File lib/aspects/java.rb, line 6 def self.mvn 'mvn --version' end
net()
click to toggle source
# File lib/aspects/net.rb, line 2 def self.net 'ruby -e "require \'net/http\'; puts Net::HTTP.new(\'icanhazip.com\').request(Net::HTTP::Get.new(\'/\', {\'User-Agent\'=>\'curl\'})).body"' end
node()
click to toggle source
# File lib/aspects/node.rb, line 6 def self.node [npm, nodejs] end
nodejs()
click to toggle source
# File lib/aspects/node.rb, line 2 def self.nodejs 'node --version' end
npm()
click to toggle source
# File lib/aspects/npm.rb, line 8 def self.npm 'npm --version' end
oak()
click to toggle source
# File lib/aspects/java.rb, line 26 def self.oak 'java -version' end
oakc()
click to toggle source
# File lib/aspects/java.rb, line 30 def self.oakc 'javac -version' end
ocaml()
click to toggle source
# File lib/aspects/ocaml.rb, line 16 def self.ocaml [ocamlc, opam] end
ocamlc()
click to toggle source
# File lib/aspects/ocaml.rb, line 8 def self.ocamlc 'ocamlc -version' end
opam()
click to toggle source
# File lib/aspects/ocaml.rb, line 12 def self.opam 'opam --version' end
openssl()
click to toggle source
# File lib/aspects/openssl.rb, line 2 def self.openssl 'openssl version' end
opera()
click to toggle source
# File lib/aspects/opera.rb, line 2 def self.opera # Assumes opera in PATH. if Os.unix? && !Os.mac? 'opera -version' # Opera for Mac/Windows does not support the -version command line option. # # Assumes Opera is installed in the default directory. # elsif Os.mac? # '/Applications/Opera.app/Contents/MacOS/Opera -version' # elsif Os.windows? # 'C:\\Program Files (x86)\\Opera\\opera -version' end end
os()
click to toggle source
# File lib/specs.rb, line 127 def self.os case Os.os_name when :windows 'systeminfo | findstr /B /C:"OS Name" /C:"OS Version"' when :mac 'system_profiler SPSoftwareDataType | grep \'System Version\'' when :linux 'cat /etc/*release*' when :unix 'uname -a' # Punt. else 'echo $OS' end end
oz()
click to toggle source
# File lib/aspects/oz.rb, line 2 def self.oz 'ozc -v' end
pear()
click to toggle source
# File lib/aspects/php.rb, line 2 def self.pear 'pear version' end
perl()
click to toggle source
# File lib/aspects/perl.rb, line 10 def self.perl [cpan, pl] end
ph()
click to toggle source
# File lib/aspects/php.rb, line 6 def self.ph 'php --version' end
php()
click to toggle source
# File lib/aspects/php.rb, line 10 def self.php [pear, ph] end
pip()
click to toggle source
# File lib/aspects/python.rb, line 8 def self.pip 'pip --version' end
pip3()
click to toggle source
# File lib/aspects/python3.rb, line 8 def self.pip3 'pip3 --version' end
pl()
click to toggle source
# File lib/aspects/perl.rb, line 6 def self.pl 'perl --version' end
postgres()
click to toggle source
# File lib/aspects/postgres.rb, line 6 def self.postgres 'psql --version' end
postgresql()
click to toggle source
# File lib/aspects/postgres.rb, line 2 def self.postgresql 'psql --version' end
powershell()
click to toggle source
# File lib/aspects/powershell.rb, line 2 def self.powershell if Os.windows? '@powershell Get-Host' end end
py()
click to toggle source
# File lib/aspects/python.rb, line 12 def self.py 'python --version' end
py3()
click to toggle source
# File lib/aspects/python3.rb, line 12 def self.py3 'python3 --version' end
python()
click to toggle source
# File lib/aspects/python.rb, line 16 def self.python [pip, py] end
python3()
click to toggle source
# File lib/aspects/python3.rb, line 16 def self.python3 [pip3, py3] end
ram()
click to toggle source
# File lib/aspects/ram.rb, line 2 def self.ram if Os.windows? 'systeminfo | findstr /C:"Total Physical Memory"' elsif Os.mac? 'system_profiler | grep \'Memory:\'' else 'grep MemTotal /proc/meminfo' end end
rb()
click to toggle source
# File lib/aspects/ruby.rb, line 20 def self.rb 'ruby --version' end
rebar()
click to toggle source
# File lib/aspects/erlang.rb, line 2 def self.rebar 'rebar -V' end
redis()
click to toggle source
# File lib/aspects/redis.rb, line 10 def self.redis # In Windows, Redis server is provided as a service # instead of a CLI program. if Os.windows? redis_cli else [redis_cli, redis_server] end end
redis_cli()
click to toggle source
# File lib/aspects/redis.rb, line 2 def self.redis_cli 'redis-cli --version' end
redis_server()
click to toggle source
# File lib/aspects/redis.rb, line 6 def self.redis_server 'redis-server --version' end
ruby()
click to toggle source
# File lib/aspects/ruby.rb, line 24 def self.ruby [bundler, rubygems, rb] end
ruby1_8?()
click to toggle source
# File lib/specs.rb, line 154 def self.ruby1_8? RUBY_VERSION =~ /^1\.8/ end
ruby1_9?()
click to toggle source
# File lib/specs.rb, line 159 def self.ruby1_9? RUBY_VERSION =~ /^1\.9/ end
ruby2?()
click to toggle source
# File lib/specs.rb, line 164 def self.ruby2? RUBY_VERSION =~ /^2/ end
ruby_v()
click to toggle source
# File lib/specs.rb, line 149 def self.ruby_v RUBY_VERSION end
rubygems()
click to toggle source
# File lib/aspects/ruby.rb, line 16 def self.rubygems 'gem --version' end
safari()
click to toggle source
# File lib/aspects/safari.rb, line 2 def self.safari if Os.mac? 'system_profiler SPApplicationsDataType | grep \'Safari:\' -A 2' end end
sbt()
click to toggle source
# File lib/aspects/scala.rb, line 6 def self.sbt 'sbt sbt-version' end
scala()
click to toggle source
# File lib/aspects/scala.rb, line 10 def self.scala [sbt, scalac] end
scalac()
click to toggle source
# File lib/aspects/scala.rb, line 2 def self.scalac 'scalac -version' end
shell()
click to toggle source
# File lib/aspects/shell.rb, line 2 def self.shell if Os.windows? 'echo %cmdextversion%' elsif Os.unix? 'sh --version' end end
splint()
click to toggle source
# File lib/aspects/splint.rb, line 2 def self.splint 'splint -help version' end
ssh()
click to toggle source
# File lib/aspects/ssh.rb, line 2 def self.ssh 'ssh -V' end
ssl()
click to toggle source
# File lib/aspects/ssl.rb, line 2 def self.ssl 'openssl version' end
tap()
click to toggle source
# File lib/aspects/tap.rb, line 2 def self.tap 'tap --version' end
terminal()
click to toggle source
# File lib/aspects/terminal.rb, line 2 def self.terminal if Os.mac? 'system_profiler -detailLevel full 2>&1 | grep Terminal -A 5 | grep Version -m 1' end end
thrift()
click to toggle source
# File lib/aspects/thrift.rb, line 2 def self.thrift 'thrift -version' end
thunderbolt()
click to toggle source
# File lib/aspects/thunderbolt.rb, line 2 def self.thunderbolt if Os.mac? 'system_profiler | grep \'Thunderbolt Version\' | head -n 1' end end
virtualbox()
click to toggle source
# File lib/aspects/virtualbox.rb, line 2 def self.virtualbox case Os.os_name when :windows if Os.x86_64? '"C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe" --version' else '"C:\\Program Files (x86)\\Oracle\\VirtualBox\\VBoxManage.exe" --version' end when :mac 'vboxwebsrv --help 2>&1 | grep VirtualBox' else 'vboxwebsrv --help 2>&1 | grep VirtualBox' end end
xcode()
click to toggle source
# File lib/aspects/xcode.rb, line 2 def self.xcode if Os.mac? 'xcodebuild -version' end end