Class: Eulerplate::Generators::ProblemKit

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/eulerplate/generators/problem_kit.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



8
9
10
# File 'lib/eulerplate/generators/problem_kit.rb', line 8

def self.source_root
  File.dirname(__FILE__) + "/templates"
end

Instance Method Details

#create_class_fileObject



16
17
18
# File 'lib/eulerplate/generators/problem_kit.rb', line 16

def create_class_file
  template("class_file.rb", "#{problem.folder_name}/#{problem.class_file_name}")
end

#create_folderObject



12
13
14
# File 'lib/eulerplate/generators/problem_kit.rb', line 12

def create_folder
  empty_directory(problem.folder_name)
end

#create_spec_fileObject



20
21
22
# File 'lib/eulerplate/generators/problem_kit.rb', line 20

def create_spec_file
  template("spec_file.rb", "#{problem.folder_name}/#{problem.spec_file_name}")
end