Class: Eyeballs::ModelGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
AppDetector, Thor::Actions
Defined in:
lib/eyeballs/model_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



9
10
11
# File 'lib/eyeballs/model_generator.rb', line 9

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

Instance Method Details

#build_the_modelObject



17
18
19
# File 'lib/eyeballs/model_generator.rb', line 17

def build_the_model
  template "templates/model.js", "#{app_path}/app/models/#{name.downcase}.js"
end

#farewellObject



21
22
23
# File 'lib/eyeballs/model_generator.rb', line 21

def farewell
  $stdout.puts "Your model is ready to rock!"
end

#greetingObject



13
14
15
# File 'lib/eyeballs/model_generator.rb', line 13

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