Module: ApplicationHelper

Defined in:
app/helpers/application_helper.rb

Overview

Global helper functions

Instance Method Summary (collapse)

Instance Method Details

- (String) input_path(run)

Returns absolute path to an input .zip

Parameters:

  • run (Run)

    Run that this input belongs to

Returns:

  • (String)

    absolute path to an input .zip



17
18
19
# File 'app/helpers/application_helper.rb', line 17

def input_path(run)
  "/input/#{run.id.to_s}/input.zip"
end

- (String) output_path(run, eadid = nil)

Returns absolute path to an output XML or .zip

Parameters:

  • run (Run)

    Run that produced this output

  • eadid (String, nil) (defaults to: nil)

    of individual EAD, or nil for zipped resultset

Returns:

  • (String)

    absolute path to an output XML or .zip



11
12
13
# File 'app/helpers/application_helper.rb', line 11

def output_path(run, eadid = nil)
  "/output/#{run.id.to_s}/#{eadid ? "#{eadid}.xml" : 'out.zip'}"
end

- (Object) pp_time(time)

Generic print function for date-times in tool



4
5
6
# File 'app/helpers/application_helper.rb', line 4

def pp_time(time)
  time.strftime Rails.configuration.x.time_display_fmt
end