lib/diffend/voting/versions/remote.rb in diffend-0.2.28 vs lib/diffend/voting/versions/remote.rb in diffend-0.2.29

- old
+ new

@@ -161,13 +161,18 @@ # Build host command information # # @return [Hash] def build_host_command if File.exist?($PROGRAM_NAME) - array = `ps -p #{Process.pid} -o command=`.strip.split(' ') - array.shift if array.first.end_with?('bin/ruby') - name = array.shift.split('/').last.strip - command = "#{name} #{array.join(' ')}" + if defined?(JRUBY_VERSION) + name = $PROGRAM_NAME.split('/').last.strip + command = "#{name} #{ARGV.join(' ')}" + else + array = `ps -p #{Process.pid} -o command=`.strip.split(' ') + array.shift if array.first.end_with?('bin/ruby') + name = array.shift.split('/').last.strip + command = "#{name} #{array.join(' ')}" + end { 'name' => command, 'title' => '' } else { 'name' => ARGV.join(' '), 'title' => $PROGRAM_NAME } end