Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 33 lines (26 sloc) 707 Bytes
#!/usr/bin/env ruby
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
require 'bundler'
Bundler.require
require 'pry'
require 'zuck'
def reload!
Zuck.graph = Koala::Facebook::API.new(File.read("test_access_token"))
@loaded_files ||= {}
count = 0
Dir['./lib/**/*.rb'].each do |file|
mtime = File.stat(file).mtime
if !@loaded_files.has_key?(file) or mtime > @loaded_files[file]
STDERR.puts "mtime for #{file} changed, reloading"
load file
@loaded_files[file] = mtime
count += 1
end
end
"reloaded #{count} files"
end
def graph
Zuck.graph
end
Zuck.graph = Koala::Facebook::API.new(File.read("test_access_token"))
binding.pry