Methods

Class/Module Index [+]

Quicksearch

Nanoc::CLI::Commands::Sync

Public Instance Methods

run() click to toggle source
# File lib/nanoc/cli/commands/sync.rb, line 12
def run
  # Check arguments
  if arguments.size != 0
    raise Nanoc::Errors::GenericTrivial, "usage: #{command.usage}"
  end

  # Make sure we are in a nanoc site directory
  self.require_site

  # Update all syncable data sources
  self.site.data_sources.each do |data_source|
    unless data_source.method(:sync).owner == Nanoc::DataSource
      puts "Syncing #{data_source.config[:type]} data source: #{data_source.items_root}"
      data_source.sync
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.