lib/rbnotes/commands/update.rb in rbnotes-0.4.5 vs lib/rbnotes/commands/update.rb in rbnotes-0.4.6
- old
+ new
@@ -16,11 +16,10 @@
#
# The editor program will be searched as same as add command. If
# none of editors is available, the execution fails.
class Update < Command
- include ::Rbnotes::Utils
def description # :nodoc:
"Update the content of a note"
end
@@ -42,21 +41,21 @@
args.unshift(arg)
break
end
end
- target_stamp = Rbnotes::Utils.read_timestamp(args)
- editor = find_editor(conf[:editor])
+ target_stamp = Rbnotes.utils.read_timestamp(args)
+ editor = Rbnotes.utils.find_editor(conf[:editor])
repo = Textrepo.init(conf)
text = nil
begin
text = repo.read(target_stamp)
rescue Textrepo::MissingTimestampError => _
raise Rbnotes::MissingTimestampError, target_stamp
end
- tmpfile = run_with_tmpfile(editor, target_stamp.to_s, text)
+ tmpfile = Rbnotes.utils.run_with_tmpfile(editor, target_stamp.to_s, text)
text = File.readlines(tmpfile, :chomp => true)
unless text.empty?
keep = @opts[:keep_timestamp] || false
newstamp = nil