class Steep::Project::Options

def collection_lock

def collection_lock
  case config = load_collection_lock()
  when RBS::Collection::Config::Lockfile
    config
  else
    nil
  end
end

def collection_lock_path

def collection_lock_path
  if collection_config_path
    RBS::Collection::Config.to_lockfile_path(collection_config_path)
  end
end

def initialize

def initialize
  @paths = PathOptions.new(repo_paths: [])
  @libraries = []
end

def load_collection_lock(force: false)

def load_collection_lock(force: false)
  @collection_lock = nil if force
  @collection_lock ||=
    if collection_config_path && collection_lock_path
      case
      when !collection_config_path.file?
        collection_config_path
      when !collection_lock_path.file?
        collection_lock_path
      else
        begin
          content = YAML.load_file(collection_lock_path)
          lock_file = RBS::Collection::Config::Lockfile.from_lockfile(lockfile_path: collection_lock_path, data: content)
          lock_file.check_rbs_availability!
          lock_file
        rescue YAML::SyntaxError, RBS::Collection::Config::CollectionNotAvailable => exn
          exn
        end
      end
    end
end