forked from moviepilot/zuck
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole
More file actions
executable file
·32 lines (26 loc) · 702 Bytes
/
console
File metadata and controls
executable file
·32 lines (26 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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("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