@@ -49,7 +49,7 @@ def convert
49
49
50
50
Dir . mktmpdir do |target_path |
51
51
command = build_command ( tmp_pipe_path , target_path )
52
- target_tmp_file = execute_command ( command , target_path )
52
+ target_tmp_file = execute_command ( command , target_path , RUBY_PLATFORM =~ /java/ )
53
53
54
54
FileUtils . cp target_tmp_file , @target
55
55
end
@@ -63,9 +63,13 @@ def convert
63
63
# @param [String] target_path
64
64
# @return [String]
65
65
# @raise [ConversionFailedError] When soffice command execution error.
66
- def execute_command ( command , target_path )
67
- opts = RUBY_PLATFORM =~ /java/ ? { } : { unsetenv_others : true }
68
- output , error , status = Open3 . capture3 command_env , *command , opts
66
+ def execute_command ( command , target_path , is_jruby = false )
67
+ output , error , status =
68
+ if is_jruby
69
+ Open3 . capture3 command_env , *command
70
+ else
71
+ Open3 . capture3 command_env , *command , unsetenv_others : true
72
+ end
69
73
70
74
target_tmp_file = File . join ( target_path , target_filename )
71
75
return target_tmp_file if status . success? && File . exist? ( target_tmp_file )
@@ -81,7 +85,7 @@ def command_env
81
85
82
86
# @param [String] tmp_pipe_path
83
87
# @param [String] target_path
84
- # @return [Array]
88
+ # @return [Array<String> ]
85
89
def build_command ( tmp_pipe_path , target_path )
86
90
[
87
91
soffice_command ,
0 commit comments