Class: Blacklight::Generators::SitemapGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/rails/generators/blacklight/sitemap/sitemap_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject


6
7
8
# File 'lib/rails/generators/blacklight/sitemap/sitemap_generator.rb', line 6

def self.source_root
  @_blacklight_source_root ||= File.expand_path("../templates", __FILE__)
end

Instance Method Details

#create_blacklight_sitemap_taskObject


11
12
13
14
15
16
17
# File 'lib/rails/generators/blacklight/sitemap/sitemap_generator.rb', line 11

def create_blacklight_sitemap_task
  rakefile_path = File.join(Rails.root,'Rakefile')
  rakefile = File.read(rakefile_path)
  if rakefile.scan('Rake::BlacklightSitemapTask.new').empty?
    append_to_file(rakefile_path, File.read(File.join(File.dirname(__FILE__),'templates/default_rake_task.rb')))
  end
end