lib/nanoc/cli/commands/sync.rb in nanoc-3.6.7 vs lib/nanoc/cli/commands/sync.rb in nanoc-3.6.8
- old
+ new
@@ -1,5 +1,7 @@
+# encoding: utf-8
+
usage 'sync'
summary 'sync data sources'
description <<-EOS
Sync data source data. This command is useful for updating local item caches
for data sources which rely on slow external APIs.
@@ -14,13 +16,13 @@
if arguments.size != 0
raise Nanoc::Errors::GenericTrivial, "usage: #{command.usage}"
end
# Make sure we are in a nanoc site directory
- self.require_site
+ require_site
# Update all syncable data sources
- self.site.data_sources.each do |data_source|
+ 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