Class: Openstax::Accounts::ScheduleGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/openstax/accounts/schedule/schedule_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_scheduleObject



7
8
9
10
11
12
13
14
15
# File 'lib/generators/openstax/accounts/schedule/schedule_generator.rb', line 7

def generate_schedule
  if File.exists?(File.expand_path('config/schedule.rb'))
    File.open(File.expand_path('../templates/schedule.rb', __FILE__)) do |file|
      append_file 'config/schedule.rb', file.read
    end
  else
    copy_file 'schedule.rb', 'config/schedule.rb'
  end
end