visionmedia/terminal-table — pull request #9 by GRoguelon (2011-10-12 12:57:31+00:00)
Title: Warnings with ruby 1.9.2-p290

When I execute terminal-table with warnings option enabled, we get several warnings :

- `Warning: shadowing outer local variable - t` : On example file, i think that it's better to change the name variable t by v or other to avoid a confusion on the scopes.

```ruby
user_table = table do |v|
v.headings = 'First Name', 'Last Name', 'Email'
v << %w( TJ Holowaychuk tj@vision-media.ca )
v << %w( Bob Someone bob@vision-media.ca )
v << %w( Joe Whatever bob@vision-media.ca )
end
```

- `~/.rvm/gems/ruby-1.9.2-p290@CalculationTools/gems/terminal-table-1.4.2/lib/terminal-table/core_ext.rb:25: warning: '&' interpreted as argument prefix` : The only way that I found to solve this problem, is to add parentheses on '&block' to avoid confusion.

```ruby
class Object
def yield_or_eval &block
return unless block
if block.arity > 0
yield self
else
self.instance_eval(&block)
end
end
end
```

- `~/.rvm/gems/ruby-1.9.2-p290@CalculationTools/gems/terminal-table-1.4.2/lib/terminal-table/table.rb:32: warning: `&' interpreted as argument prefix` : idem

```ruby
def initialize options = {}, &block
@headings = options.fetch :headings, []
@rows = options.fetch :rows, []
yield_or_eval(&block) if block
end
```

- `~/.rvm/gems/ruby-1.9.2-p290@CalculationTools/gems/terminal-table-1.4.2/lib/terminal-table/table.rb:270: warning: method redefined; discarding old rows` : Rows is defined as instance variable with attr_accessor but the reader method is redefined manually line 270 so it's necessary to remove one.

```ruby
attr_writer :rows
```

Otherwise, it's a great tool, thanks lot.