Class: Rails::Hyperdrive::BundlerArtifactDiscovery::Report

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails/hyperdrive/bundler_artifact_discovery.rb

Overview

Everything one discovery walk collects, passed in so a caller reads back only what it needs. skips is the subset of warnings that dropped shipped content; everything else is advisory and installed. bundled_gems and skipped_gems report the walk itself: every gem seen, and every gem that lost at least one artifact to a hard skip.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kw) ⇒ Report

Returns a new instance of Report.



43
44
45
46
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 43

def initialize(**kw)
  super(**{ warnings: [], skips: [], notices: [], fence_warnings: [],
            bundled_gems: [], skipped_gems: [] }.merge(kw))
end

Instance Attribute Details

#bundled_gemsObject

Returns the value of attribute bundled_gems

Returns:

  • (Object)

    the current value of bundled_gems



41
42
43
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 41

def bundled_gems
  @bundled_gems
end

#fence_warningsObject

Returns the value of attribute fence_warnings

Returns:

  • (Object)

    the current value of fence_warnings



41
42
43
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 41

def fence_warnings
  @fence_warnings
end

#noticesObject

Returns the value of attribute notices

Returns:

  • (Object)

    the current value of notices



41
42
43
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 41

def notices
  @notices
end

#skipped_gemsObject

Returns the value of attribute skipped_gems

Returns:

  • (Object)

    the current value of skipped_gems



41
42
43
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 41

def skipped_gems
  @skipped_gems
end

#skipsObject

Returns the value of attribute skips

Returns:

  • (Object)

    the current value of skips



41
42
43
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 41

def skips
  @skips
end

#warningsObject

Returns the value of attribute warnings

Returns:

  • (Object)

    the current value of warnings



41
42
43
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 41

def warnings
  @warnings
end

Instance Method Details

#advisoriesObject



64
65
66
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 64

def advisories
  warnings - skips
end

#fence(message) ⇒ Object

Version-fence skips are also carried on their own, for surfaces that print nothing else about discovery.



59
60
61
62
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 59

def fence(message)
  skip(message)
  fence_warnings << message
end

#mark_skipped_gem(name) ⇒ Object



68
69
70
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 68

def mark_skipped_gem(name)
  skipped_gems << name unless skipped_gems.include?(name)
end

#skip(message) ⇒ Object



52
53
54
55
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 52

def skip(message)
  warnings << message
  skips << message
end

#warn(message) ⇒ Object



48
49
50
# File 'lib/rails/hyperdrive/bundler_artifact_discovery.rb', line 48

def warn(message)
  warnings << message
end