Class: Gotta::Project

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/gotta/mod/project.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Project

Returns a new instance of Project.



12
13
14
15
16
17
18
19
20
21
# File 'lib/gotta/mod/project.rb', line 12

def initialize(dir)
  @dir = dir
  @config_file_path = "#{dir}/project.yml"
  @config = read_config
  @config["project"]["mods_dir"] ||= "mods"
  @config["project"]["components_dir"] ||= @config["project"]["functions_dir"] || "components"
  @config["project"]["public_dir"] ||= "public"
  check_mods_dir
  super(@config['project'])
end

Class Attribute Details

.configObject

Returns the value of attribute config.



8
9
10
# File 'lib/gotta/mod/project.rb', line 8

def config
  @config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/gotta/mod/project.rb', line 11

def config
  @config
end

#config_file_pathObject (readonly)

Returns the value of attribute config_file_path.



11
12
13
# File 'lib/gotta/mod/project.rb', line 11

def config_file_path
  @config_file_path
end

#dirObject (readonly)

Returns the value of attribute dir.



11
12
13
# File 'lib/gotta/mod/project.rb', line 11

def dir
  @dir
end