lib/controllers/generate.rb in evertils-0.1.14 vs lib/controllers/generate.rb in evertils-0.1.15
- old
+ new
@@ -7,11 +7,11 @@
begin
# interface with the Evernote API so we can use it later
@model = Granify::Helper.load('evernote')
# all methods require internet to make API calls
- @methods_require_internet.push(:daily, :weekly, :monthly)
+ @methods_require_internet.push(:daily, :weekly, :monthly, :deployment)
# user = @model.user
# Notify.success("Welcome, #{user.name} (#{user.username})")
rescue ::Evernote::EDAM::Error::EDAMSystemException => e
Notify.error("Evernote.authenticate error\n#{e.message} (#{e.errorCode})")
@@ -26,9 +26,23 @@
@force = true
end
end.parse!
super
+ end
+
+ def deployment
+ if STDIN.tty?
+ Notify.error("This command relies on piped data to generate note data")
+ end
+
+ if !@force
+ if @model.note_exists
+ Notify.error("There's already a log for today!")
+ end
+ end
+
+ @model.create_deployment_note
end
# generate daily notes
def daily
if !@force
\ No newline at end of file