Class: Ci::WebIdeConfigService

Inherits:
BaseService show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/services/ci/web_ide_config_service.rb

Constant Summary collapse

ValidationError =
Class.new(StandardError)
WEBIDE_CONFIG_FILE =
'.gitlab/.gitlab-webide.yml'.freeze

Instance Attribute Summary collapse

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods inherited from BaseService

#initialize

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

This class inherits a constructor from BaseService

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config


11
12
13
# File 'app/services/ci/web_ide_config_service.rb', line 11

def config
  @config
end

#config_contentObject (readonly)

Returns the value of attribute config_content


11
12
13
# File 'app/services/ci/web_ide_config_service.rb', line 11

def config_content
  @config_content
end

Instance Method Details

#executeObject


13
14
15
16
17
18
19
20
21
# File 'app/services/ci/web_ide_config_service.rb', line 13

def execute
  check_access!
  load_config_content!
  load_config!

  success(terminal: config.terminal_value)
rescue ValidationError => e
  error(e.message)
end