Class: RurGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_rur_routesObject


9
10
11
12
13
14
15
16
# File 'lib/generators/rur/rur_generator.rb', line 9

def add_rur_routes
  rur_route =  "  scope :rur do\n"
  rur_route += "    \# Rur for all folders\n"
  rur_route += "    get '/' => 'high_voltage/pages#show', id: 'home'\n"
  rur_route += "  end\n"

  route(rur_route)
end

#append_rur_gitignoreObject


18
19
20
# File 'lib/generators/rur/rur_generator.rb', line 18

def append_rur_gitignore
  append_to_file('.gitignore', "\n# Rur views\napp/views/rur")
end

#copy_rur_fileObject


4
5
6
7
# File 'lib/generators/rur/rur_generator.rb', line 4

def copy_rur_file
  copy_file "high_voltage.rb", "config/initializers/high_voltage.rb"
  copy_file "home.html.erb", "app/views/rur/home.html.erb"
end