Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "harvested"
- require "pry"
- subdomain = 'testcompanyname1'
- username = 'happyminded@mailinator.com'
- password = 'harvest2017'
- harvest = Harvest.hardy_client(subdomain: subdomain, username: username, password: password)
- puts "Clients Name?"
- cname = gets.chomp
- client = Harvest::Client.new(name: cname)
- client = harvest.clients.create(client)
- puts "\nClient created!\n"
- puts "Please enter the project name:"
- project_name = gets.chomp
- puts "\nIs this project billable? (y/n)"
- billable = gets.chomp.downcase == "y"
- puts "\nAny project notes? (hit 'return' for none)"
- notes = gets.chomp
- puts "Creating new project: \"#{project_name}\" for client: #{client.name}\n"
- project = Harvest::Project.new(name: project_name, client_id: client.id, billable: billable, notes: notes)
- project = harvest.projects.create(project)
- #harvest.projects.all # list out projects
Add Comment
Please, Sign In to add comment