Module: Recipe
- Includes:
- Contracts::Modules
- Defined in:
- lib/specs.rb,
lib/aspects/as.rb,
lib/aspects/es.rb,
lib/aspects/go.rb,
lib/aspects/hd.rb,
lib/aspects/ie.rb,
lib/aspects/ld.rb,
lib/aspects/oz.rb,
lib/aspects/ack.rb,
lib/aspects/apt.rb,
lib/aspects/cpu.rb,
lib/aspects/lua.rb,
lib/aspects/net.rb,
lib/aspects/npm.rb,
lib/aspects/php.rb,
lib/aspects/ram.rb,
lib/aspects/ssh.rb,
lib/aspects/ssl.rb,
lib/aspects/tap.rb,
lib/aspects/bios.rb,
lib/aspects/brew.rb,
lib/aspects/cask.rb,
lib/aspects/iojs.rb,
lib/aspects/java.rb,
lib/aspects/node.rb,
lib/aspects/perl.rb,
lib/aspects/ruby.rb,
lib/aspects/dmake.rb,
lib/aspects/emacs.rb,
lib/aspects/kafka.rb,
lib/aspects/latex.rb,
lib/aspects/links.rb,
lib/aspects/ocaml.rb,
lib/aspects/opera.rb,
lib/aspects/redis.rb,
lib/aspects/scala.rb,
lib/aspects/shell.rb,
lib/aspects/xcode.rb,
lib/aspects/chrome.rb,
lib/aspects/docker.rb,
lib/aspects/erlang.rb,
lib/aspects/fabric.rb,
lib/aspects/hadoop.rb,
lib/aspects/python.rb,
lib/aspects/safari.rb,
lib/aspects/splint.rb,
lib/aspects/thrift.rb,
lib/aspects/chicken.rb,
lib/aspects/clojure.rb,
lib/aspects/firefox.rb,
lib/aspects/haskell.rb,
lib/aspects/lacheck.rb,
lib/aspects/openssl.rb,
lib/aspects/python3.rb,
lib/aspects/hardware.rb,
lib/aspects/inkscape.rb,
lib/aspects/postgres.rb,
lib/aspects/terminal.rb,
lib/aspects/memcached.rb,
lib/aspects/chocolatey.rb,
lib/aspects/powershell.rb,
lib/aspects/virtualbox.rb,
lib/aspects/thunderbolt.rb
Overview
Module name must be filename, minus .rb, in CamelCase.
Defined Under Namespace
Modules: Package
Class Method Summary collapse
- .ack ⇒ Object
- .arch ⇒ Object
- .as ⇒ Object
- .bios ⇒ Object
- .boot2docker ⇒ Object
- .bundler ⇒ Object
- .cabal ⇒ Object
- .chicken ⇒ Object
- .chocolatey ⇒ Object
- .chrome ⇒ Object
- .classpath ⇒ Object
- .clj ⇒ Object
- .clojure ⇒ Object
- .command_not_found ⇒ Object
- .cpan ⇒ Object
- .cpu ⇒ Object
- .csc ⇒ Object
- .csi ⇒ Object
- .dmake ⇒ Object
- .docker ⇒ Object
- .dockerv ⇒ Object
- .eggs ⇒ Object
- .emacs ⇒ Object
- .erl ⇒ Object
- .erlang ⇒ Object
- .es ⇒ Object
- .fabric ⇒ Object
- .firefox ⇒ Object
- .ghc ⇒ Object
- .go ⇒ Object
- .hadoop ⇒ Object
- .hadoopcommand ⇒ Object
- .hadoophome ⇒ Object
- .hadoopversion ⇒ Object
-
.hardware ⇒ Object
ModuleName.command returns the appropriate command line instruction for returning the relevant specifications.
- .haskell ⇒ Object
- .haskellplatform ⇒ Object
- .hd ⇒ Object
- .ie ⇒ Object
- .inkscape ⇒ Object
- .iojs ⇒ Object
- .iojs_v ⇒ Object
- .java ⇒ Object
- .javahome ⇒ Object
- .kafka ⇒ Object
- .lacheck ⇒ Object
- .latex ⇒ Object
- .ld ⇒ Object
- .lein ⇒ Object
- .links ⇒ Object
- .lua ⇒ Object
- .maven ⇒ Object
- .memcached ⇒ Object
- .mvn ⇒ Object
- .net ⇒ Object
- .node ⇒ Object
- .nodejs ⇒ Object
- .npm ⇒ Object
- .oak ⇒ Object
- .oakc ⇒ Object
- .ocaml ⇒ Object
- .ocamlc ⇒ Object
- .opam ⇒ Object
- .openssl ⇒ Object
- .opera ⇒ Object
- .os ⇒ Object
- .oz ⇒ Object
- .pear ⇒ Object
- .perl ⇒ Object
- .ph ⇒ Object
- .php ⇒ Object
- .pip ⇒ Object
- .pip3 ⇒ Object
- .pl ⇒ Object
- .postgres ⇒ Object
- .postgresql ⇒ Object
- .powershell ⇒ Object
- .py ⇒ Object
- .py3 ⇒ Object
- .python ⇒ Object
- .python3 ⇒ Object
- .ram ⇒ Object
- .rb ⇒ Object
- .rebar ⇒ Object
- .redis ⇒ Object
- .redis_cli ⇒ Object
- .redis_server ⇒ Object
- .ruby ⇒ Object
- .ruby1_8? ⇒ Boolean
- .ruby1_9? ⇒ Boolean
- .ruby2? ⇒ Boolean
- .ruby_v ⇒ Object
- .rubygems ⇒ Object
- .safari ⇒ Object
- .sbt ⇒ Object
- .scala ⇒ Object
- .scalac ⇒ Object
- .shell ⇒ Object
- .splint ⇒ Object
- .ssh ⇒ Object
- .ssl ⇒ Object
- .tap ⇒ Object
- .terminal ⇒ Object
- .thrift ⇒ Object
- .thunderbolt ⇒ Object
- .virtualbox ⇒ Object
- .xcode ⇒ Object
Class Method Details
.ack ⇒ Object
2 3 4 |
# File 'lib/aspects/ack.rb', line 2 def self.ack 'ack --version' end |
.arch ⇒ Object
144 145 146 |
# File 'lib/specs.rb', line 144 def self.arch "ruby -rrbconfig -e \"puts RbConfig::CONFIG['arch']\"" end |
.as ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# 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 ⇒ Object
2 3 4 5 6 |
# File 'lib/aspects/bios.rb', line 2 def self.bios if Os.windows? 'systeminfo | findstr /B /C:"BIOS Version"' end end |
.boot2docker ⇒ Object
6 7 8 |
# File 'lib/aspects/docker.rb', line 6 def self.boot2docker 'boot2docker version' end |
.bundler ⇒ Object
12 13 14 |
# File 'lib/aspects/ruby.rb', line 12 def self.bundler 'bundle --version' end |
.cabal ⇒ Object
10 11 12 |
# File 'lib/aspects/haskell.rb', line 10 def self.cabal 'cabal --version' end |
.chicken ⇒ Object
14 15 16 |
# File 'lib/aspects/chicken.rb', line 14 def self.chicken [eggs, csi] end |
.chocolatey ⇒ Object
2 3 4 5 6 |
# File 'lib/aspects/chocolatey.rb', line 2 def self.chocolatey if Os.windows? 'chocolatey version' end end |
.chrome ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# 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 ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/aspects/java.rb', line 10 def self.classpath if Os.windows? && !Os.mingw? 'echo %CLASSPATH' else 'echo $CLASSPATH' end end |
.clj ⇒ Object
6 7 8 |
# File 'lib/aspects/clojure.rb', line 6 def self.clj 'lein exec -e \'(println "Clojure " (clojure-version))\'' end |
.clojure ⇒ Object
10 11 12 |
# File 'lib/aspects/clojure.rb', line 10 def self.clojure [clj, lein] end |
.command_not_found ⇒ Object
116 117 118 119 120 121 122 123 124 |
# 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 ⇒ Object
2 3 4 |
# File 'lib/aspects/perl.rb', line 2 def self.cpan 'cpan --version' end |
.cpu ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# 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 ⇒ Object
10 11 12 |
# File 'lib/aspects/chicken.rb', line 10 def self.csc 'csc -version' end |
.csi ⇒ Object
6 7 8 |
# File 'lib/aspects/chicken.rb', line 6 def self.csi 'csi -version' end |
.dmake ⇒ Object
2 3 4 |
# File 'lib/aspects/dmake.rb', line 2 def self.dmake 'dmake -V' end |
.docker ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/aspects/docker.rb', line 10 def self.docker if Os.linux? [dockerv] else [dockerv, boot2docker, 'vagrant --version', virtualbox] end end |
.dockerv ⇒ Object
2 3 4 |
# File 'lib/aspects/docker.rb', line 2 def self.dockerv 'docker version' end |
.eggs ⇒ Object
2 3 4 |
# File 'lib/aspects/chicken.rb', line 2 def self.eggs 'chicken-install -version' end |
.emacs ⇒ Object
8 9 10 |
# File 'lib/aspects/emacs.rb', line 8 def self.emacs 'emacs --version' end |
.erl ⇒ Object
6 7 8 |
# File 'lib/aspects/erlang.rb', line 6 def self.erl 'erl -eval \'erlang:display(erlang:system_info(otp_release)), halt().\' -noshell' end |
.erlang ⇒ Object
10 11 12 |
# File 'lib/aspects/erlang.rb', line 10 def self.erlang [, erl] end |
.es ⇒ Object
2 3 4 |
# File 'lib/aspects/es.rb', line 2 def self.es 'curl -s http://localhost:9200/ | grep number' end |
.fabric ⇒ Object
2 3 4 |
# File 'lib/aspects/fabric.rb', line 2 def self.fabric 'fab --version' end |
.firefox ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# 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 ⇒ Object
14 15 16 |
# File 'lib/aspects/haskell.rb', line 14 def self.ghc 'ghc --version' end |
.go ⇒ Object
2 3 4 |
# File 'lib/aspects/go.rb', line 2 def self.go 'go version' end |
.hadoop ⇒ Object
22 23 24 |
# File 'lib/aspects/hadoop.rb', line 22 def self.hadoop [hadoophome, hadoopversion, hadoopcommand] end |
.hadoopcommand ⇒ Object
18 19 20 |
# File 'lib/aspects/hadoop.rb', line 18 def self.hadoopcommand 'hadoop version' end |
.hadoophome ⇒ Object
2 3 4 5 6 7 8 |
# 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 ⇒ Object
10 11 12 13 14 15 16 |
# 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 ⇒ Object
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).
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# 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 ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/aspects/haskell.rb', line 26 def self.haskell if Os.mac? [cabal, ghc] else [cabal, ghc, haskellplatform] end end |
.haskellplatform ⇒ Object
18 19 20 21 22 23 24 |
# 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 ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/aspects/hd.rb', line 2 def self.hd if Os.windows? 'fsutil fsinfo drives' else 'df -h' end end |
.ie ⇒ Object
2 3 4 5 6 |
# 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 ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# 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 ⇒ Object
6 7 8 |
# File 'lib/aspects/iojs.rb', line 6 def self.iojs [npm, iojs_v] end |
.iojs_v ⇒ Object
2 3 4 |
# File 'lib/aspects/iojs.rb', line 2 def self.iojs_v 'iojs --version' end |
.java ⇒ Object
34 35 36 |
# File 'lib/aspects/java.rb', line 34 def self.java [mvn, classpath, javahome, oakc, oak] end |
.javahome ⇒ Object
18 19 20 21 22 23 24 |
# 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 ⇒ Object
2 3 4 5 6 |
# File 'lib/aspects/kafka.rb', line 2 def self.kafka if Os.mac? [Package::brew('kafka')] end end |
.lacheck ⇒ Object
2 3 4 |
# File 'lib/aspects/lacheck.rb', line 2 def self.lacheck 'lacheck | grep lacheck.lex' end |
.latex ⇒ Object
2 3 4 5 6 |
# File 'lib/aspects/latex.rb', line 2 def self.latex if Os.unix? 'pdflatex --version' end end |
.ld ⇒ Object
2 3 4 |
# File 'lib/aspects/ld.rb', line 2 def self.ld 'ld -v' end |
.lein ⇒ Object
2 3 4 |
# File 'lib/aspects/clojure.rb', line 2 def self.lein 'lein --version' end |
.links ⇒ Object
2 3 4 |
# File 'lib/aspects/links.rb', line 2 def self.links 'links -version' end |
.lua ⇒ Object
2 3 4 |
# File 'lib/aspects/lua.rb', line 2 def self.lua 'lua -v' end |
.maven ⇒ Object
2 3 4 |
# File 'lib/aspects/java.rb', line 2 def self.maven mvn end |
.memcached ⇒ Object
2 3 4 |
# File 'lib/aspects/memcached.rb', line 2 def self.memcached 'echo version | nc localhost 11211' end |
.mvn ⇒ Object
6 7 8 |
# File 'lib/aspects/java.rb', line 6 def self.mvn 'mvn --version' end |
.net ⇒ Object
2 3 4 |
# 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 ⇒ Object
6 7 8 |
# File 'lib/aspects/node.rb', line 6 def self.node [npm, nodejs] end |
.nodejs ⇒ Object
2 3 4 |
# File 'lib/aspects/node.rb', line 2 def self.nodejs 'node --version' end |
.npm ⇒ Object
8 9 10 |
# File 'lib/aspects/npm.rb', line 8 def self.npm 'npm --version' end |
.oak ⇒ Object
26 27 28 |
# File 'lib/aspects/java.rb', line 26 def self.oak 'java -version' end |
.oakc ⇒ Object
30 31 32 |
# File 'lib/aspects/java.rb', line 30 def self.oakc 'javac -version' end |
.ocaml ⇒ Object
16 17 18 |
# File 'lib/aspects/ocaml.rb', line 16 def self.ocaml [ocamlc, opam] end |
.ocamlc ⇒ Object
8 9 10 |
# File 'lib/aspects/ocaml.rb', line 8 def self.ocamlc 'ocamlc -version' end |
.opam ⇒ Object
12 13 14 |
# File 'lib/aspects/ocaml.rb', line 12 def self.opam 'opam --version' end |
.openssl ⇒ Object
2 3 4 |
# File 'lib/aspects/openssl.rb', line 2 def self.openssl 'openssl version' end |
.opera ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# 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 ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# 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 ⇒ Object
2 3 4 |
# File 'lib/aspects/oz.rb', line 2 def self.oz 'ozc -v' end |
.pear ⇒ Object
2 3 4 |
# File 'lib/aspects/php.rb', line 2 def self.pear 'pear version' end |
.perl ⇒ Object
10 11 12 |
# File 'lib/aspects/perl.rb', line 10 def self.perl [cpan, pl] end |
.ph ⇒ Object
6 7 8 |
# File 'lib/aspects/php.rb', line 6 def self.ph 'php --version' end |
.php ⇒ Object
10 11 12 |
# File 'lib/aspects/php.rb', line 10 def self.php [pear, ph] end |
.pip ⇒ Object
8 9 10 |
# File 'lib/aspects/python.rb', line 8 def self.pip 'pip --version' end |
.pip3 ⇒ Object
8 9 10 |
# File 'lib/aspects/python3.rb', line 8 def self.pip3 'pip3 --version' end |
.pl ⇒ Object
6 7 8 |
# File 'lib/aspects/perl.rb', line 6 def self.pl 'perl --version' end |
.postgres ⇒ Object
6 7 8 |
# File 'lib/aspects/postgres.rb', line 6 def self.postgres 'psql --version' end |
.postgresql ⇒ Object
2 3 4 |
# File 'lib/aspects/postgres.rb', line 2 def self.postgresql 'psql --version' end |
.powershell ⇒ Object
2 3 4 5 6 |
# File 'lib/aspects/powershell.rb', line 2 def self.powershell if Os.windows? '@powershell Get-Host' end end |
.py ⇒ Object
12 13 14 |
# File 'lib/aspects/python.rb', line 12 def self.py 'python --version' end |
.py3 ⇒ Object
12 13 14 |
# File 'lib/aspects/python3.rb', line 12 def self.py3 'python3 --version' end |
.python ⇒ Object
16 17 18 |
# File 'lib/aspects/python.rb', line 16 def self.python [pip, py] end |
.python3 ⇒ Object
16 17 18 |
# File 'lib/aspects/python3.rb', line 16 def self.python3 [pip3, py3] end |
.ram ⇒ Object
2 3 4 5 6 7 8 9 10 |
# 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 ⇒ Object
174 175 176 |
# File 'lib/specs.rb', line 174 def self.rb 'ruby --version' end |
.rebar ⇒ Object
2 3 4 |
# File 'lib/aspects/erlang.rb', line 2 def self. 'rebar -V' end |
.redis ⇒ Object
10 11 12 13 14 15 16 17 18 |
# 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 ⇒ Object
2 3 4 |
# File 'lib/aspects/redis.rb', line 2 def self.redis_cli 'redis-cli --version' end |
.redis_server ⇒ Object
6 7 8 |
# File 'lib/aspects/redis.rb', line 6 def self.redis_server 'redis-server --version' end |
.ruby ⇒ Object
179 180 181 |
# File 'lib/specs.rb', line 179 def self.ruby [rubygems, rb] end |
.ruby1_8? ⇒ Boolean
154 155 156 |
# File 'lib/specs.rb', line 154 def self.ruby1_8? RUBY_VERSION =~ /^1\.8/ end |
.ruby1_9? ⇒ Boolean
159 160 161 |
# File 'lib/specs.rb', line 159 def self.ruby1_9? RUBY_VERSION =~ /^1\.9/ end |
.ruby2? ⇒ Boolean
164 165 166 |
# File 'lib/specs.rb', line 164 def self.ruby2? RUBY_VERSION =~ /^2/ end |
.ruby_v ⇒ Object
149 150 151 |
# File 'lib/specs.rb', line 149 def self.ruby_v RUBY_VERSION end |
.rubygems ⇒ Object
169 170 171 |
# File 'lib/specs.rb', line 169 def self.rubygems 'gem --version' end |
.safari ⇒ Object
2 3 4 5 6 |
# File 'lib/aspects/safari.rb', line 2 def self.safari if Os.mac? 'system_profiler SPApplicationsDataType | grep \'Safari:\' -A 2' end end |
.sbt ⇒ Object
6 7 8 |
# File 'lib/aspects/scala.rb', line 6 def self.sbt 'sbt sbt-version' end |
.scala ⇒ Object
10 11 12 |
# File 'lib/aspects/scala.rb', line 10 def self.scala [sbt, scalac] end |
.scalac ⇒ Object
2 3 4 |
# File 'lib/aspects/scala.rb', line 2 def self.scalac 'scalac -version' end |
.shell ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/aspects/shell.rb', line 2 def self.shell if Os.windows? 'echo %cmdextversion%' elsif Os.unix? 'sh --version' end end |
.splint ⇒ Object
2 3 4 |
# File 'lib/aspects/splint.rb', line 2 def self.splint 'splint -help version' end |
.ssh ⇒ Object
2 3 4 |
# File 'lib/aspects/ssh.rb', line 2 def self.ssh 'ssh -V' end |
.ssl ⇒ Object
2 3 4 |
# File 'lib/aspects/ssl.rb', line 2 def self.ssl 'openssl version' end |
.tap ⇒ Object
2 3 4 |
# File 'lib/aspects/tap.rb', line 2 def self.tap 'tap --version' end |
.terminal ⇒ Object
2 3 4 5 6 |
# 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 ⇒ Object
2 3 4 |
# File 'lib/aspects/thrift.rb', line 2 def self.thrift 'thrift -version' end |
.thunderbolt ⇒ Object
2 3 4 5 6 |
# File 'lib/aspects/thunderbolt.rb', line 2 def self.thunderbolt if Os.mac? 'system_profiler | grep \'Thunderbolt Version\' | head -n 1' end end |
.virtualbox ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# 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 |