Module: LearnGenerate::Helpers::TemplateHelper
- Included in:
- TemplateMaker
- Defined in:
- lib/learn_generate/helpers/template-helper.rb
Instance Method Summary collapse
- #command_line_helper ⇒ Object
- #fe_helper ⇒ Object
- #fundamental_helper ⇒ Object
- #js_helper ⇒ Object
- #kids_helper ⇒ Object
- #rake_helper ⇒ Object
- #sinatra_classic_helper ⇒ Object
- #sinatra_mvc_helper ⇒ Object
- #sql_helper ⇒ Object
Instance Method Details
#command_line_helper ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 10 def command_line_helper edit_file("bin/runner.rb", formatted_lab_name) edit_file("spec/spec_helper.rb", formatted_lab_name) edit_file("lib/environment.rb", formatted_lab_name) FileUtils.mv("lib/lab-name", "lib/#{lab_name}") edit_gemfile end |
#fe_helper ⇒ Object
40 41 42 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 40 def fe_helper edit_file('index.html', formatted_name) end |
#fundamental_helper ⇒ Object
4 5 6 7 8 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 4 def fundamental_helper change_filename('lib/', 'file.rb', 'rb') edit_file('spec/spec_helper.rb', formatted_lab_name) edit_gemfile end |
#js_helper ⇒ Object
36 37 38 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 36 def js_helper change_filename('js/', 'file.js', 'js') end |
#kids_helper ⇒ Object
44 45 46 47 48 49 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 44 def kids_helper change_filename('lib/', 'file.rb', 'rb') edit_file('spec/spec_helper.rb', formatted_lab_name) edit_spec("spec/#{formatted_lab_name}_spec.rb") edit_gemfile end |
#rake_helper ⇒ Object
22 23 24 25 26 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 22 def rake_helper change_filename('lib/', 'file.rb', 'rb') edit_file("config/environment.rb", formatted_lab_name) edit_gemfile end |
#sinatra_classic_helper ⇒ Object
32 33 34 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 32 def sinatra_classic_helper edit_classic_gemfile end |
#sinatra_mvc_helper ⇒ Object
28 29 30 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 28 def sinatra_mvc_helper edit_mvc_gemfile end |
#sql_helper ⇒ Object
18 19 20 |
# File 'lib/learn_generate/helpers/template-helper.rb', line 18 def sql_helper change_filename('lib/', 'sample.sql', 'sql') end |