1. alias for ‘.call‘
2. Disabling (SSL) Certificate Check from all Gems or Ruby Libraries.
i. Do this only on your local or development environment.
ii. Also the above code only work if the libraries or gem uses ‘Net::HTTP’ API internally,
iii. Tested with HTTParty,Faraday,RestClient not working with Excon (so Excon adapter over Faraday might not work as well).
Locks or unlocks a file according to locking_constant (a logical or of the values in the table below). Returns
File::LOCK_NB is specified and the operation would otherwise have blocked. Not available on all platforms.
Locking constants (in class File):
LOCK_EX - Exclusive lock. Only one process may hold an exclusive lock for a given file at a time. LOCK_NBL - Don't block when locking. May be combined with other lock options using logical or. LOCK_SH - Shared lock. Multiple processes may each hold a shared lock for a given file at the same time. LOCK_UN - Unlock.
open(file,'w+') do |file| ## lock the file so that no one can use it. file.flock(File::LOCK_EX) read(file_name).each do |row| file.puts jsonify(row) end end
Follow me on Twitter