Sha256: 403de3ea3cb8fd19261d245682a8862685c8efc8addd8380c67114c88e5e7c08

Contents?: true

Size: 1.03 KB

Versions: 20

Compression:

Stored size: 1.03 KB

Contents

require 'awestruct/handler_chain'
require 'awestruct/handlers/base_handler'
require 'awestruct/handlers/file_handler'
require 'awestruct/handlers/front_matter_handler'
require 'awestruct/handlers/interpolation_handler'

module Awestruct
  module Handlers
    class JavascriptHandler < BaseHandler


      CHAIN = Awestruct::HandlerChain.new( /\.js$/,
        Awestruct::Handlers::FileHandler,
        Awestruct::Handlers::FrontMatterHandler,
        Awestruct::Handlers::InterpolationHandler,
        Awestruct::Handlers::JavascriptHandler
      )

      def initialize(site, delegate)
        super( site, delegate )
      end

      def simple_name
        File.basename( relative_source_path, '.js' )
      end

      def output_filename
        File.basename( relative_source_path )
      end

      def output_extension
        '.js'
      end

      def content_syntax
        :javascript
      end

      def rendered_content(context, with_layouts=false)
        delegate.rendered_content( context, with_layouts )
      end

    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
awestruct-0.6.0.alpha4 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.6.0.alpha3 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.6.0.alpha1 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.7 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.7.RC2 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.7.RC1 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta9 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta8 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta7 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta6 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta5 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta4 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta3 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta2 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.6.beta lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.5 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.4.2 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.4.1 lib/awestruct/handlers/javascript_handler.rb
awestruct-0.5.4 lib/awestruct/handlers/javascript_handler.rb