Change 'create' terminology to 'compose', as that makes more sense.

This commit is contained in:
Eric Budd 2018-01-30 22:50:50 -05:00
parent 4631157712
commit b847d63bd5
1 changed files with 11 additions and 11 deletions

22
iris.rb
View File

@ -277,12 +277,12 @@ class Display
end end
class Interface class Interface
ONE_SHOTS = %w{help topics create quit freshen reply} ONE_SHOTS = %w{help topics compose quit freshen reply}
CMD_MAP = { CMD_MAP = {
't' => 'topics', 't' => 'topics',
'topics' => 'topics', 'topics' => 'topics',
'c' => 'create', 'c' => 'compose',
'create' => 'create', 'compose' => 'compose',
'h' => 'help', 'h' => 'help',
'?' => 'help', '?' => 'help',
'help' => 'help', 'help' => 'help',
@ -348,7 +348,7 @@ class Interface
nil nil
end end
def creating_handler(line) def composing_handler(line)
if line !~ /^\.$/ if line !~ /^\.$/
if @text_buffer.empty? if @text_buffer.empty?
@text_buffer = line @text_buffer = line
@ -369,9 +369,9 @@ class Interface
end end
def handle(line) def handle(line)
return browsing_handler(line) if @mode == :browsing return browsing_handler(line) if @mode == :browsing
return creating_handler(line) if @mode == :creating return composing_handler(line) if @mode == :composing
return replying_handler(line) if @mode == :replying return replying_handler(line) if @mode == :replying
end end
def show_topic(num) def show_topic(num)
@ -394,7 +394,7 @@ class Interface
end end
def prompt def prompt
return 'new~> ' if @mode == :creating return 'new~> ' if @mode == :composing
return 'reply~> ' if @mode == :replying return 'reply~> ' if @mode == :replying
"#{Config::AUTHOR}~> " "#{Config::AUTHOR}~> "
end end
@ -410,8 +410,8 @@ class Interface
end end
end end
def create def compose
@mode = :creating @mode = :composing
@text_buffer = '' @text_buffer = ''
puts 'Writing a new topic. Type a period on a line by itself to end message.' puts 'Writing a new topic. Type a period on a line by itself to end message.'
end end
@ -430,7 +430,7 @@ class Interface
puts 'help, h, ? - Display this text' puts 'help, h, ? - Display this text'
puts 'topics, t - List all topics' puts 'topics, t - List all topics'
puts '# (topic id) - Read specified topic' puts '# (topic id) - Read specified topic'
puts 'create, c - Add a new topic' puts 'compose, c - Add a new topic'
puts 'reply #, r # - Reply to a specific topic' puts 'reply #, r # - Reply to a specific topic'
puts 'freshen, f - Reload to get any new messages' puts 'freshen, f - Reload to get any new messages'
puts puts