Guest User

Untitled

a guest
Jan 2nd, 2018
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. require "harvested"
  2. require "pry"
  3.  
  4. subdomain = 'testcompanyname1'
  5. username = 'happyminded@mailinator.com'
  6. password = 'harvest2017'
  7.  
  8. harvest = Harvest.hardy_client(subdomain: subdomain, username: username, password: password)
  9.  
  10. puts "Clients Name?"
  11. cname = gets.chomp
  12. client = Harvest::Client.new(name: cname)
  13. client = harvest.clients.create(client)
  14. puts "\nClient created!\n"
  15. puts "Please enter the project name:"
  16. project_name = gets.chomp
  17. puts "\nIs this project billable? (y/n)"
  18. billable = gets.chomp.downcase == "y"
  19. puts "\nAny project notes? (hit 'return' for none)"
  20. notes = gets.chomp
  21. puts "Creating new project: \"#{project_name}\" for client: #{client.name}\n"
  22. project = Harvest::Project.new(name: project_name, client_id: client.id, billable: billable, notes: notes)
  23. project = harvest.projects.create(project)
  24. #harvest.projects.all # list out projects
Add Comment
Please, Sign In to add comment