|
Revision 1215, 0.8 kB
(checked in by e.@brainspl.at, 11 months ago)
|
add support for generators for PartControllers? closes #416 [siebertm85@googlemail.com]
|
| Line | |
|---|
| 1 |
require 'fileutils' |
|---|
| 2 |
|
|---|
| 3 |
# Must set before requiring generator libs. |
|---|
| 4 |
TMP_ROOT = File.dirname(__FILE__) + "/tmp" unless defined?(TMP_ROOT) |
|---|
| 5 |
PROJECT_NAME = "myproject" unless defined?(PROJECT_NAME) |
|---|
| 6 |
app_root = File.join(TMP_ROOT, PROJECT_NAME) |
|---|
| 7 |
if defined?(APP_ROOT) |
|---|
| 8 |
APP_ROOT.replace(app_root) |
|---|
| 9 |
else |
|---|
| 10 |
APP_ROOT = app_root |
|---|
| 11 |
end |
|---|
| 12 |
|
|---|
| 13 |
begin |
|---|
| 14 |
require 'rubigen' |
|---|
| 15 |
rescue LoadError |
|---|
| 16 |
require 'rubygems' |
|---|
| 17 |
require 'rubigen' |
|---|
| 18 |
end |
|---|
| 19 |
require 'rubigen/helpers/generator_test_helper' |
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
def directory_should_be_created(directory) |
|---|
| 23 |
File.should be_exist(File.join(APP_ROOT, directory)) |
|---|
| 24 |
File.should be_directory(File.join(APP_ROOT, directory)) |
|---|
| 25 |
end |
|---|
| 26 |
|
|---|
| 27 |
def file_should_be_created(file) |
|---|
| 28 |
File.should be_exist(File.join(APP_ROOT, file)) |
|---|
| 29 |
File.should be_file(File.join(APP_ROOT, file)) |
|---|
| 30 |
end |
|---|
| 31 |
|
|---|
| 32 |
def file_should_be_executable(file) |
|---|
| 33 |
File.should be_executable(File.join(APP_ROOT, file)) |
|---|
| 34 |
end |
|---|