Permalink
Browse files

fixed bug where boolean should really be TRUE or FALSE rather than 1 …

…or 0
  • Loading branch information...
1 parent eb211ec commit 57ce6bebb23c22ae92acd428b2c0d23bf58e5405 @rdulepet committed Feb 23, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 job.rb
View
6 job.rb
@@ -96,6 +96,12 @@ def fetch_params
#@r_call_interface.assign(job_params[PARAM_NAME], job_params[PARAM_VALUE].to_s)
r_script_inc_file_handle.puts "#{job_params[PARAM_NAME]} = \"#{job_params[PARAM_VALUE].to_s}\""
Global.logger.info("R_PARAMETER::#{job_params[PARAM_NAME]} = #{job_params[PARAM_VALUE]}")
+ elsif job_params[PARAM_KIND] == VALUE_BOOLEAN
+ #@r_call_interface.assign(job_params[PARAM_NAME], job_params[PARAM_VALUE].to_s)
+ bool_val = "TRUE"
+ bool_val = "FALSE" if job_params[PARAM_VALUE].to_i == 0
+ r_script_inc_file_handle.puts "#{job_params[PARAM_NAME]} = #{bool_val}"
+ Global.logger.info("R_PARAMETER::#{job_params[PARAM_NAME]} = #{bool_val}")
else
#@r_call_interface.assign(job_params[PARAM_NAME], job_params[PARAM_VALUE].to_f)
r_script_inc_file_handle.puts "#{job_params[PARAM_NAME]} = #{job_params[PARAM_VALUE].to_f}"

0 comments on commit 57ce6be

Please sign in to comment.