Class: ErrorToCommunicate::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/error_to_communicate/project.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Project

Returns a new instance of Project.



23
24
25
# File 'lib/error_to_communicate/project.rb', line 23

def initialize(attributes={})
  attributes.each { |name, value| __send__ :"#{name}=", value }
end

Instance Attribute Details

#rootObject

Things this should possibly deal with? Gemfile?

what gems are in it?
what load paths do these make available?

directory structure

what paths are in the lib?
what dirs are in the lib?

home_dir available_gems common_gems (maybe they meant to require something from a common gem) $LOAD_PATH

What all is in it? Is a dir misspelled?


21
22
23
# File 'lib/error_to_communicate/project.rb', line 21

def root
  @root
end

#rubygems_dirObject



40
41
42
# File 'lib/error_to_communicate/project.rb', line 40

def rubygems_dir
  @rubygems_dir ||= self.class.find_rubygems_dir(loaded_features)
end

Class Method Details

.find_rubygems_dir(loaded_features) ⇒ Object



3
4
5
6
# File 'lib/error_to_communicate/project.rb', line 3

def self.find_rubygems_dir(loaded_features)
  dir = loaded_features.grep(/\/rubygems\/specification.rb/).first
  dir && File.dirname(dir)
end

Instance Method Details

#loaded_featuresObject



31
32
33
# File 'lib/error_to_communicate/project.rb', line 31

def loaded_features
  @loaded_features ||= []
end

#loaded_features=(loaded_features) ⇒ Object



35
36
37
# File 'lib/error_to_communicate/project.rb', line 35

def loaded_features=(loaded_features)
  @loaded_features = loaded_features
end

#rubygems?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/error_to_communicate/project.rb', line 27

def rubygems?
  !rubygems_dir
end