Class: Arfy::Environment::EnvWorkdirConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/arfy/environment.rb

Instance Method Summary collapse

Instance Method Details

#config_pathObject



22
23
24
# File 'lib/arfy/environment.rb', line 22

def config_path
  ENV["db/config"] || "config"
end

#configuration_dataObject



7
8
9
10
11
12
13
14
15
# File 'lib/arfy/environment.rb', line 7

def configuration_data
  return @data unless @data.nil?

  @data = {"db" => {}, "config" => {}}
  if File.exists? ".arfy"
    @data = YAML.load( IO.read(".arfy") )
  end
  @data
end

#database_config_pathObject



26
27
28
29
# File 'lib/arfy/environment.rb', line 26

def database_config_path
  configuration_data["config"]["database"] ||
  "#{config_path}/#{ENV["db/config/database.yml"] || "database.yml"}"
end

#migration_dirpathObject



17
18
19
20
# File 'lib/arfy/environment.rb', line 17

def migration_dirpath
  configuration_data["db"]["migrate"] ||
  ENV["db/migrate"] || "db/migrate"
end

#schema_pathObject



36
37
38
39
# File 'lib/arfy/environment.rb', line 36

def schema_path
  configuration_data["db"]["schema"] ||
  ENV["db/schema.rb"] || "db/schema.rb"
end

#seed_rb_pathObject



31
32
33
34
# File 'lib/arfy/environment.rb', line 31

def seed_rb_path
  configuration_data["db"]["seeds"] ||
  "#{ENV["db/seeds_dir"] || "db"}/#{ENV["db/seeds.rb"] || "seeds.rb"}"
end