Class: Eastrails::Components::Devise
- Defined in:
- lib/eastrails/components/devise.rb
Instance Method Summary collapse
Methods inherited from Base
#component_installed?, #dir_html_to_haml, #do_if_installed, #file_html_to_haml, #gems, #html_to_haml, #parse_gemfile
Methods inherited from Generator
Constructor Details
This class inherits a constructor from Eastrails::Generator
Instance Method Details
#add ⇒ Object
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 41 42 43 44 |
# File 'lib/eastrails/components/devise.rb', line 6 def add unless gems.include?("devise") gem 'devise' system 'bundle install' system 'rails g devise:install' system 'rails g devise User' end if File.directory?("spec") FileUtils.mkdir_p("spec/support") create_file 'spec/support/devise.rb' do "RSpec.configure do |config|\n config.include Devise::TestHelpers, :type => :controller\nend\n RUBY\n end\n end\n\n unless File.directory?(\"app/views/devise\")\n directory \"devise\", \"app/views/devise\"\n\n if gems.include?(\"haml\") || gems.include?(\"haml-rails\")\n dir_html_to_haml(\"app/views/devise\")\n end\n end\n\n erb_navigation_content = File.read(\n File.expand_path(find_in_source_paths(\"navigation/devise.html.erb\")))\n if File.exists?(\"app/views/layouts/_navigation.html.erb\")\n append_file(\"app/views/layouts/_navigation.html.erb\") do\n erb_navigation_content\n end\n elsif File.exists?(\"app/views/layouts/_navigation.html.haml\")\n append_file(\"app/views/layouts/_navigation.html.haml\") do\n html_to_haml(erb_navigation_content)\n end\n end\nend\n" |