Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
vtcifer committed Sep 13, 2024
1 parent 9eec0b3 commit 762bc33
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions script-watch.lic
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class ScriptWatch
@enable_links = settings.script_watch_enable_links
@ignored_scripts = settings.script_watch_ignored_scripts
@passive_timer = settings.script_watch_cycle_time

@script_prefix = settings.script_watch_script_prefix
@script_postfix = settings.script_watch_script_postfix
@script_separator = settings.script_watch_script_separator

@script_argument_separator = settings.script_watch_script_argument_separator

@argument_prefix = settings.script_watch_argument_prefix
Expand All @@ -44,19 +44,19 @@ class ScriptWatch
end

def output_scripts()
temp_list = @display_hidden ? Script.running + Script.hidden : Script.running
temp_list = @display_hidden ? Script.running + Script.hidden : Script.running

@script_list = temp_list

temp_output = temp_list.select { |s| !(@ignored_scripts.include?(s.name)) }
.collect { |s|
.collect { |s|
output = ""
output.concat @script_prefix
if @enable_links
case $frontend
when 'genie'
# use alternate link syntax for genie, so end users don't need to enable it globally
# enabling links generally in genie can cause issus with .NET UI. This link syntax
# enabling links generally in genie can cause issus with .NET UI. This link syntax
# bypasses the global setting, which *shouldn't* cause the kind of problems enabling
# links globally in genie can cause
# genie alternate link syntax: {<text to display>:<link command>}
Expand All @@ -82,11 +82,12 @@ class ScriptWatch
end

output
}
.join(@script_separator)
}
.join(@script_separator)

# attempt to short circuit to keep from sending unneeded xml, still update every 300s (5 min)
return if @script_output == temp_output && ( (Time.now - @last_update) < 300 )
return if @script_output == temp_output && ((Time.now - @last_update) < 300)

@script_output = temp_output

_respond("<clearStream id=\"LichScripts\"/>\r\n")
Expand All @@ -100,4 +101,4 @@ before_dying do
_respond("<clearStream id=\"LichScripts\"/>\r\n")
end

ScriptWatch.new
ScriptWatch.new

0 comments on commit 762bc33

Please sign in to comment.