lib/openstudio/analysis/formulation.rb in openstudio-analysis-1.0.0.rc9 vs lib/openstudio/analysis/formulation.rb in openstudio-analysis-1.0.0.rc10
- old
+ new
@@ -188,11 +188,11 @@
h[:analysis][:problem][:algorithm][:objective_functions] = ofs
end
h
else
- fail "Version #{version} not defined for #{self.class} and #{__method__}"
+ raise "Version #{version} not defined for #{self.class} and #{__method__}"
end
end
# Load the analysis JSON from a hash (with symbolized keys)
def self.from_hash(h, seed_dir = nil, weather_dir = nil)
@@ -216,11 +216,11 @@
o.seed_model "#{weather_path}/#{File.basename(h[:analysis][:seed][:path])}"
else
o.seed_model = h[:analysis][:seed][:path]
end
else
- fail "Version #{version} not defined for #{self.class} and #{__method__}"
+ raise "Version #{version} not defined for #{self.class} and #{__method__}"
end
o
end
@@ -291,11 +291,11 @@
# Package up the seed, weather files, and measures
def save_analysis_zip(filename)
def add_directory_to_zip(zipfile, local_directory, relative_zip_directory)
# puts "Add Directory #{local_directory}"
- Dir[File.join("#{local_directory}", '**', '**')].each do |file|
+ Dir[File.join(local_directory.to_s, '**', '**')].each do |file|
# puts "Adding File #{file}"
zipfile.add(file.sub(local_directory, relative_zip_directory), file)
end
zipfile
end
@@ -329,10 +329,10 @@
zf.add("./seed/#{File.basename(f[:file])}", f[:file])
end
puts 'Adding Support Files: Libraries'
@libraries.each do |lib|
- fail "Libraries must specify their 'library_name' as metadata which becomes the directory upon zip" unless lib[:metadata][:library_name]
+ raise "Libraries must specify their 'library_name' as metadata which becomes the directory upon zip" unless lib[:metadata][:library_name]
if File.directory? lib[:file]
Dir[File.join(lib[:file], '**', '**')].each do |file|
puts " Adding #{file}"
zf.add(file.sub(lib[:file], "./lib/#{lib[:metadata][:library_name]}/"), file)