Class: Botup::FileProcessor
- Inherits:
-
Object
- Object
- Botup::FileProcessor
- Defined in:
- lib/botup/file_processor.rb
Instance Attribute Summary collapse
-
#base_name ⇒ Object
readonly
Returns the value of attribute base_name.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(base_name) ⇒ FileProcessor
constructor
A new instance of FileProcessor.
Constructor Details
#initialize(base_name) ⇒ FileProcessor
9 10 11 |
# File 'lib/botup/file_processor.rb', line 9 def initialize(base_name) @base_name = base_name end |
Instance Attribute Details
#base_name ⇒ Object (readonly)
Returns the value of attribute base_name.
7 8 9 |
# File 'lib/botup/file_processor.rb', line 7 def base_name @base_name end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/botup/file_processor.rb', line 13 def call prepare_files populate_basic_templates(templates_folder, output_main_folder) populate_bot_named_files("#{templates_folder}/core_file.erb", "#{output_lib_folder}/#{base_name}.rb") populate_bot_named_files("#{bin_folder}/exec.erb", "#{output_folder}/bin/#{base_name}") FileUtils.chmod('+x', "#{output_folder}/bin/#{base_name}") end |