lib/vtools/config.rb in vtools-0.0.3 vs lib/vtools/config.rb in vtools-0.1.0
- old
+ new
@@ -4,29 +4,32 @@
module VTools
CONFIG = {
# system environment
- :PWD => Dir.getwd,
- :library => [],
- :logging => nil,
- :log_file => nil,
- :config_file => nil,
- :ffmpeg_binary => '/usr/bin/ffmpeg',
- :thumb_binary => '/usr/bin/ffmpegthumbnailer',
+ :PWD => Dir.getwd,
+ :library => [],
+ :logging => nil,
+ :log_file => nil,
+ :config_file => nil,
+ :ffmpeg_binary => '/usr/bin/ffmpeg',
+ :thumb_binary => '/usr/bin/ffmpegthumbnailer',
# harvester
- :max_jobs => 5,
- :store_jobs => 10,
- :harvester_timer => 3,
- :temp_dir => '',
+ :max_jobs => 5,
+ :store_jobs => 10,
+ :harvester_timer => 3,
+ :temp_dir => '',
# converter
- :video_storage => nil,
- :validate_duration => nil,
+ :video_storage => '',
+ :video_path_generator => nil,
+ :validate_duration => nil,
+
# thumbnailer
- :thumb_storage => nil,
+ :thumb_storage => '',
+ :thumb_path_generator => nil,
# predefined video qualities
:video_set => {
# SET_NAME -vcodec VC -acodec AC -s WDTxHGT -vb BR -ab BR -ar SMPL -ac CH EXT POSTFIX -vpre CONF
:x264_180p => ['libx264', 'libfaac', '240x180', '96k', '64k', 22050, 2, 'mp4', '_180', 'normal' ],
@@ -59,21 +62,21 @@
:w360 => [360, 10, 5, 0],
:w360 => [480, 10, 5, 0],
:w600 => [600, 10, 5, 0],
}
}
-
+
# parse external config file
def CONFIG.load!
begin
data = YAML.load_file self[:config_file]
data = VTools.keys_to_sym data
append! data
rescue => e
raise ConfigError, "Invalid config data #{e}"
end if self[:config_file]
end
-
+
# merge config data
def CONFIG.append! data
direct = [:ffmpeg_binary, :thumb_binary, :max_jobs, :store_jobs,
:harvester_timer, :temp_dir, :video_storage, :thumb_storage]
# common data