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.10.0 lib/fig/working_directory_metadata.rb
fig-1.9.0 lib/fig/working_directory_metadata.rb
fig-1.8.0 lib/fig/working_directory_metadata.rb
fig-1.7.0 lib/fig/working_directory_metadata.rb
fig-1.6.0 lib/fig/working_directory_metadata.rb
fig-1.5.0 lib/fig/working_directory_metadata.rb
fig-1.4.0 lib/fig/working_directory_metadata.rb
fig-1.3.0 lib/fig/working_directory_metadata.rb
fig-1.2.0 lib/fig/working_directory_metadata.rb
fig-1.1.0 lib/fig/working_directory_metadata.rb
fig-1.0.0 lib/fig/working_directory_metadata.rb
fig-0.2.5 lib/fig/working_directory_metadata.rb
fig-0.2.3 lib/fig/working_directory_metadata.rb
fig-0.2.1 lib/fig/working_directory_metadata.rb
fig-0.1.81 lib/fig/working_directory_metadata.rb
fig-0.1.79 lib/fig/working_directory_metadata.rb
fig-0.1.77 lib/fig/working_directory_metadata.rb
fig-0.1.76 lib/fig/working_directory_metadata.rb
fig-0.1.75 lib/fig/working_directory_metadata.rb
fig-0.1.73 lib/fig/working_directory_metadata.rb