Sha256: 7182d171bf36f98ffe4efaad8e4a79a8713e2ca7d3006a70a2adde4b909f857d

Contents?: true

Size: 721 Bytes

Versions: 5

Compression:

Stored size: 721 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 staged_filename
        File.join(Amiba::Configuration.staged_dir, 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

5 entries across 5 versions & 1 rubygems

Version Path
amiba-0.0.8 lib/amiba/source/feed.rb
amiba-0.0.7 lib/amiba/source/feed.rb
amiba-0.0.6 lib/amiba/source/feed.rb
amiba-0.0.5 lib/amiba/source/feed.rb
amiba-0.0.4 lib/amiba/source/feed.rb