Class: MakeItSo::GosuAppGenerator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- MakeItSo::GosuAppGenerator
- Includes:
- Thor::Actions
- Defined in:
- lib/generators/gosu_app_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #app_file ⇒ Object
- #directories ⇒ Object
- #gemfile ⇒ Object
- #gitignore ⇒ Object
- #lib ⇒ Object
- #readme ⇒ Object
- #rspec ⇒ Object
Class Method Details
.source_root ⇒ Object
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/generators/gosu_app_generator.rb', line 65 def self.source_root template_path = File.join( File.dirname(__FILE__), "..", "..", "templates", "gosu") File.(template_path) end |
Instance Method Details
#app_file ⇒ Object
25 26 27 28 |
# 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 ⇒ Object
15 16 17 18 19 20 21 22 23 |
# 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 ⇒ Object
45 46 47 48 |
# 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 ⇒ Object
50 51 52 53 |
# 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 ⇒ Object
36 37 38 39 40 41 42 43 |
# 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 ⇒ Object
30 31 32 33 34 |
# 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 ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/generators/gosu_app_generator.rb', line 55 def rspec if .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 |