diff options
Diffstat (limited to 'lib/ohai/plugins/lua.rb')
-rw-r--r-- | lib/ohai/plugins/lua.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/ohai/plugins/lua.rb b/lib/ohai/plugins/lua.rb index 0e984f16..94379ba0 100644 --- a/lib/ohai/plugins/lua.rb +++ b/lib/ohai/plugins/lua.rb @@ -21,19 +21,19 @@ Ohai.plugin(:Lua) do depends "languages" collect_data do - begin - so = shell_out("lua -v") - # Sample output: - # Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio - if so.exitstatus == 0 - lua = Mash.new - # at some point in lua's history they went from outputting the version - # on stderr to doing it on stdout. This handles old / new versions - lua[:version] = so.stdout.empty? ? so.stderr.split[1] : so.stdout.split[1] - languages[:lua] = lua if lua[:version] - end - rescue Ohai::Exceptions::Exec - logger.trace('Plugin Lua: Could not shell_out "lua -v". Skipping plugin') + + so = shell_out("lua -v") + # Sample output: + # Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio + if so.exitstatus == 0 + lua = Mash.new + # at some point in lua's history they went from outputting the version + # on stderr to doing it on stdout. This handles old / new versions + lua[:version] = so.stdout.empty? ? so.stderr.split[1] : so.stdout.split[1] + languages[:lua] = lua if lua[:version] end + rescue Ohai::Exceptions::Exec + logger.trace('Plugin Lua: Could not shell_out "lua -v". Skipping plugin') + end end |