Sha256: a4fcef7b700648cbb16dc5fd88df8f1620d7bf9d24112dd95e9162e8eb9e3fe3
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true require 'rails/generators' class BrowseEverything::ConfigGenerator < Rails::Generators::Base desc <<-DESC This generator makes the following changes to your application: 1. Creates config/browse_everything_providers.yml with a placeholder value 2. Modifies your app's routes.rb to mount BrowseEverything at /browse DESC source_root File.expand_path('templates', __dir__) def inject_routes insert_into_file 'config/routes.rb', after: '.draw do' do %( mount BrowseEverything::Engine => '/browse') end end def copy_example_config FileUtils.rm 'config/browse_everything_providers.yml', force: true if File.exists? 'config/browse_everything_providers.yml' copy_file 'browse_everything_providers.yml.example', 'config/browse_everything_providers.yml', force: true end def insert_file_system_path insert_into_file 'config/browse_everything_providers.yml', before: '# dropbox:' do "file_system:\n home: #{Rails.root}\n" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
browse-everything-0.16.0 | lib/generators/browse_everything/config_generator.rb |