From 05f47d4bd04624d80347a0453565fb70d88b243a Mon Sep 17 00:00:00 2001 From: Jaiden Mispy Date: Mon, 2 Nov 2015 17:10:30 -0800 Subject: [PATCH] Make model dir on consume if not exist Fixes #93 --- bin/ebooks | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/ebooks b/bin/ebooks index 9ce5a53..e4cdb30 100755 --- a/bin/ebooks +++ b/bin/ebooks @@ -93,7 +93,9 @@ STR filename = File.basename(path) shortname = filename.split('.')[0..-2].join('.') + FileUtils.mkdir_p(File.join(APP_PATH, 'model')) outpath = File.join(APP_PATH, 'model', "#{shortname}.model") + Ebooks::Model.consume(path).save(outpath) log "Corpus consumed to #{outpath}" end @@ -120,7 +122,7 @@ STR HELP.append = <<-STR Usage: ebooks append - Process then append the provided corpus to the model + Process then append the provided corpus to the model instead of overwriting. STR @@ -133,7 +135,7 @@ STR Ebooks::Model.consume(path).append(File.join(APP_PATH,'model',"#{name}.model")) log "Corpus appended to #{name}.model" end - + HELP.jsonify = <<-STR Usage: ebooks jsonify [tweets.csv2] [...] @@ -300,7 +302,7 @@ STR Shows you twitter_ebooks' version number. STR - + def self.version require File.expand_path('../../lib/twitter_ebooks/version', __FILE__) log Ebooks::VERSION