yore 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/yore/yore_core.rb +11 -1
- data/test/yore_browsercms_loadsave_test.rb +0 -3
- data/test/yore_spree_loadsave_test.rb +0 -3
- data/yore.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
data/lib/yore/yore_core.rb
CHANGED
@@ -125,6 +125,10 @@ module YoreCore
|
|
125
125
|
|
126
126
|
#aOptions may require {:basepath => File.dirname(File.expand_path(job))}
|
127
127
|
def self.launch(aConfigXml,aCmdOptions=nil,aOptions=nil)
|
128
|
+
if !aConfigXml
|
129
|
+
path = MiscUtils.path_combine(aOptions && aOptions[:basepath],'yore.config.xml')
|
130
|
+
aConfigXml = path if File.exists?(path)
|
131
|
+
end
|
128
132
|
result = Yore.new()
|
129
133
|
result.configure(aConfigXml,aCmdOptions,aOptions)
|
130
134
|
return result
|
@@ -336,6 +340,7 @@ module YoreCore
|
|
336
340
|
end
|
337
341
|
|
338
342
|
def uncompress(aArchive,aDestination=nil,aArchiveContent=nil)
|
343
|
+
logger.info "uncompressing #{aArchive}"
|
339
344
|
#tarfile = File.expand_path(MiscUtils.file_change_ext(File.basename(aArchive),'tar'),temp_dir)
|
340
345
|
#shell("bunzip2 #{tarfile}; mv #{tarfile}.bz2 #{aDestFile}")
|
341
346
|
#
|
@@ -465,7 +470,9 @@ module YoreCore
|
|
465
470
|
REXML::XPath.each(xmlSource, 'IncludePath') do |xmlPath|
|
466
471
|
bp2 = MiscUtils.path_combine(bp,XmlUtils::peek_node_value(xmlPath,"@BasePath"))
|
467
472
|
filelist << '-C'+bp2
|
468
|
-
|
473
|
+
destPath = MiscUtils::path_combine(bp2,xmlPath.text)
|
474
|
+
logger.info "saving files from #{destPath}"
|
475
|
+
files = MiscUtils::recursive_file_list(destPath)
|
469
476
|
files.map!{|f| MiscUtils.path_debase(f,bp2)}
|
470
477
|
filelist += files
|
471
478
|
sourceFound = true
|
@@ -483,6 +490,7 @@ module YoreCore
|
|
483
490
|
unless args[:username] && args[:password] && args[:database] && (file||arc_file)
|
484
491
|
raise StandardError.new("Invalid or missing parameter")
|
485
492
|
end
|
493
|
+
logger.info "saving database #{args[:database]}"
|
486
494
|
if arc_file
|
487
495
|
arc_file = MiscUtils.path_debase(arc_file,'/')
|
488
496
|
sql_file = File.expand_path(arc_file,aTempFolder)
|
@@ -570,6 +578,7 @@ module YoreCore
|
|
570
578
|
pathUncompressed = File.join(archive_path,pathArchive)
|
571
579
|
pathTmp = File.join(rails_tmp_path,pathArchive)
|
572
580
|
pathDest = File.join(bpInclude,pathArchive)
|
581
|
+
logger.info "loading files into #{pathDest}"
|
573
582
|
|
574
583
|
# move basepath/relativepath to tmp/yore/090807-010203/relativepath (out of the way)
|
575
584
|
Yore::move_folder(pathDest,pathTmp) if File.exists?(pathDest)
|
@@ -578,6 +587,7 @@ module YoreCore
|
|
578
587
|
end
|
579
588
|
when 'MySql' then
|
580
589
|
db_details = database_from_xml(XmlUtils.single_node(xmlSource,'Database'))
|
590
|
+
logger.info "loading database #{db_details[:database]}"
|
581
591
|
DatabaseUtils.load_database(db_details,File.join(archive_path,db_details[:archive_file]))
|
582
592
|
end
|
583
593
|
end
|
data/yore.gemspec
CHANGED