Module: CultomePlayer::Environment
- Included in:
- CultomePlayer
- Defined in:
- lib/cultome_player/environment.rb
Instance Method Summary collapse
-
#config_file ⇒ String
Get the config_file environment configuration value.
-
#current_env ⇒ Symbol
Get the current environment name.
-
#db_adapter ⇒ String
Get the db_adapter environment configuration value.
-
#db_file ⇒ String
Get the db_file environment configuration value.
-
#db_log_file ⇒ String
Get the db_log_file environment configuration value.
-
#env_config ⇒ Hash
Gets the environment configurations.
-
#file_types ⇒ String
Get the file_types environment configuration value.
-
#mplayer_pipe ⇒ String
Get the mplayer_pipe environment configuration value.
-
#player_config ⇒ Hash
Gets the player configurations.
-
#prepare_environment(env, check_db = true) ⇒ Object
Extract the configuration for the environment and setup valriables.
-
#stdout ⇒ IO
Get the stdout (not STDOUT) for the player.
Instance Method Details
#config_file ⇒ String
Get the config_file environment configuration value.
38 39 40 |
# File 'lib/cultome_player/environment.rb', line 38 def config_file env_config['config_file'] || raise('environment problem:environment information not loaded') end |
#current_env ⇒ Symbol
Get the current environment name.
73 74 75 |
# File 'lib/cultome_player/environment.rb', line 73 def current_env @current_env end |
#db_adapter ⇒ String
Get the db_adapter environment configuration value.
10 11 12 |
# File 'lib/cultome_player/environment.rb', line 10 def db_adapter env_config['db_adapter'] || raise('environment problem:environment information not loaded') end |
#db_file ⇒ String
Get the db_file environment configuration value.
17 18 19 |
# File 'lib/cultome_player/environment.rb', line 17 def db_file env_config['db_file'] || raise('environment problem:environment information not loaded') end |
#db_log_file ⇒ String
Get the db_log_file environment configuration value.
24 25 26 |
# File 'lib/cultome_player/environment.rb', line 24 def db_log_file env_config['db_log_file'] || raise('environment problem:environment information not loaded') end |
#env_config ⇒ Hash
Gets the environment configurations.
66 67 68 |
# File 'lib/cultome_player/environment.rb', line 66 def env_config @env_config ||= {} end |
#file_types ⇒ String
Get the file_types environment configuration value.
31 32 33 |
# File 'lib/cultome_player/environment.rb', line 31 def file_types env_config['file_types'] || raise('environment problem:environment information not loaded') end |
#mplayer_pipe ⇒ String
Get the mplayer_pipe environment configuration value.
45 46 47 |
# File 'lib/cultome_player/environment.rb', line 45 def mplayer_pipe env_config['mplayer_pipe'] || raise('environment problem:environment information not loaded') end |
#player_config ⇒ Hash
Gets the player configurations.
59 60 61 |
# File 'lib/cultome_player/environment.rb', line 59 def player_config @player_config ||= {} end |
#prepare_environment(env, check_db = true) ⇒ Object
Extract the configuration for the environment and setup valriables.
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/cultome_player/environment.rb', line 81 def prepare_environment(env, check_db=true) env_config = YAML.load_file File.('config/environment.yml') @env_config = env_config[env.to_s] @current_env = env.to_sym raise 'environment problem:environment not found' if @env_config.nil? @env_config create_required_files @env_config load_master_config @env_config['config_file'] check_db_schema if check_db end |
#stdout ⇒ IO
Get the stdout (not STDOUT) for the player.
52 53 54 |
# File 'lib/cultome_player/environment.rb', line 52 def stdout STDOUT end |