# File lib/rabbit/slide-configuration.rb, line 64 def clear @id = nil @base_name = nil @tags = [] @presentation_date = nil @version = nil @licenses = [] @slideshare_id = nil @speaker_deck_id = nil @ustream_id = nil @vimeo_id = nil @author = nil end
# File lib/rabbit/slide-configuration.rb, line 120 def gem_name "#{GEM_NAME_PREFIX}-#{@author.rubygems_user}-#{@id}" end
# File lib/rabbit/slide-configuration.rb, line 44 def load return unless File.exist?(path) conf = YAML.load(File.read(path)) clear merge!(conf) rescue format = _("Failed to read slide configuration: %s: %s") @logger.error(format % [path, $!.message]) end
# File lib/rabbit/slide-configuration.rb, line 78 def merge!(conf) @id = conf["id"] || @id @base_name = conf["base_name"] || @base_name @presentation_date = conf["presentation_date"] || @presentation_date @version = conf["version"] || @version @slideshare_id = conf["slideshare_id"] || @slideshare_id @speaker_deck_id = conf["speaker_deck_id"] || @speaker_deck_id @ustream_id = conf["ustream_id"] || @ustream_id @vimeo_id = conf["vimeo_id"] || @vimeo_id @tags |= (conf["tags"] || []) @licenses |= (conf["licenses"] || []) @author ||= AuthorConfiguration.new(@logger) @author.merge!(conf["author"] || {}) end
# File lib/rabbit/slide-configuration.rb, line 124 def path "config.yaml" end
# File lib/rabbit/slide-configuration.rb, line 54 def save(base_dir) config_path = File.join(base_dir, path) create_file(config_path) do |conf_file| conf_file.print(to_yaml) end rescue format = _("Failed to write slide configuration: %s: %s") @logger.error(format % [config_path, $!.message]) end
# File lib/rabbit/slide-configuration.rb, line 95 def to_hash config = { "id" => @id, "base_name" => @base_name, "tags" => @tags, "presentation_date" => @presentation_date, "version" => version, "licenses" => @licenses, "slideshare_id" => @slideshare_id, "speaker_deck_id" => @speaker_deck_id, "ustream_id" => @ustream_id, "vimeo_id" => @vimeo_id, } config["author"] = @author.to_hash if @author config end
Generated with the Darkfish Rdoc Generator 2.