lib/ruby_less/processor.rb in rubyless-0.8.4 vs lib/ruby_less/processor.rb in rubyless-0.8.5
- old
+ new
@@ -398,18 +398,32 @@
{:class => lit_class, :literal => lit}
end
def args_with_prepend(args, opts)
if prepend_args = opts[:prepend_args]
+ if prepend_args.kind_of?(Array)
+ prepend_args = array_to_arguments(prepend_args)
+ end
if args
prepend_args.append_argument(args)
args = prepend_args
else
args = prepend_args
end
end
+ if append_args = opts[:append_args]
+ if append_args.kind_of?(Array)
+ append_args = array_to_arguments(append_args)
+ end
+ if args
+ args.append_argument(append_args)
+ else
+ args = append_args
+ end
+ end
+
if append_hash = opts[:append_hash]
last_arg = args.list.last
unless last_arg.klass.kind_of?(Hash)
last_arg = t "", String
args.append_argument(last_arg)
@@ -419,8 +433,16 @@
end
last_arg.rebuild_hash
args.rebuild_arguments
end
args
+ end
+
+ def array_to_arguments(args)
+ code = t('')
+ args.each do |arg|
+ code.append_argument(arg)
+ end
+ code
end
end
end