More Cloudinary work

Move Cloudinary require/calls to boodoo.rb
Add upload_archive, upload_model, fetch_archive, fetch_model
rename get_archive! to update_archive!

TODO:
 - Learn how to load model from content instead of File.open
 - Come up with sensible check/update logic
This commit is contained in:
Joel McCoy
2015-01-21 16:03:50 -05:00
parent 1576d83577
commit 9e584382f1
2 changed files with 49 additions and 9 deletions

View File

@@ -1,14 +1,12 @@
require 'twitter_ebooks'
require_relative 'boodoo'
require 'dotenv'
require 'cloudinary'
include Ebooks::Boodoo
# Read defaults and lay env vars on top:
SETTINGS = Dotenv.load('secrets.env').merge(ENV)
# Information about a particular Twitter user we know
class UserInfo
attr_reader :username
@@ -68,7 +66,7 @@ class BoodooBot
@model_path = "model/#{@original}.model"
if can_run?
get_archive!
update_archive!
make_model!
else
missing_fields.each {|missing|
@@ -105,7 +103,7 @@ class BoodooBot
scheduler.interval @refresh_model_interval do
log "Refreshing archive/model..."
get_archive!
update_archive!
make_model!
end
end