$ bundle gem wrake
$ cd wrake
$ vi wrake.gemspec
- Fill in TODOs on description and summary
- Add 'rake' runtime depedency at the bottom
- spec.add_runtime_dependency "rake"
$ vi lib/wrake/Rakefile
# lib/wrake/Rakefile
desc "Prints 'hello'"
task :hello do
puts 'hello'
end
task default: :hello
$ mkdir bin
$ vi bin/wrake
#!/usr/bin/env ruby
# bin/wrake
require 'wrake'
rakefile = File.join(
File.expand_path(File.join(File.dirname(__FILE__), '..')),
'lib', 'wrake', 'Rakefile'
)
puts `rake -f #{rakefile} #{ARGV.join ' '}`
$ git add --all && git commit -m 'Initial commit'
$ bundle exec rake install
$ wrake -T
# rake hello # Prints 'hello'