module Writefully::Indices

Public Class Methods

build_from(modified) click to toggle source
# File lib/writefully/indices.rb, line 3
def self.build_from(modified)
  modified.map do |file_name|
    index_hash_from(index_name_from(remove_content_path(file_name)))       
  end
end
index_hash_from(array) click to toggle source
# File lib/writefully/indices.rb, line 17
def self.index_hash_from(array)
  Hash[*array]
end
index_name_from(array) click to toggle source
# File lib/writefully/indices.rb, line 13
def self.index_name_from(array)
  [:site, :resource, :slug].zip(array).flatten
end
remove_content_path(file_name) click to toggle source
# File lib/writefully/indices.rb, line 9
def self.remove_content_path(file_name)
  file_name.split('/') - Writefully.options[:content].split('/')
end