#ExStart:
require 'aspose_tasks_cloud'

class Calendar

  include AsposeTasksCloud
  include AsposeStorageCloud

  def initialize
    #Get App key and App SID from https://cloud.aspose.com
    AsposeApp.app_key_and_sid("APP_KEY", "APP_SID")
    @tasks_api = TasksApi.new
  end

  def upload_file(file_name)
    @storage_api = StorageApi.new 
    response = @storage_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
  end

  def get_critical_path
    file_name = "sample-project.mpp"
    upload_file(file_name)

    response = @tasks_api.get_critical_path(file_name)
  end

end

calendar = Calendar.new()
puts calendar.get_critical_path
#ExEnd: