The easiest way to do this is perhaps to use IRB or PRY to get a local copy of the file, or write a simple script to load, edit, and download it later. Suppose you have a file called data.txt.
You can use the following script to initialize a connection to S3.
require 'fog'
connection = Fog::Storage.new({
:provider => 'AWS',
:aws_secret_access_key => YOUR_SECRET_ACCESS_KEY,
:aws_access_key_id => YOUR_SECRET_ACCESS_KEY_ID
})
directory = connection.directories.get("all-my-data")
, .
local_file = File.open("/path/to/my/data.txt", "w")
file = directory.files.get('data.txt')
local_file.write(file.body)
local_file.close
, , S3.
file = directory.files.get('data.txt')
file.body = File.open("/path/to/my/data.txt")
file.save