jekyll-coffeescript 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/Gemfile +2 -0
- data/History.markdown +13 -0
- data/LICENSE.txt +22 -0
- data/README.md +39 -0
- data/Rakefile +1 -0
- data/jekyll-coffeescript.gemspec +26 -0
- data/lib/jekyll-coffeescript.rb +9 -0
- data/lib/jekyll/converters/coffeescript.rb +20 -0
- data/script/bootstrap +3 -0
- data/script/cibuild +3 -0
- data/spec/coffeescript_spec.rb +64 -0
- data/spec/spec_helper.rb +17 -0
- metadata +130 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0b601a5505473bb02d127d53d9f2794c07d2ad73
|
4
|
+
data.tar.gz: 0c1d79d3cd6bee5aad37922346c379f3dd60e8de
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a6c5400a17e2a33106ee549420ca4cc94d9a58b2422259a52f339b9ede9146719f6534222cc392471f07053d595f90bc50e265352e56cb9447e28551283337e2
|
7
|
+
data.tar.gz: f9b8fc2aa11c2552cfd2f7d139d3bdccf05b9ac0c36aff05970ef813e73436b9384bc078a76346fff5c172c65dc46dccae9a86d5fd53e879af47d4ffe23fd410
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/History.markdown
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Parker Moore
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Jekyll::Coffeescript
|
2
|
+
|
3
|
+
A CoffeeScript converter for Jekyll.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'jekyll-coffeescript'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install jekyll-coffeescript
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
In your Jekyll site, create CoffeeScript files that start with the following
|
22
|
+
lines:
|
23
|
+
|
24
|
+
```text
|
25
|
+
---
|
26
|
+
---
|
27
|
+
```
|
28
|
+
|
29
|
+
You need those three dashes in order for Jekyll to recognize it as
|
30
|
+
"convertible". They won't be included in the content passed to the CoffeeScript
|
31
|
+
compiler.
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it ( `http://github.com/<my-github-username>/jekyll-coffeescript/fork` )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jekyll-coffeescript'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jekyll-coffeescript"
|
8
|
+
spec.version = Jekyll::Coffeescript::VERSION
|
9
|
+
spec.authors = ["Parker Moore"]
|
10
|
+
spec.email = ["parkrmoore@gmail.com"]
|
11
|
+
spec.summary = %q{A CoffeeScript converter for Jekyll.}
|
12
|
+
spec.homepage = "https://github.com/jekyll/jekyll-coffeescript"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_runtime_dependency "jekyll", "~> 1.0"
|
21
|
+
spec.add_runtime_dependency "coffee-script", "~> 2.2"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module Converters
|
3
|
+
class CoffeeScript < Converter
|
4
|
+
safe true
|
5
|
+
priority :low
|
6
|
+
|
7
|
+
def matches(ext)
|
8
|
+
ext =~ /\A\.coffee\z/
|
9
|
+
end
|
10
|
+
|
11
|
+
def output_ext(ext)
|
12
|
+
".js"
|
13
|
+
end
|
14
|
+
|
15
|
+
def convert(content)
|
16
|
+
::CoffeeScript.compile(content)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/script/bootstrap
ADDED
data/script/cibuild
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe(Jekyll::Converters::CoffeeScript) do
|
4
|
+
let(:configuration) { Jekyll::Configuration::DEFAULTS }
|
5
|
+
let(:converter) do
|
6
|
+
Jekyll::Converters::CoffeeScript.new(configuration)
|
7
|
+
end
|
8
|
+
let(:coffeescript_content) do
|
9
|
+
<<-COFFEESCRIPT
|
10
|
+
# Functions:
|
11
|
+
square = (x) -> x * x
|
12
|
+
|
13
|
+
# Arrays:
|
14
|
+
list = [1, 2, 3, 4, 5]
|
15
|
+
|
16
|
+
# Objects:
|
17
|
+
math =
|
18
|
+
root: Math.sqrt
|
19
|
+
square: square
|
20
|
+
cube: (x) -> x * square x
|
21
|
+
COFFEESCRIPT
|
22
|
+
end
|
23
|
+
let(:js_content) do
|
24
|
+
<<-JS
|
25
|
+
(function() {
|
26
|
+
var list, math, square;
|
27
|
+
|
28
|
+
square = function(x) {
|
29
|
+
return x * x;
|
30
|
+
};
|
31
|
+
|
32
|
+
list = [1, 2, 3, 4, 5];
|
33
|
+
|
34
|
+
math = {
|
35
|
+
root: Math.sqrt,
|
36
|
+
square: square,
|
37
|
+
cube: function(x) {
|
38
|
+
return x * square(x);
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
}).call(this);
|
43
|
+
JS
|
44
|
+
end
|
45
|
+
|
46
|
+
context "matching file extensions" do
|
47
|
+
it "matches .coffee files" do
|
48
|
+
expect(converter.matches(".coffee")).to be_true
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
context "determining the output file extension" do
|
53
|
+
it "always outputs the .js file extension" do
|
54
|
+
expect(converter.output_ext(".always-js-dont-matter")).to eql(".js")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "converting CoffeeScript" do
|
59
|
+
it "produces CSS" do
|
60
|
+
expect(converter.convert(coffeescript_content)).to eql(js_content)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
4
|
+
# loaded once.
|
5
|
+
#
|
6
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
9
|
+
config.run_all_when_everything_filtered = true
|
10
|
+
config.filter_run :focus
|
11
|
+
|
12
|
+
# Run specs in random order to surface order dependencies. If you find an
|
13
|
+
# order dependency and want to debug it, you can fix the order by providing
|
14
|
+
# the seed, which is printed after each run.
|
15
|
+
# --seed 1234
|
16
|
+
config.order = 'random'
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-coffeescript
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.rc1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Parker Moore
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: jekyll
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: coffee-script
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- parkrmoore@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- .rspec
|
92
|
+
- Gemfile
|
93
|
+
- History.markdown
|
94
|
+
- LICENSE.txt
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- jekyll-coffeescript.gemspec
|
98
|
+
- lib/jekyll-coffeescript.rb
|
99
|
+
- lib/jekyll/converters/coffeescript.rb
|
100
|
+
- script/bootstrap
|
101
|
+
- script/cibuild
|
102
|
+
- spec/coffeescript_spec.rb
|
103
|
+
- spec/spec_helper.rb
|
104
|
+
homepage: https://github.com/jekyll/jekyll-coffeescript
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - '>'
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: 1.3.1
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.0.14
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: A CoffeeScript converter for Jekyll.
|
128
|
+
test_files:
|
129
|
+
- spec/coffeescript_spec.rb
|
130
|
+
- spec/spec_helper.rb
|