pax_global_header00006660000000000000000000000064124007107120014504gustar00rootroot0000000000000052 comment=2ab141bfa4c62a0a942360e8a9bc824f6d7f9a24 jekyll-coffeescript-1.0.1/000077500000000000000000000000001240071071200154475ustar00rootroot00000000000000jekyll-coffeescript-1.0.1/.gitignore000066400000000000000000000002321240071071200174340ustar00rootroot00000000000000*.gem *.rbc .bundle .config .yardoc Gemfile.lock InstalledFiles _yardoc coverage doc/ lib/bundler/man pkg rdoc spec/reports test/tmp test/version_tmp tmp jekyll-coffeescript-1.0.1/.rspec000066400000000000000000000000321240071071200165570ustar00rootroot00000000000000--color --format progress jekyll-coffeescript-1.0.1/.travis.yml000066400000000000000000000014751240071071200175670ustar00rootroot00000000000000language: ruby cache: bundler install: - script/rebund download - bundle install --path vendor/bundle rvm: - 2.1.0 - 2.0.0 - 1.9.3 script: script/cibuild after_script: - script/rebund upload notifications: irc: on_success: change on_failure: change channels: - irc.freenode.org#jekyll template: - '%{repository}#%{build_number} (%{branch}) %{message} %{build_url}' email: on_success: never on_failure: never env: global: - secure: c3L8fa91PLodwiKuNevq5/Froh2h3PPG22NMavTBnu2YLBeSnPHMc2yasEAbH9hBKkw0LqMCdqF13uaQWdulI0Ez5ylUvg2tUi1KPRjQkSBZgZZVurQkCwNvhbttRYLgwDbuDBLguVFkl1q4/eFTCcTPW/20p0tsCWKpddmjO0I= - secure: H4CFVnFXtDcm6R3d6038RbYA9uV0yJ2fHb7GDwQmGJWIK8zB5FEzOykGT+C6/7hrVXy5fNK4fn+Zrt/WPRmxiMSirLWiMt+X7Cu+stFdMkdAwQq32/rFCSzbTszoCs+pCFGYEW2Iyj9rs2tgkxy8hKvG7ypDZ4keSKyxm8kBAMA= jekyll-coffeescript-1.0.1/Gemfile000066400000000000000000000000431240071071200167370ustar00rootroot00000000000000source 'http://us.yarp.io' gemspec jekyll-coffeescript-1.0.1/History.markdown000066400000000000000000000004001240071071200206460ustar00rootroot00000000000000## 1.0.1 / 2014-08-31 ### Bug Fixes * `Converters::CoffeeScript#matches` should never return anything but `true` or `false` (#7) ### Development Fixes * Fix up some docs (#2) * Change CSS to JS in spec (#6) ### 1.0.0 / 2014-01-25 * Birthday! jekyll-coffeescript-1.0.1/LICENSE.txt000066400000000000000000000020551240071071200172740ustar00rootroot00000000000000Copyright (c) 2014 Parker Moore MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. jekyll-coffeescript-1.0.1/README.md000066400000000000000000000022741240071071200167330ustar00rootroot00000000000000# Jekyll::Coffeescript A CoffeeScript converter for Jekyll. [![Build Status](https://travis-ci.org/jekyll/jekyll-coffeescript.svg?branch=master)](https://travis-ci.org/jekyll/jekyll-coffeescript) ## Installation Add this line to your application's Gemfile: ```ruby gem 'jekyll-coffeescript' ``` And then execute: ```bash $ bundle ``` Or install it yourself as: ```bash $ gem install jekyll-coffeescript ``` **Notes: `jekyll-coffeescript` requires Ruby 1.9.3 or greater. Additionally, the dependency on `execjs` means you must also have a [valid JavaScript runtime](https://github.com/sstephenson/execjs#execjs) available to your project** ## Usage In your Jekyll site, create CoffeeScript files that start with the following lines: ``` --- --- ``` You need those three dashes in order for Jekyll to recognize it as "convertible". They won't be included in the content passed to the CoffeeScript compiler. ## Contributing 1. Fork it (`http://github.com/jekyll/jekyll-coffeescript/fork`) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am "Add some feature"`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request jekyll-coffeescript-1.0.1/Rakefile000066400000000000000000000000341240071071200171110ustar00rootroot00000000000000require "bundler/gem_tasks" jekyll-coffeescript-1.0.1/jekyll-coffeescript.gemspec000066400000000000000000000015661240071071200227700ustar00rootroot00000000000000# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'jekyll-coffeescript/version' Gem::Specification.new do |spec| spec.name = "jekyll-coffeescript" spec.version = Jekyll::Coffeescript::VERSION spec.authors = ["Parker Moore"] spec.email = ["parkrmoore@gmail.com"] spec.summary = %q{A CoffeeScript converter for Jekyll.} spec.homepage = "https://github.com/jekyll/jekyll-coffeescript" spec.license = "MIT" spec.files = `git ls-files`.split($/).grep(%r{(lib/)}) spec.require_paths = ["lib"] spec.add_runtime_dependency "coffee-script", "~> 2.2" spec.add_development_dependency "jekyll", "~> 2.0" spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" end jekyll-coffeescript-1.0.1/lib/000077500000000000000000000000001240071071200162155ustar00rootroot00000000000000jekyll-coffeescript-1.0.1/lib/jekyll-coffeescript.rb000066400000000000000000000002471240071071200225110ustar00rootroot00000000000000require "jekyll" require "coffee-script" require "jekyll-coffeescript/version" require "jekyll/converters/coffeescript" module Jekyll module Coffeescript end end jekyll-coffeescript-1.0.1/lib/jekyll-coffeescript/000077500000000000000000000000001240071071200221615ustar00rootroot00000000000000jekyll-coffeescript-1.0.1/lib/jekyll-coffeescript/version.rb000066400000000000000000000001041240071071200241660ustar00rootroot00000000000000module Jekyll module Coffeescript VERSION = "1.0.1" end end jekyll-coffeescript-1.0.1/lib/jekyll/000077500000000000000000000000001240071071200175075ustar00rootroot00000000000000jekyll-coffeescript-1.0.1/lib/jekyll/converters/000077500000000000000000000000001240071071200217015ustar00rootroot00000000000000jekyll-coffeescript-1.0.1/lib/jekyll/converters/coffeescript.rb000066400000000000000000000005001240071071200246750ustar00rootroot00000000000000module Jekyll module Converters class CoffeeScript < Converter safe true priority :low def matches(ext) ext.downcase == ".coffee" end def output_ext(ext) ".js" end def convert(content) ::CoffeeScript.compile(content) end end end end jekyll-coffeescript-1.0.1/script/000077500000000000000000000000001240071071200167535ustar00rootroot00000000000000jekyll-coffeescript-1.0.1/script/bootstrap000077500000000000000000000000351240071071200207140ustar00rootroot00000000000000#! /bin/bash bundle install jekyll-coffeescript-1.0.1/script/cibuild000077500000000000000000000000401240071071200203060ustar00rootroot00000000000000#! /bin/bash bundle exec rspec jekyll-coffeescript-1.0.1/script/rebund000077500000000000000000000057501240071071200201670ustar00rootroot00000000000000#!/bin/bash # # rebund(1) # # Author: Julien Letessier # Homepage: https://github.com/mezis/rebund # License: # # Copyright (c) 2014 HouseTrip Ltd # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Configuration : ${REBUND_CREDENTIALS:=user:secret} : ${REBUND_ENDPOINT=http://keyfile-production.herokuapp.com} : ${REBUND_TARBALL:=bundle.tbz} : ${REBUND_BUNDLE_DIR:=vendor/bundle} log() { echo "rebund: $*" > /dev/stderr } die() { echo "fatal: $*" > /dev/stderr exit 1 } success() { log "$*" exit 0 } on_error() { die 'unknown error.' } get_ruby_version() { bundle exec ruby --version } get_gemfile() { bundle exec sh -c 'echo $BUNDLE_GEMFILE' } calculate_hash() { (get_ruby_version ; cat $(get_gemfile)) | openssl sha256 | sed -e 's/.* //' } build_tarball() { test -e $REBUND_BUNDLE_DIR || die "cannot find bundle directory in ${REBUND_BUNDLE_DIR}" test -e $REBUND_TARBALL && success 'bundle already uploaded' tar jcf $REBUND_TARBALL $REBUND_BUNDLE_DIR } upload_tarball() { curl --fail \ -F filedata=@${REBUND_TARBALL} \ --digest --user $REBUND_CREDENTIALS \ ${REBUND_ENDPOINT}/$(calculate_hash) \ || success "could not upload bundle" } expand_tarball() { test -e $REBUND_TARBALL || success "no tarball" tar jxf $REBUND_TARBALL } download_tarball() { curl --fail \ --location \ -o ${REBUND_TARBALL} \ --digest --user $REBUND_CREDENTIALS \ ${REBUND_ENDPOINT}/$(calculate_hash) \ || success "could not download bundle" } rebund_upload() { build_tarball upload_tarball } rebund_download() { download_tarball expand_tarball } rebund_usage() { success "usage: $0 [-v] [upload|download]" } # cath errors trap on_error ERR # inherit the ERR trap in subprocesses set -E while test $# -gt 0 ; do case $1 in -v) set -x ;; upload) rebund_upload exit 0 ;; download) rebund_download exit 0 ;; *) rebund_usage exit 1 ;; esac shift done rebund_usage jekyll-coffeescript-1.0.1/script/release000077500000000000000000000000331240071071200203150ustar00rootroot00000000000000#! /bin/bash rake release jekyll-coffeescript-1.0.1/spec/000077500000000000000000000000001240071071200164015ustar00rootroot00000000000000jekyll-coffeescript-1.0.1/spec/coffeescript_spec.rb000066400000000000000000000023021240071071200224110ustar00rootroot00000000000000require 'spec_helper' describe(Jekyll::Converters::CoffeeScript) do let(:configuration) { Jekyll::Configuration::DEFAULTS } let(:converter) do Jekyll::Converters::CoffeeScript.new(configuration) end let(:coffeescript_content) do <<-COFFEESCRIPT # Functions: square = (x) -> x * x # Arrays: list = [1, 2, 3, 4, 5] # Objects: math = root: Math.sqrt square: square cube: (x) -> x * square x COFFEESCRIPT end let(:js_content) do <<-JS (function() { var list, math, square; square = function(x) { return x * x; }; list = [1, 2, 3, 4, 5]; math = { root: Math.sqrt, square: square, cube: function(x) { return x * square(x); } }; }).call(this); JS end context "matching file extensions" do it "matches .coffee files" do expect(converter.matches(".coffee")).to be(true) end end context "determining the output file extension" do it "always outputs the .js file extension" do expect(converter.output_ext(".always-js-dont-matter")).to eql(".js") end end context "converting CoffeeScript" do it "produces JS" do expect(converter.convert(coffeescript_content)).to eql(js_content) end end end jekyll-coffeescript-1.0.1/spec/spec_helper.rb000066400000000000000000000013171240071071200212210ustar00rootroot00000000000000# This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # Require this file using `require "spec_helper"` to ensure that it is only # loaded once. # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration require 'jekyll' require 'jekyll-coffeescript' RSpec.configure do |config| config.run_all_when_everything_filtered = true config.filter_run :focus # Run specs in random order to surface order dependencies. If you find an # order dependency and want to debug it, you can fix the order by providing # the seed, which is printed after each run. # --seed 1234 config.order = 'random' end