projects
/
redact.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Collection#script= and ExecScriptProgram#script= now accept a filename, too.
[redact.git]
/
lib
/
redact
/
redact.rb
diff --git
a/lib/redact/redact.rb
b/lib/redact/redact.rb
index 4e1696cf24e7ea638a78fe005d49a49cf019269a..2a91f207725e4cfefb2af3fb1f588d5aeefd33e2 100644
(file)
--- a/
lib/redact/redact.rb
+++ b/
lib/redact/redact.rb
@@
-1,5
+1,5
@@
#--
#--
-# $Id: redact.rb
31 2005-04-23 22:54:0
1Z tilman $
+# $Id: redact.rb
71 2005-09-21 16:00:3
1Z tilman $
#
# Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
#
#
# Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
#
@@
-57,7
+57,7
@@
class String
end
module Redact
end
module Redact
- VERSION = "0.1.
0
"
+ VERSION = "0.1.
4
"
class RedactError < StandardError; end
class RedactError < StandardError; end
@@
-142,10
+142,12
@@
module Redact
end
class FontDirectoryEntry # :nodoc:
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
@filename = filename.to_str.dup.freeze
+ @alias = "Edje." + fn_alias.sub(/.[^.]+$/, "").freeze
end
protected
end
protected
@@
-154,7
+156,7
@@
module Redact
end
def to_eet_properties
end
def to_eet_properties
- {"entry" => [@
filename
]}
+ {"entry" => [@
alias
]}
end
end
end
end
@@
-178,7
+180,8
@@
module Redact
class ImageDirectoryEntry # :nodoc:
attr_reader :filename, :image, :id
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
@filename = filename.to_str.dup.freeze
@image = Imlib2::Image.load(@filename)
@id = -1
@@
-202,7
+205,7
@@
module Redact
end
def to_eet_properties
end
def to_eet_properties
- {"entry" => [@
filename
],
+ {"entry" => [@
alias
],
"source_type" => [@source_type],
"source_param" => [@source_param],
"id" => [@id]}
"source_type" => [@source_type],
"source_param" => [@source_param],
"id" => [@id]}
@@
-256,7
+259,8
@@
module Redact
end
def script=(v)
end
def script=(v)
- @script = v.to_str.dup
+ v = v.to_str
+ @script = (File.exist?(v) ? File.read(v) : v).dup
end
def part(name, type = :invalid) # :yields: part
end
def part(name, type = :invalid) # :yields: part