public
Description: Code smell detector for Ruby
Home | Edit | New

Non-ASCII source files

Reek doesn’t offer a direct way to specify that your source file is encoded as UTF-8 etc, but there is a workaround if you need it:

The Reek gem includes the class Reek::RakeTask, which makes it easy to run Reek from a rakefile. And this task has an attribute ruby_opts, which is an array of strings to be passed as arguments directly to the Ruby interpreter. So you can use Reek to check for smells in non-ASCII files by adding something like this to your rakefile:

require 'reek/rake_task'

Reek::RakeTask.new(‘utf8_file’) do |t|
t.source_files = “my_utf8_file.rb”
t.ruby_opts = [“-Ku”]
end


If this approach is inconvenient for you, consider raising a ticket to request either a -K or a --ruby-opts command-line option.

Last edited by kevinrutherford, Sat Sep 12 13:15:29 -0700 2009
Home | Edit | New
Versions: