Class: Eyeballs::ControllerGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
AppDetector, Thor::Actions
Defined in:
lib/eyeballs/controller_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AppDetector

#app_path, #new_app_path, #prefix, #public_path, #rack_app?

Class Method Details

.source_rootObject



10
11
12
# File 'lib/eyeballs/controller_generator.rb', line 10

def self.source_root
  File.join(File.dirname(__FILE__), '..', '..')
end

Instance Method Details

#build_the_modelObject



18
19
20
21
# File 'lib/eyeballs/controller_generator.rb', line 18

def build_the_model
  template "templates/controller.js", "#{app_path}/app/controllers/#{name.downcase}_controller.js"
  empty_directory "#{app_path}/app/views/#{name.downcase}"
end

#farewellObject



23
24
25
# File 'lib/eyeballs/controller_generator.rb', line 23

def farewell
  $stdout.puts "Your controller is ready to rule!"
end

#greetingObject



14
15
16
# File 'lib/eyeballs/controller_generator.rb', line 14

def greeting
  $stdout.puts "Creating new eyeballs.js controller #{name.pluralize}Controller"
end