From 70a439d6cde3d1f2d1a3ad2c082112f8e552302b Mon Sep 17 00:00:00 2001 From: martinahansen Date: Tue, 22 Nov 2011 15:24:57 +0000 Subject: [PATCH] got rid of nasty to_sym in biopieces.rb git-svn-id: http://biopieces.googlecode.com/svn/trunk@1678 74ccb610-7750-0410-82ae-013aeee3265d --- code_ruby/lib/maasha/biopieces.rb | 2 +- code_ruby/test/maasha/test_biopieces.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code_ruby/lib/maasha/biopieces.rb b/code_ruby/lib/maasha/biopieces.rb index 1d1deb5..7b42b54 100644 --- a/code_ruby/lib/maasha/biopieces.rb +++ b/code_ruby/lib/maasha/biopieces.rb @@ -355,7 +355,7 @@ class OptionHandler end when 'string' option.on("-#{cast[:short]}", "--#{cast[:long]} S", String) do |s| - @options[cast[:long]] = s.to_sym # TODO: this to_sym - is that needed? + @options[cast[:long]] = s end when REGEX_LIST option.on( "-#{cast[:short]}", "--#{cast[:long]} A", Array) do |a| diff --git a/code_ruby/test/maasha/test_biopieces.rb b/code_ruby/test/maasha/test_biopieces.rb index af33967..cc77410 100755 --- a/code_ruby/test/maasha/test_biopieces.rb +++ b/code_ruby/test/maasha/test_biopieces.rb @@ -231,7 +231,7 @@ class BiopiecesTest < Test::Unit::TestCase argv = ["--foo", "bleh", "-I", DUMMY_FILE] casts = [{:long=>"foo", :short=>"f", :type=>"string", :mandatory=>false, :default=>"bar", :allowed=>nil, :disallowed=>nil}] options = Biopieces.options_parse(argv, casts, SCRIPT_PATH) - assert_equal(options[:foo], "bleh".to_sym) + assert_equal(options[:foo], "bleh") end def test_Biopieces_options_parse_with_mandatory_cast_and_no_argument_raises -- 2.39.5