module DmCloud

This module generate methods to generate video’s fluxes before signing it and request it.

This gem’s comments come from DailyMotion Cloud API, that’s the better way to see changes on new version and logic. For parts more generals and not representating DailyMotion Cloud API, I add some about my own opinion.

Constants

VERSION
YAML_INITIALIZER_PATH

Public Class Methods

config() click to toggle source

Access to config variables (security level, user_id and api_key)

# File lib/dmcloud.rb, line 46
def self.config
  @@config = configure unless @@config
  @@config
end
configure(opts = {}) click to toggle source

Configure through hash

# File lib/dmcloud.rb, line 26
def self.configure(opts = {})
  opts.each {|k,v| @@config[k.to_sym] = v } # if @valid_config_keys.include? k.to_sym}
end
configure_with(yaml_file_path = nil) click to toggle source

Configure through yaml file for ruby scripting usage

# File lib/dmcloud.rb, line 32
def self.configure_with(yaml_file_path = nil)
  yaml_file_path = YAML_INITIALIZER_PATH  unless yaml_file_path
  begin
    config = YAML::load(IO.read(path_to_yaml_file))
  rescue Errno::ENOENT
    log(:warning, "YAML configuration file couldn't be found. Using defaults."); return
  rescue Psych::SyntaxError
    log(:warning, "YAML configuration file contains invalid syntax. Using defaults."); return
  end

  configure(config)
end