avo-setup 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/avo-setup/version.rb +1 -1
- data/lib/generators/avo/layout_generator.rb +8 -0
- metadata +2 -2
data/lib/avo-setup/version.rb
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
module Avo
|
2
2
|
module Generators
|
3
3
|
class LayoutGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path("../templates", __FILE__)
|
4
5
|
argument :layout_name, :type => :string, :default => "application"
|
5
6
|
class_option :stylesheet, :type => :boolean, :default => true, :desc => "Include stylesheet file."
|
6
7
|
|
7
8
|
def generate_layout
|
8
9
|
copy_file "stylesheet.css", "public/stylesheets/#{file_name}.css" if options.stylesheet?
|
9
10
|
template "layout.html.erb", "app/views/layouts/#{file_name}.html.erb"
|
11
|
+
if yes?("Would you like to install Devise?")
|
12
|
+
gem("devise")
|
13
|
+
generate("devise:install")
|
14
|
+
model_name = ask("What would you like the user model to be called? [user]")
|
15
|
+
model_name = "user" if model_name.blank?
|
16
|
+
generate("devise", model_name)
|
17
|
+
end
|
10
18
|
end
|
11
19
|
|
12
20
|
private
|