lib/clamp/subcommand/parsing.rb in clamp-0.3.0 vs lib/clamp/subcommand/parsing.rb in clamp-0.3.1

- old
+ new

@@ -26,17 +26,16 @@ def instatiate_subcommand(name) subcommand_class = find_subcommand(name).subcommand_class subcommand = subcommand_class.new("#{invocation_path} #{name}", context) self.class.recognised_options.each do |option| - option_set = instance_variable_defined?(option.ivar_name) - if option_set && subcommand.respond_to?(option.write_method) - subcommand.send(option.write_method, self.send(option.read_method)) + if instance_variable_defined?(option.ivar_name) + subcommand.instance_variable_set(option.ivar_name, instance_variable_get(option.ivar_name)) end end subcommand end end end -end \ No newline at end of file +end