X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=lib%2Fredact%2Fredact.rb;h=581c4c4297739fd0667a039ce675bfe16ed37098;hb=eabefe8c75ede2bdf39853e56c5d59984893decc;hp=7417c92467e21f01a934369056c97716e7b4d10d;hpb=e6589624744430b826a27a71e3d4894516969fb3;p=redact.git diff --git a/lib/redact/redact.rb b/lib/redact/redact.rb index 7417c92..581c4c4 100644 --- a/lib/redact/redact.rb +++ b/lib/redact/redact.rb @@ -1,5 +1,5 @@ #-- -# $Id: redact.rb 28 2005-04-14 19:53:45Z tilman $ +# $Id: redact.rb 53 2005-06-11 13:21:38Z tilman $ # # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) # @@ -57,7 +57,7 @@ class String end module Redact - VERSION = "0.1.0" + VERSION = "0.1.2" class RedactError < StandardError; end @@ -142,10 +142,12 @@ module Redact end class FontDirectoryEntry # :nodoc: - attr_reader :filename + attr_reader :save_as, :filename, :alias - def initialize(filename) + def initialize(fn_alias, filename) + @save_as = fn_alias.to_str.dup.freeze @filename = filename.to_str.dup.freeze + @alias = "Edje." + fn_alias.sub(/.[^.]+$/, "").freeze end protected @@ -154,7 +156,7 @@ module Redact end def to_eet_properties - {"entry" => [@filename]} + {"entry" => [@alias]} end end @@ -178,7 +180,8 @@ module Redact class ImageDirectoryEntry # :nodoc: attr_reader :filename, :image, :id - def initialize(filename) + def initialize(im_alias, filename) + @alias = im_alias.to_str.dup.freeze @filename = filename.to_str.dup.freeze @image = Imlib2::Image.load(@filename) @id = -1 @@ -202,7 +205,7 @@ module Redact end def to_eet_properties - {"entry" => [@filename], + {"entry" => [@alias], "source_type" => [@source_type], "source_param" => [@source_param], "id" => [@id]} @@ -273,7 +276,7 @@ module Redact ImagePart else raise(ArgumentError, - "invalid program type - #{type.to_s}") + "invalid part type - #{type.to_s}") end p = klass.new(self, @parts.size, name)