Sha256: 2b5e0289e60e25bd4f36f60ab47e58c0e44a5a2e05a2eecc47e432b2ff21fd45

Contents?: true

Size: 905 Bytes

Versions: 11

Compression:

Stored size: 905 Bytes

Contents

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

class BrowseEverything::ConfigGenerator < Rails::Generators::Base
    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
         """
  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

11 entries across 11 versions & 1 rubygems

Version Path
browse-everything-0.10.5 lib/generators/browse_everything/config_generator.rb
browse-everything-0.10.4 lib/generators/browse_everything/config_generator.rb
browse-everything-0.10.3 lib/generators/browse_everything/config_generator.rb
browse-everything-0.10.2 lib/generators/browse_everything/config_generator.rb
browse-everything-0.10.1 lib/generators/browse_everything/config_generator.rb
browse-everything-0.10.0 lib/generators/browse_everything/config_generator.rb
browse-everything-0.9.1 lib/generators/browse_everything/config_generator.rb
browse-everything-0.9.0 lib/generators/browse_everything/config_generator.rb
browse-everything-0.8.4 lib/generators/browse_everything/config_generator.rb
browse-everything-0.8.3 lib/generators/browse_everything/config_generator.rb
browse-everything-0.8.2 lib/generators/browse_everything/config_generator.rb