function ruby scripts