Class: GemBench::Scout
- Inherits:
-
Object
- Object
- GemBench::Scout
- Defined in:
- lib/gem_bench/scout.rb
Instance Attribute Summary collapse
-
#gem_paths ⇒ Object
readonly
Returns the value of attribute gem_paths.
-
#gemfile_lines ⇒ Object
readonly
Returns the value of attribute gemfile_lines.
-
#gemfile_path ⇒ Object
readonly
Returns the value of attribute gemfile_path.
-
#gemfile_trash ⇒ Object
readonly
Returns the value of attribute gemfile_trash.
-
#loaded_gems ⇒ Object
readonly
Returns the value of attribute loaded_gems.
Instance Method Summary collapse
- #check_gemfile? ⇒ Boolean
-
#initialize(check_gemfile: nil) ⇒ Scout
constructor
A new instance of Scout.
Constructor Details
#initialize(check_gemfile: nil) ⇒ Scout
Returns a new instance of Scout.
7 8 9 10 11 12 13 14 |
# File 'lib/gem_bench/scout.rb', line 7 def initialize(check_gemfile: nil) @check_gemfile = check_gemfile.nil? ? true : check_gemfile @gemfile_path = "#{Dir.pwd}/Gemfile" gem_lookup_paths_from_bundler gem_lines_from_gemfile # Gem.loaded_specs are the gems that have been loaded / required. @loaded_gems = Gem.loaded_specs.values.map { |x| [x.name, x.version.to_s] } end |
Instance Attribute Details
#gem_paths ⇒ Object (readonly)
Returns the value of attribute gem_paths.
5 6 7 |
# File 'lib/gem_bench/scout.rb', line 5 def gem_paths @gem_paths end |
#gemfile_lines ⇒ Object (readonly)
Returns the value of attribute gemfile_lines.
5 6 7 |
# File 'lib/gem_bench/scout.rb', line 5 def gemfile_lines @gemfile_lines end |
#gemfile_path ⇒ Object (readonly)
Returns the value of attribute gemfile_path.
5 6 7 |
# File 'lib/gem_bench/scout.rb', line 5 def gemfile_path @gemfile_path end |
#gemfile_trash ⇒ Object (readonly)
Returns the value of attribute gemfile_trash.
5 6 7 |
# File 'lib/gem_bench/scout.rb', line 5 def gemfile_trash @gemfile_trash end |
#loaded_gems ⇒ Object (readonly)
Returns the value of attribute loaded_gems.
5 6 7 |
# File 'lib/gem_bench/scout.rb', line 5 def loaded_gems @loaded_gems end |
Instance Method Details
#check_gemfile? ⇒ Boolean
16 17 18 |
# File 'lib/gem_bench/scout.rb', line 16 def check_gemfile? @check_gemfile end |