module PTTool::Helper

Module for helper functions.

Public Class Methods

add_membership(project, person, role = 'member') click to toggle source
# File lib/pttool/helper.rb, line 13
def self.add_membership(project, person, role = 'member')
  project.add_membership(person_id: person.id, role: role)
end
prompt(msg = 'Do you want to continue?') click to toggle source
# File lib/pttool/helper.rb, line 6
def self.prompt(msg = 'Do you want to continue?')
  print("#{msg} [(y)es|(N)o|(a)bort] ")
  response = STDIN.gets.strip.downcase
  raise Error, 'aborted' if %w(a abort).include?(response)
  %w(y yes true 1).include?(response)
end