Sha256: 173fc437177ab40dda10ecfd4d2b9910053ab48a36c8c824838896834c218305

Contents?: true

Size: 577 Bytes

Versions: 17

Compression:

Stored size: 577 Bytes

Contents

# Can't use OpenStax. See https://github.com/rails/rails/issues/13856
module Openstax
  module Accounts
    class ScheduleGenerator < Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)

      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
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
openstax_accounts-6.1.1 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-6.1.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-6.0.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-5.2.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-5.1.2 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-5.1.1 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-5.1.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-5.0.1 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-5.0.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-4.1.1 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-4.1.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-4.0.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-3.1.1 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-3.1.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-3.0.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-2.0.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb
openstax_accounts-1.0.0 lib/generators/openstax/accounts/schedule/schedule_generator.rb