Sha256: ea4b9bf8d58a957757a3bb27e2c4b219e4700f1cb6fe8899dbaf7b630d458c77

Contents?: true

Size: 623 Bytes

Versions: 4

Compression:

Stored size: 623 Bytes

Contents

require 'amiba/source'

module Amiba
  module Source
    class Feed
      include Amiba::Source

      attr_accessor :type, :name
      def initialize(fn)
        self.name, self.type = File.basename(fn, ".builder").split(".")
      end

      def filename 
        @filename ||= File.join("feeds", "#{@name}.#{@type}.builder")
      end

      def content=(c)
        @content ||= self.new? ? c : File.read(filename)
      end

      def output_filename
        File.join(Amiba::Configuration.site_dir, "public/#{name}.#{type}")
      end

      def link
        URI.escape "/#{name}.#{type}"
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
amiba-1.0.2 lib/amiba/source/feed.rb
amiba-1.0.1 lib/amiba/source/feed.rb
amiba-1.0.0 lib/amiba/source/feed.rb
amiba-0.0.9 lib/amiba/source/feed.rb