Skip to content

Commit 29ae76a

Browse files
committed
Making the Rakefile have the standard merb app tasks
1 parent fef31d3 commit 29ae76a

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

chef-server/Rakefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- ruby -*-
22
require 'rubygems'
33
require 'rake/gempackagetask'
4+
require 'rake/rdoctask'
45

56
GEM = "chef-server"
67
VERSION = "0.0.1"
@@ -45,4 +46,40 @@ task :install => [:package] do
4546
sh %{sudo gem install pkg/#{GEM}-#{VERSION} --no-rdoc --no-ri}
4647
end
4748

49+
require 'merb-core'
50+
require 'merb-core/tasks/merb'
51+
52+
include FileUtils
53+
54+
# Load the basic runtime dependencies; this will include
55+
# any plugins and therefore plugin rake tasks.
56+
init_env = ENV['MERB_ENV'] || 'rake'
57+
Merb.load_dependencies(
58+
:environment => init_env,
59+
:init_file => File.join(File.dirname(__FILE__), "lib", "init.rb")
60+
)
61+
62+
# Get Merb plugins and dependencies
63+
Merb::Plugins.rakefiles.each { |r| require r }
64+
65+
# Load any app level custom rakefile extensions from lib/tasks
66+
tasks_path = File.join(File.dirname(__FILE__), "lib", "tasks")
67+
rake_files = Dir["#{tasks_path}/*.rake"]
68+
rake_files.each{|rake_file| load rake_file }
69+
70+
desc "Start runner environment"
71+
task :merb_env do
72+
Merb.start_environment(
73+
:environment => init_env,
74+
:adapter => 'runner',
75+
:init_file => File.join(File.dirname(__FILE__), "lib", "init.rb")
76+
)
77+
end
78+
79+
require 'spec/rake/spectask'
80+
require 'merb-core/test/tasks/spectasks'
81+
desc 'Default: run spec examples'
82+
task :default => 'spec'
83+
84+
4885
# vim: syntax=Ruby

0 commit comments

Comments
 (0)