title: How to pass array to class option of rails generator?
body: <p>I'm creating the following ruby class generator:</p>
  
  <pre><code>class Template &lt; Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)
  
    argument :name, type: 'string', required: true
    ...
    class_option :templates, type: 'array', default: [1, 2, 3, 4], aliases: '-t'
  
    private
    ...
  
  end
  </code></pre>
  
  <p>In the rails console I tried:</p>
  
  <pre><code>rails generate template test -t=1 2 
  rails generate template test -t 1 2 
  rails generate template test -t 1,2
  rails generate template test -t=1,2  
  rails generate template test -t=[1,2]
  rails generate template test -t [1,2]
  </code></pre>
  
  <p>but the generator is not working correctly. It seems that the input doesn't return an array, because the following private method is not working:</p>
  
  <pre><code>def should_be_template_rendered(param)
    options.templates.include? param
  end
  </code></pre>
  
  <p>Where <code>param</code> is simply a number. The result is that none of the templates are rendered at all. I have checked the <code>Thor</code> documentations <a href="http://textmate.rubyforge.org/thor/Thor/Base/ClassMethods.html" rel="nofollow">here</a> and <a href="https://github.com/erikhuda/thor/wiki" rel="nofollow">here</a>, but was not able to find an example on how the array is passed as argument.</p>