lib/nanoc/data_sources/deprecated/delicious.rb in nanoc-3.7.4 vs lib/nanoc/data_sources/deprecated/delicious.rb in nanoc-3.7.5
- old
+ new
@@ -1,12 +1,10 @@
# encoding: utf-8
module Nanoc::DataSources
-
# @deprecated Fetch data from online data sources manually instead
class Delicious < Nanoc::DataSource
-
def items
@items ||= begin
require 'json'
# Get data
@@ -19,24 +17,22 @@
# Convert to items
raw_items.enum_with_index.map do |raw_item, i|
# Get data
content = raw_item['n']
attributes = {
- :url => raw_item['u'],
- :description => raw_item['d'],
- :tags => raw_item['t'],
- :date => Time.parse(raw_item['dt']),
- :note => raw_item['n'],
- :author => raw_item['a']
+ url: raw_item['u'],
+ description: raw_item['d'],
+ tags: raw_item['t'],
+ date: Time.parse(raw_item['dt']),
+ note: raw_item['n'],
+ author: raw_item['a']
}
identifier = "/#{i}/"
mtime = nil
# Build item
Nanoc::Item.new(content, attributes, identifier, mtime)
end
end
end
-
end
-
end