Class: Eyeballs::AppGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
AppDetector, Thor::Actions
Defined in:
lib/eyeballs/app_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/app_generator.rb', line 10

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

Instance Method Details

#build_the_appObject



18
19
20
21
22
23
24
25
# File 'lib/eyeballs/app_generator.rb', line 18

def build_the_app
  directory "templates/app_root", new_app_path
  copy_file 'dist/jquery/jquery-1.4.2.min.js', "#{new_app_path}/vendor/jquery/jquery-1.4.2.min.js"
  copy_file 'dist/mustache/mustache.0.3.0.js', "#{new_app_path}/vendor/mustache/mustache.0.3.0.js"
  copy_file 'dist/jquery/jquery.ba-bbq.min.js', "#{new_app_path}/vendor/jquery/jquery.ba-bbq.min.js"
  directory "src", "#{new_app_path}/vendor/eyeballs/"
  template "templates/initializer.js", "#{new_app_path}/config/initializer.js"
end

#farewellObject



27
28
29
# File 'lib/eyeballs/app_generator.rb', line 27

def farewell      
  $stdout.puts "Thank you for installing eyeballs.js"
end

#greetingObject



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

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