Module: ApplicationHelper

Includes:
DeploymentInfo
Defined in:
app/helpers/application_helper.rb

Overview

rubocop:todo Style/Documentation

Defined Under Namespace

Modules: DeploymentInfo

Instance Method Summary collapse

Instance Method Details

#apiObject

Easy access to the api from the console



22
23
24
# File 'app/helpers/application_helper.rb', line 22

def api
  Sequencescape::Api.new(Limber::Application.config.api.v1.connection_options.dup)
end

#apple_touch_iconString

Return the appropriate apple-touch-icon for the current environment

Returns:

  • (String)

    The path to the apple-touch-icon



65
66
67
# File 'app/helpers/application_helper.rb', line 65

def apple_touch_icon
  "apple-touch-icon#{icon_suffix}.png"
end

#each_robot(&block) ⇒ Object



30
31
32
# File 'app/helpers/application_helper.rb', line 30

def each_robot(&block)
  Robots.each_robot(&block)
end

#environmentObject



26
27
28
# File 'app/helpers/application_helper.rb', line 26

def environment
  Rails.env
end

#faviconString

Return the appropriate favicon for the current environment

Returns:

  • (String)

    The path to the favicon



59
60
61
# File 'app/helpers/application_helper.rb', line 59

def favicon
  "favicon#{icon_suffix}.ico"
end

#icon_suffixString

Returns the appropriate icon suffix for the current environment Returns empty string for production Returns “-##environment” for training, staging Returns “-development” for any other environment

Returns:

  • (String)

    The suffix to append to the icon name



45
46
47
48
49
50
51
52
53
54
55
# File 'app/helpers/application_helper.rb', line 45

def icon_suffix
  environment = Rails.env
  case environment
  when 'production'
    ''
  when 'training', 'staging'
    "-#{environment}"
  else
    '-development'
  end
end

#pipeline_groupsObject

Return a list of unique pipeline group names



35
36
37
38
# File 'app/helpers/application_helper.rb', line 35

def pipeline_groups
  return [] if Settings.pipelines.list.empty?
  Settings.pipelines.map(&:pipeline_group).uniq.sort
end

#version_informationObject Originally defined in module DeploymentInfo