Module: GHI::CLI::FileHelper
- Included in:
- Executable
- Defined in:
- lib/ghi/cli.rb
Instance Method Summary collapse
- #delete_message ⇒ Object
- #gets_from_editor(issue) ⇒ Object
- #launch_editor(file) ⇒ Object
- #message_path ⇒ Object
Instance Method Details
#delete_message ⇒ Object
35 36 37 38 39 |
# File 'lib/ghi/cli.rb', line 35 def File.delete rescue Errno::ENOENT, TypeError nil end |
#gets_from_editor(issue) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ghi/cli.rb', line 19 def gets_from_editor(issue) if windows? warn "Please supply the message with the -m option" exit 1 end if in_repo? File.open , "a+", &file_proc(issue) else Tempfile.open , &file_proc(issue) end return @message if comment? return @message.shift.strip, @message.join.sub(/\b\n\b/, " ").strip end |
#launch_editor(file) ⇒ Object
15 16 17 |
# File 'lib/ghi/cli.rb', line 15 def launch_editor(file) system "#{editor} #{file.path}" end |
#message_path ⇒ Object
41 42 43 |
# File 'lib/ghi/cli.rb', line 41 def File.join gitdir, end |