1
0
mirror of https://github.com/thangisme/notes.git synced 2024-12-22 14:16:32 -05:00
notes/bin/just-the-docs
2017-06-04 17:49:20 -04:00

28 lines
754 B
Ruby

#!/usr/bin/env ruby
# Run rake tasks
# from my_gem once it's installed.
#
# Example:
#
# my_gem rake some-task
# my_gem rake some-task[args]
#
# Note: cucumber features have '.feature' appended automatically,
# no need for you to do it ;)
#
# Author:: N David Brown
gem_dir = File.expand_path("..",File.dirname(__FILE__))
$LOAD_PATH.unshift gem_dir# Look in gem directory for resources first.
exec_type = ARGV[0]
if exec_type == 'rake' then
require 'rake'
require 'pp'
pwd=Dir.pwd
Dir.chdir(gem_dir) # We'll load rakefile from the gem's dir.
Rake.application.init
Rake.application.load_rakefile
Dir.chdir(pwd) # Revert to original pwd for any path args passed to task.
Rake.application.invoke_task(ARGV[1])
end