forked from vitaly/app_lego
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmisc.rb
40 lines (31 loc) · 857 Bytes
/
misc.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
35
36
37
38
39
40
# app files
file 'app/controllers/application_controller.rb', <<-APP
class ApplicationController < ActionController::Base
helper :all
protect_from_forgery
filter_parameter_logging "password" unless Rails.env.development?
#{"include HoptoadNotifier::Catcher" if File.exists?('vendor/plugins/hoptoad_notifier')}
end
APP
file 'app/helpers/application_helper.rb',
%q{module ApplicationHelper
def page_title(title=nil)
if title.nil?
@page_title ||= ""
else
@page_title = title
end
end
def body_class
"#{controller.controller_name} #{controller.controller_name}-#{controller.action_name}"
end
end
}
# initializers
initializer 'requires.rb',
%q{Dir[Rails.root.join('lib', '*.rb')].each do |f|
require f
end
}
git :add => "."
git :commit => "-a -m 'Added basic ApplicationController, helpers, initializers'"