aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/odf.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-02 22:54:28 -0500
committerRalph Amissah <ralph@amissah.com>2011-03-02 22:54:28 -0500
commit0569fd776ab4ce33689ca3337acd62f2415b6348 (patch)
tree4644037b28d876d8637a610f5df1a29535a4ef9a /lib/sisu/v3/odf.rb
parentdebian/changelog (3.0.1-1) (diff)
parentCHANGELOG_v{1,2,3}, syslink, avoid duplication (diff)
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib/sisu/v3/odf.rb')
-rw-r--r--lib/sisu/v3/odf.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb
index ce696fdd..204f0e50 100644
--- a/lib/sisu/v3/odf.rb
+++ b/lib/sisu/v3/odf.rb
@@ -1,4 +1,4 @@
-# coding: utf-8
+# encoding: utf-8
=begin
* Name: SiSU
@@ -57,22 +57,22 @@
=end
module SiSU_ODF
- require "#{SiSU_lib}/particulars" # particulars.rb
+ require_relative 'particulars' # particulars.rb
include SiSU_Particulars
- require "#{SiSU_lib}/dal" # dal.rb
- require "#{SiSU_lib}/sysenv" # sysenv.rb
+ require_relative 'dal' # dal.rb
+ require_relative 'sysenv' # sysenv.rb
include SiSU_Env
include SiSU_Viz
- require "#{SiSU_lib}/odf_format" # odf_format.rb
+ require_relative 'odf_format' # odf_format.rb
include SiSU_ODF_format
- require "#{SiSU_lib}/shared_metadata" # shared_metadata.rb
- require "#{SiSU_lib}/shared_txt" # shared_txt.rb
+ require_relative 'shared_metadata' # shared_metadata.rb
+ require_relative 'shared_txt' # shared_txt.rb
@@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0
class Source
require 'zlib'
require 'find'
require 'fileutils'
- include FileUtils
+ include FileUtils
def initialize(opt)
@opt=opt
@particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt)
@@ -101,10 +101,10 @@ module SiSU_ODF
end
private
class Scroll <Source
- require "#{SiSU_lib}/defaults" # defaults.rb
- require "#{SiSU_lib}/shared_txt" # shared_txt.rb
+ require_relative 'defaults' # defaults.rb
+ require_relative 'shared_txt' # shared_txt.rb
@@img_count=0
- @@odf={ :body=>[],:open=>[],:close=>[],:head=>[],:metadata=>[],:tail=>[],:endnotes=>[] }
+ @@odf={ body: [], open: [], close: [], head: [], metadata: [], tail: [], endnotes: [] }
@@docstart=true
@@fns=nil
def initialize(particulars)
@@ -207,7 +207,7 @@ module SiSU_ODF
w=/([0-9]+\.\d{0,3})/.match(w).captures.join
image_source=image_src(i)
pwd=Dir.pwd
- cp("#{image_source}/#{i}","#{@env.path.processing_odf}/Pictures/#{i}") if image_source
+ cp("#{image_source}/#{i}","#{@env.processing_path.odf}/Pictures/#{i}") if image_source
img=if i.to_s =~/jpg|png|gif/ \
and h.to_s =~/\d/ \
and w.to_s =~/\d/
@@ -506,7 +506,7 @@ module SiSU_ODF
odf_tail #($1,$2)
fix=[]
bullet=image_src('bullet_09.png')
- cp("#{bullet}/bullet_09.png","#{@env.path.processing_odf}/Pictures/.") #if image_src('bullet_09.png')
+ cp("#{bullet}/bullet_09.png","#{@env.processing_path.odf}/Pictures/.") #if image_src('bullet_09.png')
odf_metadata
data.each do |dob|
#p dob.obj if dob.obj =~safe_characters and @md.cmd =~/V/ #KEEP
@@ -686,9 +686,9 @@ module SiSU_ODF
def odf #%odf output
env=SiSU_Env::SiSU_file.new(@md)
env.mkdir
- env.make_path(@env.path.processing_odf)
+ env.make_path(@env.processing_path.odf)
env.make_path(@md.file.output_path.odt)
- filename="#{@env.path.processing_odf}/content.xml"
+ filename="#{@env.processing_path.odf}/content.xml"
od=File.new(filename,'w+')
@content.each do |para| # this is a hack
od.puts para unless para =~/\A\s*\Z/
@@ -697,7 +697,7 @@ module SiSU_ODF
opendoc=@md.fn[:odf]
mkdir_p(@md.file.output_path.odt) unless FileTest.directory?(@md.file.output_path.odt)
system("
- cd #{@env.path.processing_odf}
+ cd #{@env.processing_path.odf}
zip -qr #{opendoc} *
mv #{opendoc} #{@md.file.place_file.odt}
cd #{Dir.pwd}
@@ -730,9 +730,9 @@ page break
notes?? [you could add a note number for every object/paragraph!]
- cd(@env.path.processing_odf)
+ cd(@env.processing_path.odf)
structure=[]
- Find.find(@env.path.processing_odf) do |f|
+ Find.find(@env.processing_path.odf) do |f|
structure << puts f
end
open(opendoc,'wb') do |f|