TIL, 2017-10-10 Studying tj/pomo
Studying tj/pomo
:
RbConfig::CONFIG
to see compile time properties of the current Ruby implementation.- In my Mac,
RbConfig::CONFIG['host_os']
isdarwin15.5.0
. (/mac|darwin/ =~ RbConfig::CONFIG['host_os'])
returns 0, since this is the index where the first match was found. If nothing was found, returnnil
./usr/bin/sw_vers -productVersion
to see what Mac OS version you have.sw_vers
works too.terminal_notifier
I think is better thangrowl
.- Creating a YAML file from a variable:
File.open('yamlfile.yml', 'w') do |file| file.write({'haha' => [1, 2, 3] }.to_yaml) end
(the ‘w’ file) - Ruby Marshaling: Just a way to serialize and reconstruct a Ruby object.