[DRE-commits] [ruby-jekyll-coffeescript] 01/02: Imported Upstream version 1.0.0
Youhei SASAKI
uwabami-guest at moszumanska.debian.org
Tue Jun 3 06:49:04 UTC 2014
This is an automated email from the git hooks/post-receive script.
uwabami-guest pushed a commit to branch master
in repository ruby-jekyll-coffeescript.
commit feddc99af63a00148c6ccd862d87eaf621c1da4c
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date: Tue Jun 3 12:27:34 2014 +0900
Imported Upstream version 1.0.0
---
.gitignore | 17 +++++
.rspec | 2 +
Gemfile | 2 +
History.markdown | 13 ++++
LICENSE.txt | 22 ++++++
README.md | 39 ++++++++++
Rakefile | 1 +
checksums.yaml.gz | Bin 0 -> 268 bytes
jekyll-coffeescript.gemspec | 26 +++++++
lib/jekyll-coffeescript.rb | 9 +++
lib/jekyll/converters/coffeescript.rb | 20 ++++++
metadata.yml | 131 ++++++++++++++++++++++++++++++++++
script/bootstrap | 3 +
script/cibuild | 3 +
script/release | 3 +
spec/coffeescript_spec.rb | 64 +++++++++++++++++
spec/spec_helper.rb | 17 +++++
17 files changed, 372 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d87d4be
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,17 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
diff --git a/.rspec b/.rspec
new file mode 100644
index 0000000..5f16476
--- /dev/null
+++ b/.rspec
@@ -0,0 +1,2 @@
+--color
+--format progress
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..20c9924
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,2 @@
+source 'http://us.yarp.io'
+gemspec
diff --git a/History.markdown b/History.markdown
new file mode 100644
index 0000000..7354475
--- /dev/null
+++ b/History.markdown
@@ -0,0 +1,13 @@
+## HEAD
+
+### Major Enhancements
+
+### Minor Enhancements
+
+### Bug Fixes
+
+### Development Fixes
+
+### 1.0.0 / 2014-01-25
+
+ * Birthday!
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..3ed9f59
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (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.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9238b19
--- /dev/null
+++ b/README.md
@@ -0,0 +1,39 @@
+# Jekyll::Coffeescript
+
+A CoffeeScript converter for Jekyll.
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+ gem 'jekyll-coffeescript'
+
+And then execute:
+
+ $ bundle
+
+Or install it yourself as:
+
+ $ gem install jekyll-coffeescript
+
+## Usage
+
+In your Jekyll site, create CoffeeScript files that start with the following
+lines:
+
+```text
+---
+---
+```
+
+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/<my-github-username>/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
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..2995527
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1 @@
+require "bundler/gem_tasks"
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
new file mode 100644
index 0000000..c5a42dc
Binary files /dev/null and b/checksums.yaml.gz differ
diff --git a/jekyll-coffeescript.gemspec b/jekyll-coffeescript.gemspec
new file mode 100644
index 0000000..a8ba5f6
--- /dev/null
+++ b/jekyll-coffeescript.gemspec
@@ -0,0 +1,26 @@
+# coding: utf-8
+lib = File.expand_path('../lib', __FILE__)
+$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
+require 'jekyll-coffeescript'
+
+Gem::Specification.new do |spec|
+ spec.name = "jekyll-coffeescript"
+ spec.version = Jekyll::Coffeescript::VERSION
+ spec.authors = ["Parker Moore"]
+ spec.email = ["parkrmoore at 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($/)
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
+ spec.require_paths = ["lib"]
+
+ spec.add_runtime_dependency "coffee-script", "~> 2.2"
+
+ spec.add_development_dependency "jekyll", "~> 1.0"
+ spec.add_development_dependency "bundler", "~> 1.5"
+ spec.add_development_dependency "rake"
+ spec.add_development_dependency "rspec"
+end
diff --git a/lib/jekyll-coffeescript.rb b/lib/jekyll-coffeescript.rb
new file mode 100644
index 0000000..2e4190e
--- /dev/null
+++ b/lib/jekyll-coffeescript.rb
@@ -0,0 +1,9 @@
+require "jekyll"
+require "coffee-script"
+require "jekyll/converters/coffeescript"
+
+module Jekyll
+ module Coffeescript
+ VERSION = "1.0.0"
+ end
+end
diff --git a/lib/jekyll/converters/coffeescript.rb b/lib/jekyll/converters/coffeescript.rb
new file mode 100644
index 0000000..36c9f18
--- /dev/null
+++ b/lib/jekyll/converters/coffeescript.rb
@@ -0,0 +1,20 @@
+module Jekyll
+ module Converters
+ class CoffeeScript < Converter
+ safe true
+ priority :low
+
+ def matches(ext)
+ ext =~ /\A\.coffee\z/
+ end
+
+ def output_ext(ext)
+ ".js"
+ end
+
+ def convert(content)
+ ::CoffeeScript.compile(content)
+ end
+ end
+ end
+end
diff --git a/metadata.yml b/metadata.yml
new file mode 100644
index 0000000..edad641
--- /dev/null
+++ b/metadata.yml
@@ -0,0 +1,131 @@
+--- !ruby/object:Gem::Specification
+name: jekyll-coffeescript
+version: !ruby/object:Gem::Version
+ version: 1.0.0
+platform: ruby
+authors:
+- Parker Moore
+autorequire:
+bindir: bin
+cert_chain: []
+date: 2014-01-26 00:00:00.000000000 Z
+dependencies:
+- !ruby/object:Gem::Dependency
+ name: coffee-script
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - ~>
+ - !ruby/object:Gem::Version
+ version: '2.2'
+ type: :runtime
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - ~>
+ - !ruby/object:Gem::Version
+ version: '2.2'
+- !ruby/object:Gem::Dependency
+ name: jekyll
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - ~>
+ - !ruby/object:Gem::Version
+ version: '1.0'
+ type: :development
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - ~>
+ - !ruby/object:Gem::Version
+ version: '1.0'
+- !ruby/object:Gem::Dependency
+ name: bundler
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - ~>
+ - !ruby/object:Gem::Version
+ version: '1.5'
+ type: :development
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - ~>
+ - !ruby/object:Gem::Version
+ version: '1.5'
+- !ruby/object:Gem::Dependency
+ name: rake
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - '>='
+ - !ruby/object:Gem::Version
+ version: '0'
+ type: :development
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - '>='
+ - !ruby/object:Gem::Version
+ version: '0'
+- !ruby/object:Gem::Dependency
+ name: rspec
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - '>='
+ - !ruby/object:Gem::Version
+ version: '0'
+ type: :development
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - '>='
+ - !ruby/object:Gem::Version
+ version: '0'
+description:
+email:
+- parkrmoore at gmail.com
+executables: []
+extensions: []
+extra_rdoc_files: []
+files:
+- .gitignore
+- .rspec
+- Gemfile
+- History.markdown
+- LICENSE.txt
+- README.md
+- Rakefile
+- jekyll-coffeescript.gemspec
+- lib/jekyll-coffeescript.rb
+- lib/jekyll/converters/coffeescript.rb
+- script/bootstrap
+- script/cibuild
+- script/release
+- spec/coffeescript_spec.rb
+- spec/spec_helper.rb
+homepage: https://github.com/jekyll/jekyll-coffeescript
+licenses:
+- MIT
+metadata: {}
+post_install_message:
+rdoc_options: []
+require_paths:
+- lib
+required_ruby_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - '>='
+ - !ruby/object:Gem::Version
+ version: '0'
+required_rubygems_version: !ruby/object:Gem::Requirement
+ requirements:
+ - - '>='
+ - !ruby/object:Gem::Version
+ version: '0'
+requirements: []
+rubyforge_project:
+rubygems_version: 2.0.14
+signing_key:
+specification_version: 4
+summary: A CoffeeScript converter for Jekyll.
+test_files:
+- spec/coffeescript_spec.rb
+- spec/spec_helper.rb
diff --git a/script/bootstrap b/script/bootstrap
new file mode 100755
index 0000000..8a09d8a
--- /dev/null
+++ b/script/bootstrap
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+bundle install
diff --git a/script/cibuild b/script/cibuild
new file mode 100755
index 0000000..0dd422b
--- /dev/null
+++ b/script/cibuild
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+bundle exec rspec
diff --git a/script/release b/script/release
new file mode 100755
index 0000000..c204a27
--- /dev/null
+++ b/script/release
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+rake release
diff --git a/spec/coffeescript_spec.rb b/spec/coffeescript_spec.rb
new file mode 100644
index 0000000..05d904a
--- /dev/null
+++ b/spec/coffeescript_spec.rb
@@ -0,0 +1,64 @@
+require '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 CSS" do
+ expect(converter.convert(coffeescript_content)).to eql(js_content)
+ end
+ end
+
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..dbc4f1a
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,17 @@
+# 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
+RSpec.configure do |config|
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ 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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-jekyll-coffeescript.git
More information about the Pkg-ruby-extras-commits
mailing list