lib/nanoc/cli/commands/create-layout.rb in nanoc-3.6.7 vs lib/nanoc/cli/commands/create-layout.rb in nanoc-3.6.8

- old
+ new

@@ -20,35 +20,35 @@ # Extract arguments identifier = arguments[0].cleaned_identifier # Make sure we are in a nanoc site directory - self.require_site + require_site # Set VCS if possible - self.set_vcs(options[:vcs]) + set_vcs(options[:vcs]) # Check whether layout is unique - if !self.site.layouts.find { |l| l.identifier == identifier }.nil? + if !site.layouts.find { |l| l.identifier == identifier }.nil? raise Nanoc::Errors::GenericTrivial, "A layout already exists at #{identifier}. Please " + - "pick a unique name for the layout you are creating." + 'pick a unique name for the layout you are creating.' end # Check whether layout is not at / if identifier == '/' raise Nanoc::Errors::GenericTrivial, "There cannot be a layout with the identifier '/'; " + - "please pick a different identifier for this layout." + 'please pick a different identifier for this layout.' end # Setup notifications Nanoc::NotificationCenter.on(:file_created) do |file_path| Nanoc::CLI::Logger.instance.file(:high, :create, file_path) end # Create layout - data_source = self.site.data_sources[0] + data_source = site.data_sources[0] data_source.create_layout( "<html>\n" + " <head>\n" + " <title><%= @item[:title] %></title>\n" + " </head>\n" +