wrapped mining scripts inside Rails framework