Class: Autotype::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/autotype/profile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



26
27
28
# File 'lib/autotype/profile.rb', line 26

def initialize
  @config_path = ENV["AUTOTYPE_CONFIG"]
end

Instance Attribute Details

#config_pathObject

Returns the value of attribute config_path.



24
25
26
# File 'lib/autotype/profile.rb', line 24

def config_path
  @config_path
end

Instance Method Details

#load_profileObject



34
35
36
37
38
39
# File 'lib/autotype/profile.rb', line 34

def load_profile
  return @profile if defined?(@profile) && @profile

  path = config_path || DiscoveryProfile.find
  @profile = path ? DiscoveryProfile.load_overrides(path) : DiscoveryProfile.new
end

#reload_profile!Object



41
42
43
44
# File 'lib/autotype/profile.rb', line 41

def reload_profile!
  remove_instance_variable(:@profile) if defined?(@profile)
  load_profile
end

#skipped_filesObject



30
31
32
# File 'lib/autotype/profile.rb', line 30

def skipped_files
  load_profile.skipped_files
end