Sha256: 69de27b3496efd341237550f0efafdfa74ec4a36f76c92bf3d5ee5378d930439

Contents?: true

Size: 911 Bytes

Versions: 10

Compression:

Stored size: 911 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'rails/generators'

class BrowseEverything::ConfigGenerator < Rails::Generators::Base
  desc <<-END_OF_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
  END_OF_DESC
  source_root File.expand_path('../templates', __FILE__)

  def inject_routes
    insert_into_file 'config/routes.rb', after: '.draw do' do
      %(
        mount BrowseEverything::Engine => '/browse')
    end
  end

  def copy_example_config
    copy_file 'browse_everything_providers.yml.example', 'config/browse_everything_providers.yml'
  end

  def insert_file_system_path
    insert_into_file 'config/browse_everything_providers.yml', before: '# dropbox:' do
      YAML.dump('file_system' => { home: Rails.root.to_s })
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
browse-everything-0.15.1 lib/generators/browse_everything/config_generator.rb
browse-everything-0.15.0 lib/generators/browse_everything/config_generator.rb
browse-everything-0.14.2 lib/generators/browse_everything/config_generator.rb
browse-everything-0.14.1 lib/generators/browse_everything/config_generator.rb
browse-everything-0.14.0 lib/generators/browse_everything/config_generator.rb
browse-everything-0.13.1 lib/generators/browse_everything/config_generator.rb
browse-everything-0.13.0 lib/generators/browse_everything/config_generator.rb
browse-everything-0.12.0 lib/generators/browse_everything/config_generator.rb
browse-everything-0.11.1 lib/generators/browse_everything/config_generator.rb
browse-everything-0.11.0 lib/generators/browse_everything/config_generator.rb