alces-software / benchware

0 stars 0 forks source link

Support old ruby versions #7

Closed ColonelPanics closed 6 years ago

ColonelPanics commented 6 years ago

Based on #6

This commit removes the need to install rvm on CentOS 7 in order to run benchware. It seems there is some issue (that I haven't bothered fully debugging) in cli-ui when used with the ruby version on CentOS. As this is only used for doing the page output and seeing as that isn't the common use-case for benchware it is simply ignored if on an older version.

The error with cli-ui is as follows

[root@controller [mycluster] benchware]# ./benchware.rb --help
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': /usr/local/share/gems/gems/cli-ui-1.1.4/lib/cli/ui/stdout_router.rb:149: syntax error, unexpected ')' (SyntaxError)
/usr/local/share/gems/gems/cli-ui-1.1.4/lib/cli/ui/stdout_router.rb:151: syntax error, unexpected <<
            raise ArgumentError, <<~EOF
                                   ^
/usr/local/share/gems/gems/cli-ui-1.1.4/lib/cli/ui/stdout_router.rb:165: syntax error, unexpected keyword_ensure, expecting keyword_end
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/share/gems/gems/cli-ui-1.1.4/lib/cli/ui.rb:163:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:135:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /opt/benchware/profiles.rb:24:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from ./benchware.rb:28:in `<main>'
mjtko commented 6 years ago

Squiggly heredoc was added in Ruby 2.3 -- hence the error. Maybe just use a normal heredoc? i.e. reverse of what this article is talking about: https://infinum.co/the-capsized-eight/multiline-strings-ruby-2-3-0-the-squiggly-heredoc

ColonelPanics commented 6 years ago

@mjtko thanks for your comment however this is inside the cli-ui gem I suppose I could try testing an older version of that gem that perhaps supports the older versions of ruby

ColonelPanics commented 6 years ago

Have a look at using cli-ui-1.1.1