<NME> tasks.rb
<BEF> #!/usr/bin/env nake
# encoding: utf-8

begin
  require "nake/tasks/gem"
  require "nake/tasks/spec"
  require "nake/tasks/release"
rescue LoadError
  abort "You need nake gem!"
end

require_relative "lib/rango/version"

# ENV setup for external commands
ENV["RUBYLIB"] = Dir["gems/gems/*/lib"].join(":")
$LOAD_PATH.clear.push(*Dir["gems/gems/*/lib"])

# Setup encoding, so all the operations
# with strings from another files will work

Task[:build].config[:gemspec] = "rango.gemspec"
Task[:prerelease].config[:gemspec] = "rango.pre.gemspec"
Task[:release].config[:name] = "rango"
Task[:release].config[:version] = Rango::VERSION

# http://github.com/somebee/rbench/tree/master
Task.new(:bm) do |task|
  task.description = "Run all benchmarks"
  task.define do
    abort "Benchmarks doesn't work at the moment"
    require "rbench"
    Dir["#{Dir.pwd}/benchmarks/bm/*.rb"].each do |benchmark|
      load benchmark
    end
  end
end

<MSG> Use code-cleaner for ensuring better quality of code without trailing whitespace etc

<DFF> @@ -1,19 +1,33 @@
-#!/usr/bin/env nake
+#!./script/nake
 # encoding: utf-8
 
 begin
-  require "nake/tasks/gem"
-  require "nake/tasks/spec"
-  require "nake/tasks/release"
+  require_relative "gems/environment.rb"
 rescue LoadError
-  abort "You need nake gem!"
+  abort "You have to install bundler and run gem bundle first!"
 end
 
-require_relative "lib/rango/version"
+ENV["PATH"] = "script:#{ENV["PATH"]}"
+
+require "nake/tasks/gem"
+require "nake/tasks/spec"
+require "nake/tasks/release"
+
+load "code-cleaner.nake"
+Task["hooks:whitespace:install"].define do
+  ARGV.clear.push(".git/hooks/pre-commit")
+  ARGF.inplace_mode = ""
+  while line = ARGF.gets
+    puts %{export PATH="script:$PATH"} if ARGF.lineno.eql?(2)
+    puts line
+  end
+end
+
+unless File.exist?(".git/hooks/pre-commit")
+  warn "If you want to contribute to Rango, please run ./tasks.rb hooks:whitespace:install to get Git pre-commit hook for removing trailing whitespace"
+end
 
-# ENV setup for external commands
-ENV["RUBYLIB"] = Dir["gems/gems/*/lib"].join(":")
-$LOAD_PATH.clear.push(*Dir["gems/gems/*/lib"])
+require_relative "lib/rango/version"
 
 # Setup encoding, so all the operations
 # with strings from another files will work

Use code-cleaner for ensuring better quality of code without trailing whitespace etc