Class: Arfy::Environment::EnvWorkdirConfiguration
- Inherits:
-
Object
- Object
- Arfy::Environment::EnvWorkdirConfiguration
- Defined in:
- lib/arfy/environment.rb
Instance Method Summary collapse
- #config_path ⇒ Object
- #configuration_data ⇒ Object
- #database_config_path ⇒ Object
- #migration_dirpath ⇒ Object
- #schema_path ⇒ Object
- #seed_rb_path ⇒ Object
Instance Method Details
#config_path ⇒ Object
22 23 24 |
# File 'lib/arfy/environment.rb', line 22 def config_path ENV["db/config"] || "config" end |
#configuration_data ⇒ Object
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_path ⇒ Object
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_dirpath ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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 |