aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-04-26 20:58:26 -0400
committerRalph Amissah <ralph@amissah.com>2010-04-26 20:59:24 -0400
commit8b3f9e832f69bcef52f073678bbde1fcc588e695 (patch)
tree072fa5e187b8923957200a218256cf41c96bb373 /lib/sisu/v2/sysenv.rb
parentsisupod_make, take new markup into account, done for :skin: (diff)
git, start experimenting with an alternative/parallel git based sisu document structure
* git, start to experiment with file structure to replace sisupod -g and will be in configure options, to track changes to document, enable creation of "pods" (zipped content) and allow for remote versioned (or unversioned) placement of content source; ideally would end up with two co-existing, distinct parse-able structures whether local or remote, the existing directory structure with multiple documents and document images etc. and git directories with all content associated with a single document (including other language versions of it); cannot guarantee at this stage that the file structure will be retained, which may mean recreating any directory started and defeat the purpose of using it, though it is in a version control repo, so perhaps not ... best left alone (unused) for now
Diffstat (limited to 'lib/sisu/v2/sysenv.rb')
-rw-r--r--lib/sisu/v2/sysenv.rb24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb
index c857468f..ed0fe136 100644
--- a/lib/sisu/v2/sysenv.rb
+++ b/lib/sisu/v2/sysenv.rb
@@ -115,6 +115,7 @@ module SiSU_Env
end
processing_path=tmp_processing_individual
processing_dir=prcss_dir
+ processing_git="#{Dir.pwd}/#{Gt[:grotto]}"
user=ENV['USER']
port_pgsql=if defined? ENV['PGPORT'] \
and not (ENV['PGPORT'].nil? \
@@ -149,6 +150,7 @@ module SiSU_Env
PROCESSING_SQLITE=:processing_sqlite
PROCESSING_POSTGRESQL=:processing_postgresql
PROCESSING_ENCODING=:processing_encoding
+ PROCESSING_GIT=:processing_git
PAPERSIZE=:papersize
LANGUAGE=:language
LANGUAGE_CODE=:language_code
@@ -191,6 +193,7 @@ module SiSU_Env
PROCESSING_SQLITE => 'sqlite',
PROCESSING_POSTGRESQL=> 'postgresql',
PROCESSING_ENCODING => 'encoding',
+ PROCESSING_GIT => processing_git,
#TEXINFO_STUB => 'texinfo',
PAPERSIZE => 'A4', #A4, US_letter, book_b5, book_a5, US_legal
LANGUAGE => 'English',
@@ -526,7 +529,7 @@ module SiSU_Env
end
def program_found?(program)
found=`whereis #{program}`
- state=(found =~/bin\/#{program}\b/) ? true : false
+ (found =~/bin\/#{program}\b/) ? true : false
end
def locale #locales utf8 or other
unless @@locale_flag
@@ -817,7 +820,7 @@ module SiSU_Env
class Info_env < Env_call
require 'fileutils'
include FileUtils
- attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:etc,:yamlrc_dir
+ attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir
@@image_flag,@@local_image=true,true #warning on @@image_flag
@@fb=@@man_path=nil,nil
def initialize(fns='',md=nil)
@@ -1449,6 +1452,23 @@ WOK
end
processing
end
+ def processing_path_git
+ proposed_dir=if defined? @rc['git']['dir'] \
+ and not @rc['git']['dir'].nil? \
+ and not @rc['git']['dir'].empty?
+ x=(@rc['git']['dir'] =~/^(?:~|home)$/) \
+ ? home + '/' + 'sisu:' \
+ : @rc['git']['dir'] + '/' + 'sisu:'
+ else defaults[:processing_git]
+ end
+ end
+ def processing_git
+ unless FileTest.directory?(processing_path_git)
+ mkdir_p(processing_path_git)
+ File.chmod(0700,processing_path_git)
+ end
+ processing_path_git
+ end
def epub
"#{processing}/epub/#{@fnb}"
end