Sha256: c3421bf3ef6d954a53e99728d27280656e9ab73f2c2f26e563cfe9a9a5c0694e

Contents?: true

Size: 771 Bytes

Versions: 45

Compression:

Stored size: 771 Bytes

Contents

require 'set'

module Fig; end

# Data about a package within the current working directory.
class Fig::WorkingDirectoryMetadata
  attr_reader   :package_name, :current_version

  def initialize(package_name, current_version = nil)
    @package_name    = package_name
    @retrieved       = false

    reset_with_version(current_version)
  end

  def reset_with_version(new_version)
    @current_version = new_version
    @files           = Set.new

    return
  end

  def add_file(file)
    @files << file

    return
  end

  def mark_as_retrieved()
    @retrieved = true

    return
  end

  def retrieved?()
    return @retrieved
  end

  # So we don't have to expose the files collection.
  def each_file()
    @files.each {|file| yield file}

    return
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
fig-1.23.0 lib/fig/working_directory_metadata.rb
fig-1.22.1.beta.1 lib/fig/working_directory_metadata.rb
fig-1.22.0 lib/fig/working_directory_metadata.rb
fig-1.21.1.beta.2 lib/fig/working_directory_metadata.rb
fig-1.21.1.beta.1 lib/fig/working_directory_metadata.rb
fig-1.21.0 lib/fig/working_directory_metadata.rb
fig-1.20.1.beta.1 lib/fig/working_directory_metadata.rb
fig-1.20.0 lib/fig/working_directory_metadata.rb
fig-1.19.0 lib/fig/working_directory_metadata.rb
fig-1.18.0 lib/fig/working_directory_metadata.rb
fig-1.17.0 lib/fig/working_directory_metadata.rb
fig-1.16.1.beta.1 lib/fig/working_directory_metadata.rb
fig-1.16.0 lib/fig/working_directory_metadata.rb
fig-1.15.1.beta.2 lib/fig/working_directory_metadata.rb
fig-1.15.1.beta.1 lib/fig/working_directory_metadata.rb
fig-1.15.0 lib/fig/working_directory_metadata.rb
fig-1.14.0 lib/fig/working_directory_metadata.rb
fig-1.13.0 lib/fig/working_directory_metadata.rb
fig-1.12.0 lib/fig/working_directory_metadata.rb
fig-1.11.0 lib/fig/working_directory_metadata.rb