nanoc-typescript 0.0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +30 -0
- data/lib/nanoc-typescript.rb +10 -0
- data/lib/nanoc/filters/typescript.rb +20 -0
- data/nanoc-typescript.gemspec +19 -0
- metadata +74 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 George Pittarelli
|
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,30 @@
|
|
1
|
+
nanoc-typescript
|
2
|
+
-----
|
3
|
+
|
4
|
+
A Nanoc filter for compiling TypeScript scripts down to JavaScript.
|
5
|
+
|
6
|
+
|
7
|
+
Usage
|
8
|
+
-----
|
9
|
+
|
10
|
+
First install `nanoc-typescript` with
|
11
|
+
|
12
|
+
gem install nanoc-typescript
|
13
|
+
|
14
|
+
Next, in your Nanoc `lib/default.rb` require the library
|
15
|
+
|
16
|
+
require 'nanoc-typescript'
|
17
|
+
|
18
|
+
You can now use the typescript filter in `Rules`. For example
|
19
|
+
|
20
|
+
compile '/scripts/*/' do
|
21
|
+
filter :typescript
|
22
|
+
end
|
23
|
+
|
24
|
+
Or, if not all of your scripts are written in typescript, you may prefer something like
|
25
|
+
|
26
|
+
compile '/scripts/*/' do
|
27
|
+
filter :coffeescript if item[:extension] == "cs"
|
28
|
+
filter :typescript if item[:extension] == "ts"
|
29
|
+
# etc...
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Nanoc::Filters
|
2
|
+
|
3
|
+
# @since 3.3.0
|
4
|
+
class TypeScript < Nanoc::Filter
|
5
|
+
|
6
|
+
require 'typescript'
|
7
|
+
|
8
|
+
# Runs the content through [TypeScript](http://typescriptlang.org/).
|
9
|
+
# This method takes no options.
|
10
|
+
#
|
11
|
+
# @param [String] content The TypeScript content to turn into JavaScript
|
12
|
+
#
|
13
|
+
# @return [String] The resulting JavaScript
|
14
|
+
def run(content, params = {})
|
15
|
+
::TypeScript.compile(content)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.authors = ['George Pittarelli']
|
5
|
+
gem.email = ['nanoctypescript@gjp.cc']
|
6
|
+
gem.description = %q{A nanoc filter to compile TypeScript to JavaScript}
|
7
|
+
gem.summary = %q{A nanoc filter to compile TypeScript}
|
8
|
+
gem.homepage = 'https://github.com/gpittarelli/nanoc-typescript'
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split($\)
|
11
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
12
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
|
+
gem.name = 'nanoc-typescript'
|
14
|
+
gem.require_paths = ['lib']
|
15
|
+
gem.version = '0.0.1.1'
|
16
|
+
|
17
|
+
gem.add_dependency 'nanoc', '>= 3.4.0'
|
18
|
+
gem.add_dependency 'typescript', '>= 0.1.1'
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nanoc-typescript
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- George Pittarelli
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nanoc
|
16
|
+
requirement: &73642850 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.4.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *73642850
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: typescript
|
27
|
+
requirement: &73642560 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.1.1
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *73642560
|
36
|
+
description: A nanoc filter to compile TypeScript to JavaScript
|
37
|
+
email:
|
38
|
+
- nanoctypescript@gjp.cc
|
39
|
+
executables: []
|
40
|
+
extensions: []
|
41
|
+
extra_rdoc_files: []
|
42
|
+
files:
|
43
|
+
- .gitignore
|
44
|
+
- Gemfile
|
45
|
+
- LICENSE
|
46
|
+
- README.md
|
47
|
+
- lib/nanoc-typescript.rb
|
48
|
+
- lib/nanoc/filters/typescript.rb
|
49
|
+
- nanoc-typescript.gemspec
|
50
|
+
homepage: https://github.com/gpittarelli/nanoc-typescript
|
51
|
+
licenses: []
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements: []
|
69
|
+
rubyforge_project:
|
70
|
+
rubygems_version: 1.8.11
|
71
|
+
signing_key:
|
72
|
+
specification_version: 3
|
73
|
+
summary: A nanoc filter to compile TypeScript
|
74
|
+
test_files: []
|