class Embryo::DeviseGenerator

Public Instance Methods

install() click to toggle source
# File lib/generators/embryo/devise.rb, line 7
def install
  gem "devise"
  create_file "spec/support/devise.rb", devise_helper_data
  update_environments
end

Private Instance Methods

devise_helper_data() click to toggle source
# File lib/generators/embryo/devise.rb, line 15
    def devise_helper_data
'RSpec.configure do |config|
  config.include Devise::TestHelpers, type: :controller
end
'
    end
update_environments() click to toggle source
# File lib/generators/embryo/devise.rb, line 22
    def update_environments
      ["development", "test"].each do |env|
        if File.exist? "config/environments/#{env}.rb"
          inject_into_file "config/environments/#{env}.rb", before: "end\n" do
            '
  config.action_mailer.default_url_options = { host: "localhost" }
'
          end
        end
      end
    end