Linked List

A personal knowledge base

Ruby

#Build Older Ruby on Arch Linux

Install openssl-1.0, then build ruby:

curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig RUBY_CFLAGS="-I/usr/include/openssl-1.0" RUBY_LDFLAGS="-L/usr/lib/openssl-1.0" rbenv install -v --patch 2.2.1

Sources: ruby-build and an Arch forum post.

#Run Specs That Have Been Modified

rspec `git ls-files -m \*_spec.rb`

#Run Specs Corresponding to a Particular Type

ag -lG _spec.rb$ . spec | grep course

In this example Type is, ‘course’.

#Show Configure Arguments Ruby was Built With

ruby -r rbconfig -e 'puts RbConfig::CONFIG["configure_args"]'

Sample Output:

 '--prefix=/Users/wmoore/.rbenv/versions/2.1.5' '--with-openssl-dir=/usr/local/opt/openssl' '--with-readline-dir=/usr/local/opt/readline' 'CC=clang' 'CFLAGS= -O3 -Wno-error=shorten-64-to-32 ' 'LDFLAGS=-L/Users/wmoore/.rbenv/versions/2.1.5/lib ' 'CPPFLAGS=-I/Users/wmoore/.rbenv/versions/2.1.5/include '
Last modified: 30 Apr 2017