@vinay, that is my sample code
Contents represents the contents of source file. File.read is reading the contents of source_file and putting it into contents. Those contents are then pushed to the device through Appium.
If you were using adb directly rather than going through Appium, you would just use "adb push source_file path_on_device". Since Appium's server might not be on the same machine as the client, we "push" the file to the server, which then writes it to a file and uses adb push to move the file to the device.
This example is in Ruby, which may cause you problems if you are using another language and trying to use these ruby calls.