Fix brackets and don't execute ruby_block if scratch_dir is local