Skip to content

Instantly share code, notes, and snippets.

@edivandecastro
Created August 22, 2012 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edivandecastro/3425523 to your computer and use it in GitHub Desktop.
Save edivandecastro/3425523 to your computer and use it in GitHub Desktop.
require 'celluloid'
class FilePutter
include Celluloid
def initialize(filename)
@filename = filename
end
def load_file
@file_contents = File.read @filename
end
def print
p @file_contents
end
end
files = ["/home/cti/edivansoares/celluloid/kernel.log", "/home/cti/edivansoares/celluloid/system.log", "/home/cti/edivansoares/celluloid/ppp.log", "/home/cti/edivansoares/celluloid/secure.log"]
files.each do |file|
fp = FilePutter.new file
fp.load_file_and_print!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment