def save_as(project_path, name, shared = true)
      scheme_folder_path = if shared
                             self.class.shared_data_dir(project_path)
                           else
                             self.class.user_data_dir(project_path)
                           end
      scheme_folder_path.mkpath
      scheme_path = scheme_folder_path + "#{name}.xcscheme"
      @file_path = scheme_path
      File.open(scheme_path, 'w') do |f|
        f.write(to_s)
      end
    end
def save_as(project_path, name, shared = true)
      scheme_folder_path = if shared
                             self.class.shared_data_dir(project_path)
                           else
                             self.class.user_data_dir(project_path)
                           end
      scheme_folder_path.mkpath
      scheme_path = scheme_folder_path + "#{name}.xcscheme"
      @file_path = scheme_path
      File.open(scheme_path, 'w') do |f|
        f.write(to_s)
      end
    end
Serializes the current state of the object to a ".xcscheme" file.

 @param [String, Pathname] project_path
        The path where the ".xcscheme" file should be stored.

 @param [String] name
        The name of the scheme, to have ".xcscheme" appended.

 @param [Boolean] shared
        true  => if the scheme must be a shared scheme (default value)
        false => if the scheme must be a user scheme

 @return [void]

 @example Saving a scheme
   scheme.save_as('path/to/Project.xcodeproj') #=> true