File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,9 +41,6 @@ spec = Gem::Specification.new do |s|
4141 #s.rubyforge_project = %q{ruby-msg}
4242
4343 s . files = Dir . glob ( 'data/*.yaml' )
44- exe = RUBY_PLATFORM [ 'win' ] ? '.exe' : ''
45- # not great
46- s . files += [ 'rtfdecompr' + exe , 'rtf2html' + exe ]
4744 s . files += Dir . glob ( "lib/**/*.rb" )
4845 s . files += Dir . glob ( "test/test_*.rb" ) + Dir . glob ( "test/*.doc" )
4946
Original file line number Diff line number Diff line change 88require 'support'
99require 'ole/storage'
1010require 'msg/properties'
11+ require 'msg/rtf'
1112require 'mime'
1213
1314module Ole
@@ -28,7 +29,7 @@ def self.parse_guid s
2829#
2930
3031class Msg
31- VERSION = '1.2.12 '
32+ VERSION = '1.2.13 '
3233 # we look here for the yaml files in data/, and the exe files for support
3334 # decoding at the moment.
3435 SUPPORT_DIR = File . dirname ( __FILE__ ) + '/..'
@@ -217,14 +218,9 @@ def body_to_mime
217218 # (maybe i should just overload body_html do to this)
218219 # its thus currently possible to get no body at all if the only body is rtf. that is not
219220 # really acceptable
220- if props . body_rtf and !props . body_html and props . body_rtf [ 'htmltag' ]
221- open ( 'temp.html' , 'w' ) { |f | f . write props . body_rtf }
222- begin
223- html = `#{ SUPPORT_DIR } /rtf2html < temp.html`
224- mime . parts << Mime . new ( "Content-Type: text/html\r \n \r \n " + html . gsub ( /(<\/ html>).*\Z /mi , "\\ 1" ) )
225- ensure
226- File . unlink 'temp.html' rescue nil
227- end
221+ if props . body_rtf and !props . body_html
222+ html = Msg ::RTF . rtf2html props . body_rtf
223+ mime . parts << Mime . new ( "Content-Type: text/html\r \n \r \n " + html . gsub ( /(<\/ html>).*\Z /mi , "\\ 1" ) )
228224 end
229225 mime
230226 else
You can’t perform that action at this time.
0 commit comments