Class: ClearanceFeaturesGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/rails/generators/clearance_features_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



4
5
6
# File 'lib/rails/generators/clearance_features_generator.rb', line 4

def self.source_root
  @_clearance_source_root ||= File.join(File.dirname(__FILE__), "clearance_features_templates")
end

Instance Method Details

#installObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rails/generators/clearance_features_generator.rb', line 8

def install
  directory "features"

  inject_into_file "features/support/paths.rb", :after => "# Add more mappings here.\n" do
"    when /the sign up page/i
    sign_up_path
  when /the sign in page/i
    sign_in_path
  when /the password reset request page/i
    new_password_path\n"
  end
end