lib/gooddata/models/process.rb in gooddata-0.6.18 vs lib/gooddata/models/process.rb in gooddata-0.6.19

- old
+ new

@@ -65,10 +65,12 @@ params = options[:params].nil? ? [] : [options[:params]] if block begin res = GoodData::Process.deploy(dir, options.merge(:files_to_exclude => params)) block.call(res) + rescue => e + puts e.inspect ensure res.delete if res end else GoodData::Process.deploy(dir, options.merge(:files_to_exclude => params)) @@ -140,24 +142,24 @@ # ----------------------------- Private Stuff private - def zip_and_upload(path, files_to_exclude, opts = {}) - def with_zip(opts = {}) - Tempfile.open('deploy-graph-archive') do |temp| - zip_filename = temp.path - File.open(zip_filename, 'w') do |zip| - Zip::File.open(zip.path, Zip::File::CREATE) do |zipfile| - yield zipfile - end + def with_zip(opts = {}) + Tempfile.open('deploy-graph-archive') do |temp| + zip_filename = temp.path + File.open(zip_filename, 'w') do |zip| + Zip::File.open(zip.path, Zip::File::CREATE) do |zipfile| + yield zipfile end - client.upload_to_user_webdav(temp.path, opts) - temp.path end + client.upload_to_user_webdav(temp.path, opts) + temp.path end + end + def zip_and_upload(path, files_to_exclude, opts = {}) puts 'Creating package for upload' if !path.directory? && (path.extname == '.grf' || path.extname == '.rb') with_zip(opts) do |zipfile| zipfile.add(File.basename(path), path) end @@ -258,10 +260,10 @@ end def execute(executable, options = {}) result = start_execution(executable, options) begin - client.poll_on_code(result['executionTask']['links']['poll']) + client.poll_on_code(result['executionTask']['links']['poll'], options) rescue RestClient::RequestFailed => e raise(e) ensure result = client.get(result['executionTask']['links']['detail']) if result['executionDetail']['status'] == 'ERROR'