Module: LearnGenerate::Helpers::TemplateHelper

Included in:
TemplateMaker
Defined in:
lib/learn_generate/helpers/template-helper.rb

Instance Method Summary collapse

Instance Method Details

#command_line_helperObject



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_helperObject



40
41
42
# File 'lib/learn_generate/helpers/template-helper.rb', line 40

def fe_helper
  edit_file('index.html', formatted_name)
end

#fundamental_helperObject



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_helperObject



36
37
38
# File 'lib/learn_generate/helpers/template-helper.rb', line 36

def js_helper
  change_filename('js/', 'file.js', 'js')
end

#kids_helperObject



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_helperObject



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_helperObject



32
33
34
# File 'lib/learn_generate/helpers/template-helper.rb', line 32

def sinatra_classic_helper
  edit_classic_gemfile
end

#sinatra_mvc_helperObject



28
29
30
# File 'lib/learn_generate/helpers/template-helper.rb', line 28

def sinatra_mvc_helper
  edit_mvc_gemfile
end

#sql_helperObject



18
19
20
# File 'lib/learn_generate/helpers/template-helper.rb', line 18

def sql_helper
  change_filename('lib/', 'sample.sql', 'sql')
end