Class: ScoutApm::Utils::InstalledGems
- Inherits:
-
Object
- Object
- ScoutApm::Utils::InstalledGems
- Defined in:
- lib/scout_apm/utils/installed_gems.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(logger = ScoutApm::Agent.instance.logger) ⇒ InstalledGems
constructor
A new instance of InstalledGems.
- #run ⇒ Object
Constructor Details
#initialize(logger = ScoutApm::Agent.instance.logger) ⇒ InstalledGems
Returns a new instance of InstalledGems.
6 7 8 |
# File 'lib/scout_apm/utils/installed_gems.rb', line 6 def initialize(logger=ScoutApm::Agent.instance.logger) @logger = logger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/scout_apm/utils/installed_gems.rb', line 4 def logger @logger end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 |
# File 'lib/scout_apm/utils/installed_gems.rb', line 10 def run Bundler.rubygems.all_specs.map {|spec| [spec.name, spec.version.to_s] } rescue => e logger.warn("Couldn't fetch Gem information: #{e.}") [] end |