Class: Bin::BinGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/bin/bin_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_filesObject



8
9
10
11
12
13
14
# File 'lib/generators/bin/bin_generator.rb', line 8

def add_files
  file_name.sub!('_script', '')
  template "script.rb", "bin/#{file_path}"
  template "script_class.rb", "app/bins/#{file_path}_script.rb"
  template "spec.rb", "spec/bins/#{file_path}_script_spec.rb"
  chmod "bin/#{file_path}", 0755
end