<commit_before>{Emitter} = require 'atom'

class LevelsWorkspaceManager
  constructor: ->
    @emitter = new Emitter

  destroy: ->
    @emitter.dispose()
    return

  attachWorkspace: (@levelsWorkspace) ->
    @emitter.emit 'workspace-attached', @levelsWorkspace
    return

  onWorkspaceAttached: (callback) ->
    @emitter.on 'workspace-attached', callback

  getWorkspace: ->
    return @levelsWorkspace

  getActiveTerminal: ->
    return @levelsWorkspace?.getActiveTerminal()

  getActiveLevelCodeEditor: ->
    return @levelsWorkspace?.getActiveLevelCodeEditor()

  getActiveTextEditor: ->
    return @getActiveLevelCodeEditor()?.getTextEditor()

  getActiveLanguage: ->
    return @levelsWorkspace?.getActiveLanguage()

  getActiveLevel: ->
    return @levelsWorkspace?.getActiveLevel()

  isActiveLevelDebuggable: ->
    isDebuggable = @getActiveLevel()?.getOption 'debuggable'
    return isDebuggable? && isDebuggable

  getActiveTextEditorCursorPositions: ->
    return @getActiveTextEditor()?.getCursorBufferPositions()

  addBreakpointMarker: (point, enabled) ->
    textEditor = @getActiveTextEditor()
    marker = textEditor?.markBufferPosition point, invalidate: 'inside'
    className = if enabled then 'annotation annotation-breakpoint' else 'annotation annotation-breakpoint-disabled'
    textEditor?.decorateMarker marker, {type: 'line-number', class: className}<commit_msg>Added isActiveLanguageRuby function to workspace manager<commit_after>{Emitter} = require 'atom'

class LevelsWorkspaceManager
  constructor: ->
    @emitter = new Emitter

  destroy: ->
    @emitter.dispose()
    return

  attachWorkspace: (@levelsWorkspace) ->
    @emitter.emit 'workspace-attached', @levelsWorkspace
    return

  onWorkspaceAttached: (callback) ->
    @emitter.on 'workspace-attached', callback

  getWorkspace: ->
    return @levelsWorkspace

  getActiveTerminal: ->
    return @levelsWorkspace?.getActiveTerminal()

  getActiveLevelCodeEditor: ->
    return @levelsWorkspace?.getActiveLevelCodeEditor()

  getActiveTextEditor: ->
    return @getActiveLevelCodeEditor()?.getTextEditor()

  getActiveLanguage: ->
    return @levelsWorkspace?.getActiveLanguage()

  isActiveLanguageRuby: ->
    return @getActiveLanguage()?.getName() == 'Ruby'

  getActiveLevel: ->
    return @levelsWorkspace?.getActiveLevel()

  isActiveLevelDebuggable: ->
    isDebuggable = @getActiveLevel()?.getOption 'debuggable'
    return isDebuggable? && isDebuggable

  getActiveTextEditorCursorPositions: ->
    return @getActiveTextEditor()?.getCursorBufferPositions()

  addBreakpointMarker: (point, enabled) ->
    textEditor = @getActiveTextEditor()
    marker = textEditor?.markBufferPosition point, invalidate: 'inside'
    className = if enabled then 'annotation annotation-breakpoint' else 'annotation annotation-breakpoint-disabled'
    textEditor?.decorateMarker marker, {type: 'line-number', class: className}
{'fraction_non_alphanumeric': 0.10775566231983527, 'fraction_numerical': 0.0, 'mean_word_length': 4.795228628230617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3094959', 'n_tokens_mistral': 843, 'n_tokens_neox': 802, 'n_words': 160}