forked from eadz/typus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
34 lines (25 loc) · 822 Bytes
/
init.rb
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
require 'typus'
require 'sha1'
##
# Load paths. (This will be the first thing I'll remove once
# Rails 2.3/3 is released.)
#
unless Rails.version == '2.3.0'
ActionController::Base.append_view_path(File.join(File.dirname(__FILE__), 'app', 'views'))
%w( models controllers helpers ).each do |folder|
ActiveSupport::Dependencies.load_paths << File.join(File.dirname(__FILE__), 'app', folder)
end
end
if Rails.env.test?
Typus::Configuration.options[:config_folder] = 'vendor/plugins/typus/test/config/working'
end
##
# Typus.enable and run the generator unless we are testing the plugin.
# Do not Typus.enable or generate files if we are running a rails
# generator.
#
scripts = %w( script/generate script/destroy )
unless scripts.include?($0)
Typus.enable
Typus.generator unless Rails.env.test?
end