/
Rakefile
39 lines (32 loc) · 891 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# encoding: utf-8
unless ''.respond_to?(:encoding)
puts "[!] Sorry, but this code was written for Ruby 1.9 compatible implementations."
exit 1
end
require 'rdoc/task'
require 'rbconfig'
desc 'Run specs by default'
task :default => :spec
desc 'Run all specs'
task :spec do
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'ruby_install_name'))
FileList[File.expand_path('../spec/**/*_spec.rb', __FILE__)].each do |spec|
sh "#{ruby} #{spec}"
end
end
namespace :documentation do
Rake::RDocTask.new(:generate) do |rd|
rd.main = "README.rdoc"
rd.rdoc_files.include("README.rdoc", "LICENSE", "lib/**/*.rb")
rd.options << "--all" << "--charset" << "utf-8"
end
end
namespace :gem do
desc "Build the gem"
task :build do
sh 'gem build ensure-encoding.gemspec'
end
task :install => :build do
sh 'gem install ensure-encoding-*.gem'
end
end