typescript-rails 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5d77f08721b8681ce68d5aedb9dc14926de34fc
4
- data.tar.gz: 2f96be0c4b65b5ede9f1ef812e488511401469f5
3
+ metadata.gz: d275ff8fd90b13580de3f11a3798e0cbd9aec47c
4
+ data.tar.gz: 2942656ec7afda0c974fb05f3300058747862e58
5
5
  SHA512:
6
- metadata.gz: 5672c91a06cf89f43577e5d0a8d43fdf5bd88866b54e85607b45c222fdfb4bc125bffa83fc814e8270826a4e533f5f6fb3aabb18d36d60b3c6bdd37dcb4c9ab9
7
- data.tar.gz: 9826e185b8e56e55fcbdb61cb2ed46b2330dab8764655a766107dcd7340b7e3e6c143e7a2ca80c2af9ccac5988eb5c97fcbad4a1b533b721ef9eb611e7ce4684
6
+ metadata.gz: 55f7d3ee2d3e65b07e65fa0e3c7d2a742abbff70679eb00cd3d20c9267532be40d4909b9883d10d905b0f081afca82cb8c1678ad918142be74322813abfb4530
7
+ data.tar.gz: bee501dd861c693c090563015b480e5aac5d161390c301a742b26fde02ed96d1dbd5269e24228dae9a807d3a7d58828906b78ab05919d687ab7517dec2b1a7f6
data/CHANGES.md ADDED
@@ -0,0 +1,4 @@
1
+ ## v0.3.0 2014-08-09 10:27:54+0900
2
+
3
+ * Compiles TypeScript files in ES5 mode
4
+
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # TypeScript for Rails [![Build Status](https://travis-ci.org/typescript-rails/typescript-rails.svg?branch=master)](https://travis-ci.org/typescript-rails/typescript-rails)
1
+ # TypeScript for Rails [![Build Status](https://travis-ci.org/typescript-ruby/typescript-rails.svg?branch=master)](https://travis-ci.org/typescript-ruby/typescript-rails)
2
2
 
3
3
  This is a wrapper for the [TypeScript](http://www.typescriptlang.org/) JavaScript superset language by Microsoft.
4
4
 
5
5
  It enables you to use the `.ts` extension in the Asset Pipeline and also in ActionView Templates.
6
6
 
7
7
  This gem uses the
8
- [typescript-node-ruby](https://github.com/tkawachi/typescript-node-ruby)
8
+ [typescript-node-ruby](https://github.com/typescript-ruby/typescript-node-ruby)
9
9
  library by KAWACHI Takashi for the typescript parsing with node js.
10
10
 
11
11
  The credit for the overall structure and the tests goes to the people that wrote the [coffee-rails](https://github.com/rails/coffee-rails) Gem, since I shamelessly copy&pasted some of their code.
data/Rakefile CHANGED
@@ -8,4 +8,6 @@ Rake::TestTask.new(:test) do |t|
8
8
  t.libs << 'test'
9
9
  t.pattern = 'test/**/*_test.rb'
10
10
  t.verbose = false
11
- end
11
+ end
12
+
13
+ task :default => :test
@@ -1,6 +1,4 @@
1
- require "typescript-node"
2
-
3
- require "typescript/rails/railtie"
4
- require "typescript/rails/engine"
5
- require "typescript/rails/template_handler"
6
- require "typescript/rails/version"
1
+ require 'typescript/rails/railtie'
2
+ require 'typescript/rails/engine'
3
+ require 'typescript/rails/template_handler'
4
+ require 'typescript/rails/version'
@@ -1,3 +1,4 @@
1
+ require 'typescript-node'
1
2
  require 'tilt'
2
3
 
3
4
  module Typescript
@@ -16,12 +17,12 @@ module Typescript
16
17
  @@default_bare = value
17
18
  end
18
19
 
19
- # DEPRECATED
20
+ # @deprecated
20
21
  def self.default_no_wrap
21
22
  @@default_bare
22
23
  end
23
24
 
24
- # DEPRECATED
25
+ # @deprecated
25
26
  def self.default_no_wrap=(value)
26
27
  @@default_bare = value
27
28
  end
@@ -42,7 +43,8 @@ module Typescript
42
43
 
43
44
  def evaluate(scope, locals, &block)
44
45
  source = Typescript::Rails.replace_relative_references(file, data)
45
- @output ||= TypeScript::Node.compile(source)
46
+ # TODO: employs source-maps
47
+ @output ||= TypeScript::Node.compile(source, '--target', 'ES5')
46
48
  end
47
49
 
48
50
  def allows_script?
@@ -63,7 +65,8 @@ module Typescript
63
65
  TypeScript::Node.compile(
64
66
  Typescript::Rails.replace_relative_references(
65
67
  '#{escaped_path}', (begin;#{compiled_source};end)
66
- )
68
+ ),
69
+ '--target', 'ES5'
67
70
  )
68
71
  EOS
69
72
  end
@@ -1,5 +1,5 @@
1
1
  module Typescript
2
2
  module Rails
3
- VERSION = "0.2.0"
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -0,0 +1,7 @@
1
+ class Person {
2
+ private _name = "Alice";
3
+
4
+ public get name(): string {
5
+ return this._name
6
+ }
7
+ }
@@ -8,12 +8,13 @@ end
8
8
 
9
9
  DummyApp = ActionDispatch::Routing::RouteSet.new
10
10
  DummyApp.draw do
11
- get "site/index"
12
- get "site/ref1_1"
13
- get "site/ref1_2"
14
- get "site/ref2_1"
15
- get "site/ref2_2"
16
- get "site/ref3_1"
11
+ get 'site/index'
12
+ get 'site/ref1_1'
13
+ get 'site/ref1_2'
14
+ get 'site/ref2_1'
15
+ get 'site/ref2_2'
16
+ get 'site/ref3_1'
17
+ get 'site/es5'
17
18
  end
18
19
 
19
20
  class TemplateHandlerTest < ActiveSupport::TestCase
@@ -52,4 +53,8 @@ class TemplateHandlerTest < ActiveSupport::TestCase
52
53
  source
53
54
  end
54
55
 
56
+ test 'ES5 features' do
57
+ get '/site/es5.js'
58
+ assert_equal 200, last_response.status
59
+ end
55
60
  end
@@ -12,11 +12,9 @@ Gem::Specification.new do |gem|
12
12
  gem.email = ["gfuji@cpan.org", "klaus.zanders@gmail.com"]
13
13
  gem.description = %q{Adds Typescript to the Rails Asset pipeline}
14
14
  gem.summary = %q{Adds Typescript to the Rails Asset pipeline}
15
- gem.homepage = "https://github.com/typescript-rails/typescript-rails"
15
+ gem.homepage = "https://github.com/typescript-ruby/typescript-rails"
16
16
 
17
- gem.rubyforge_project = "typescript-rails"
18
-
19
- gem.add_runtime_dependency 'typescript-node'
17
+ gem.add_runtime_dependency 'typescript-node', '>= 1.1.0'
20
18
  gem.add_runtime_dependency 'tilt'
21
19
  gem.add_runtime_dependency 'railties'
22
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typescript-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FUJI, Goro
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-29 00:00:00.000000000 Z
12
+ date: 2014-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: typescript-node
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: 1.1.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: 1.1.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: tilt
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -63,6 +63,7 @@ extra_rdoc_files: []
63
63
  files:
64
64
  - ".gitignore"
65
65
  - ".travis.yml"
66
+ - CHANGES.md
66
67
  - Gemfile
67
68
  - LICENSE.txt
68
69
  - README.md
@@ -75,6 +76,7 @@ files:
75
76
  - lib/typescript/rails/version.rb
76
77
  - test/assets_test.rb
77
78
  - test/support/routes.rb
79
+ - test/support/site/es5.js.ts
78
80
  - test/support/site/index.js.ts
79
81
  - test/support/site/ref1_1.js.ts
80
82
  - test/support/site/ref1_2.js.ts
@@ -86,7 +88,7 @@ files:
86
88
  - test/template_handler_test.rb
87
89
  - test/test_helper.rb
88
90
  - typescript-rails.gemspec
89
- homepage: https://github.com/typescript-rails/typescript-rails
91
+ homepage: https://github.com/typescript-ruby/typescript-rails
90
92
  licenses: []
91
93
  metadata: {}
92
94
  post_install_message:
@@ -104,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
106
  - !ruby/object:Gem::Version
105
107
  version: '0'
106
108
  requirements: []
107
- rubyforge_project: typescript-rails
109
+ rubyforge_project:
108
110
  rubygems_version: 2.2.2
109
111
  signing_key:
110
112
  specification_version: 4
@@ -112,6 +114,7 @@ summary: Adds Typescript to the Rails Asset pipeline
112
114
  test_files:
113
115
  - test/assets_test.rb
114
116
  - test/support/routes.rb
117
+ - test/support/site/es5.js.ts
115
118
  - test/support/site/index.js.ts
116
119
  - test/support/site/ref1_1.js.ts
117
120
  - test/support/site/ref1_2.js.ts