class MakeItSo::GosuAppGenerator
Public Class Methods
source_root()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 65 def self.source_root template_path = File.join( File.dirname(__FILE__), "..", "..", "templates", "gosu") File.expand_path(template_path) end
Public Instance Methods
app_file()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 25 def app_file file_path = 'app.rb' template(file_path, File.join(app_path, file_path)) end
directories()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 15 def directories [ 'lib', 'spec', 'img' ].each do |dir| empty_directory File.join(app_path, dir) end end
gemfile()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 45 def gemfile file_path = 'Gemfile' template(file_path, File.join(app_path, file_path)) end
gitignore()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 50 def gitignore file_path = '.gitignore' template(file_path, File.join(app_path, file_path)) end
lib()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 36 def lib [ 'lib/keys.rb', 'lib/bounding_box.rb' ].each do |file_path| template(file_path, File.join(app_path, file_path)) end end
readme()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 30 def readme inside app_path do create_file "README.md", "# README\n\n" end end
rspec()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 55 def rspec if options.rspec? spec_helper = 'spec/spec_helper.rb' template(spec_helper, File.join(app_path, spec_helper)) dot_rspec = '.rspec' template(dot_rspec, File.join(app_path, dot_rspec)) end end
Protected Instance Methods
app_path()
click to toggle source
# File lib/generators/gosu_app_generator.rb, line 77 def app_path name end