Class: FileWriter

Inherits:
Object
  • Object
show all
Includes:
Templatable
Defined in:
lib/ez_gen/file_writer.rb

Instance Method Summary collapse

Methods included from Templatable

#class_template, #generator_template, #pr_template, #rake_template, #readme_template, #test_helper_template, #test_template

Constructor Details

#initialize(args) ⇒ FileWriter

Returns a new instance of FileWriter.



5
6
7
8
# File 'lib/ez_gen/file_writer.rb', line 5

def initialize(args)
  @lower_name = args.last
  @upper_name = @lower_name.split('_').map(&:capitalize).join
end

Instance Method Details

#writeObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/ez_gen/file_writer.rb', line 10

def write
  write_rake
  write_test_helper
  write_class_template
  write_test_file
  write_generator
  write_readme
  write_pr_template
  write_gitignore
end