Sha256: 23f1a3be663df336338b30d1e9f2d780f13ea383ce506c40abdb171442754e5b

Contents?: true

Size: 783 Bytes

Versions: 8

Compression:

Stored size: 783 Bytes

Contents

require 'rails/generators'

class BlacklightAdvancedSearchGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__)

  require File.expand_path('../assets_generator.rb', __FILE__)
  def copy_public_assets
    BlacklightAdvancedSearch::AssetsGenerator.start
  end
  
  def install_config_file
    if options[:force] or yes?("Install optional example Blacklight Advanced Search config file?")
      copy_file("blacklight_advanced_search_config.rb", "config/initializers/blacklight_advanced_search.rb")
    end
  end
  
  def install_localized_search_form
    if options[:force] or yes?("Install local search form with advanced link?")      
      copy_file("_search_form.html.erb", "app/views/catalog/_search_form.html.erb")      
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight_advanced_search-1.1.2 lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
blacklight_advanced_search-1.1.1 lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
blacklight_advanced_search-1.1.0 lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
blacklight_advanced_search-1.0.0 lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
blacklight_advanced_search-1.0.0pre5 lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
blacklight_advanced_search-1.0.0pre4 lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
blacklight_advanced_search-1.0.0pre3 lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb
blacklight_advanced_search-1.0.0pre2 lib/generators/blacklight_advanced_search/blacklight_advanced_search_generator.rb