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
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/generators/gosu_app_generator.rb', line 64 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
44 45 46 47 |
# File 'lib/generators/gosu_app_generator.rb', line 44 def gemfile file_path = 'Gemfile' template(file_path, File.join(app_path, file_path)) end |
#gitignore ⇒ Object
49 50 51 52 |
# File 'lib/generators/gosu_app_generator.rb', line 49 def gitignore file_path = '.gitignore' template(file_path, File.join(app_path, file_path)) end |
#lib ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/generators/gosu_app_generator.rb', line 35 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 |
# File 'lib/generators/gosu_app_generator.rb', line 30 def readme file_path = 'README.md' template(file_path, File.join(app_path, file_path)) end |
#rspec ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/generators/gosu_app_generator.rb', line 54 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 |