Class: Rake::Delphi::BDSVersionInfo
Class Method Summary
collapse
Instance Method Summary
collapse
#[], #method_missing
Constructor Details
Returns a new instance of BDSVersionInfo.
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/rake/delphi/projectinfo.rb', line 33
def initialize(task)
super(task)
content = @content['Delphi.Personality']['VersionInfoKeys']['VersionInfoKeys']
use_encode = String.new.respond_to?(:encode)
encoding = self.class.encoding
if encoding && ! use_encode
require 'iconv'
iconv = Iconv.new(encoding, 'UTF-8')
end
content.each do |v|
cv = v['content']
cv = (use_encode ? cv.encode(encoding, 'UTF-8') : iconv.iconv(cv)) if encoding
@info[v['Name'].to_sym] = cv
end
end
|
Class Method Details
.encoding ⇒ Object
49
50
51
52
|
# File 'lib/rake/delphi/projectinfo.rb', line 49
def self.encoding
nil
end
|
Instance Method Details
#_ext ⇒ Object
58
59
60
|
# File 'lib/rake/delphi/projectinfo.rb', line 58
def _ext
return 'bdsproj'
end
|
#do_getcontent ⇒ Object
54
55
56
|
# File 'lib/rake/delphi/projectinfo.rb', line 54
def do_getcontent
@content = XmlSimple.xml_in(@file, :ForceArray => false)
end
|