lib/controllers/new.rb in evertils-0.3.1.3 vs lib/controllers/new.rb in evertils-0.3.2
- old
+ new
@@ -6,11 +6,11 @@
def pre_exec
# all methods require internet to make API calls
@methods_require_internet.push(:daily, :weekly, :monthly)
@title = "Evertils - Custom Note"
-
+
# command flag parser
OptionParser.new do |opt|
opt.banner = "#{Evertils::PACKAGE_NAME} new note [...-flags]"
opt.on("-t", "--title=TITLE", "Set a custom title") do |title|
@@ -52,11 +52,11 @@
message = message.gsub!("\n", '<br />')
else
message = @body
end
- note = @model.create_note(@title, message, @notebook, @file, false, @created_on)
+ note = @model.create_note(title: @title, body: message, parent_notebook: @notebook, files: @file, shareable: false, created_on: @created_on)
if note[:note]
Notify.success("Note created")
else
Notify.error("Unable to create note, are you authenticated?")
@@ -72,11 +72,11 @@
message = @body
end
# Prefix title to indicate it's shared status
@title = "[SHARED] #{@title}"
-
- note = @model.create_note(@title, message, @notebook, @file, true, @created_on)
+
+ note = @model.create_note(title: @title, body: message, parent_notebook: @notebook, files: @file, shareable: true, created_on: @created_on)
if note[:share_url]
Notify.success("Note created and shared:\n#{note[:share_url]}")
else
Notify.error("Something dreadful happened!")