Sha256: 6d0ab758796fb1d932438b05a59bbcf2e37037ecb22d94a5762336686c729fe8

Contents?: true

Size: 727 Bytes

Versions: 4

Compression:

Stored size: 727 Bytes

Contents

module Octopress
  module Ink
    module Assets
      class Coffeescript < Javascript

        def tag_path
          Filters.expand_url(File.join(dir, File.basename(file, '.*') << '.js'))
        end

        def add
          Plugins.add_js_tag tag
          Plugins.static_files << StaticFileContent.new(content, destination)
        end

        def content
          begin
            require 'jekyll-coffeescript'
          rescue LoadError
            raise "Add gem jekyll-coffeescript to Gemfile (or gemspec)."
          end
          ::CoffeeScript.compile(super)
        end

        def destination
          File.join(base, plugin.slug, File.basename(file, '.*') << '.js')
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
octopress-ink-1.2.1 lib/octopress-ink/assets/coffeescript.rb
octopress-ink-1.2.0 lib/octopress-ink/assets/coffeescript.rb
octopress-ink-1.1.4 lib/octopress-ink/assets/coffeescript.rb
octopress-ink-1.1.2 lib/octopress-ink/assets/coffeescript.rb