Skip to content

Commit 1a9ce67

Browse files
committed
Updated gem version
Updated tests for sprockets v3.2.0
1 parent c9400e9 commit 1a9ce67

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

Diff for: CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v0.6.0 2015-07-06 22:36:25+0300
2+
3+
* Updated version to 0.6.0 for using Typescript source 1.4.1.3
4+
15
## v0.5.0 2015-03-25 10:46:29+0900
26

37
* Expire root TS cache in response to change in referenced `.ts` files (#24)

Diff for: lib/typescript/rails/compiler.rb

+2-7
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ def replace_relative_references(ts_path, source)
1717

1818
# Why don't we just use gsub? Because it display odd behavior with File.join on Ruby 2.0
1919
# So we go the long way around.
20-
output = (source.each_line.map do |l|
20+
(source.each_line.map do |l|
2121
if l.starts_with?('///') && !(m = %r!^///\s*<reference\s+path=(?:"([^"]+)"|'([^']+)')\s*/>\s*!.match(l)).nil?
2222
matched_path = m.captures.compact[0]
2323
l = l.sub(matched_path, File.join(escaped_dir, matched_path))
2424
end
2525
next l
2626
end).join
27-
28-
output
2927
end
3028

3129
# Get all references
@@ -64,8 +62,5 @@ def compile(ts_path, source, context=nil, *options)
6462

6563
end
6664

67-
self.default_options = [
68-
'--target', 'ES5',
69-
'--noImplicitAny'
70-
]
65+
self.default_options = %w(--target ES5 --noImplicitAny)
7166
end

Diff for: lib/typescript/rails/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Typescript
22
module Rails
3-
VERSION = '0.5.0'
3+
VERSION = '0.6.0'
44
end
55
end

Diff for: test/assets_test.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'test_helper'
1+
require File.join(File.dirname(__FILE__), 'test_helper.rb')
22
require 'typescript-rails'
33

44
require "action_controller/railtie"
@@ -35,14 +35,14 @@ def assets
3535
@app.assets
3636
end
3737

38-
test "typescript.js is included in Sprockets environment" do
39-
assert { assets["typescript"].pathname.to_s.end_with?('/lib/assets/javascripts/typescript.js.erb') }
40-
assert { assets["typescript"].body.include?('var TypeScript') }
38+
test 'typescript.js is included in Sprockets environment' do
39+
assert { assets["typescript"].filename.to_s.end_with?('/lib/assets/javascripts/typescript.js.erb') }
40+
assert { assets["typescript"].source.include?('var ts;') }
4141
end
4242

43-
test "assets .js.ts is compiled from TypeScript to JavaScript" do
43+
test 'assets .js.ts is compiled from TypeScript to JavaScript' do
4444
assert { assets["javascripts/hello"].present? }
45-
assert { assets["javascripts/hello"].send(:dependency_paths).map(&:pathname).map(&:to_s).include? File.expand_path("#{File.dirname(__FILE__)}/fixtures/assets/javascripts/included.ts") }
46-
assert { assets["javascripts/hello"].body.include?('var s = "Hello, world!";') }
45+
assert { assets["javascripts/hello"].source.include?('var log_to_console = function (x) {') }
46+
assert { assets["javascripts/hello"].source.include?('var s = "Hello, world!";') }
4747
end
4848
end

Diff for: typescript-rails.gemspec

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
55
require 'typescript/rails/version'
66

77
Gem::Specification.new do |gem|
8-
gem.name = "typescript-rails"
8+
gem.name = 'typescript-rails'
99
gem.version = Typescript::Rails::VERSION
1010
gem.platform = Gem::Platform::RUBY
11-
gem.authors = ["FUJI, Goro", "Klaus Zanders"]
12-
11+
gem.authors = ['FUJI, Goro', 'Klaus Zanders']
12+
1313
gem.description = %q{Adds Typescript to the Rails Asset pipeline}
1414
gem.summary = %q{Adds Typescript to the Rails Asset pipeline}
15-
gem.homepage = "https://github.com/typescript-ruby/typescript-rails"
15+
gem.homepage = 'https://github.com/typescript-ruby/typescript-rails'
1616

17-
gem.add_runtime_dependency 'typescript-node', '>= 1.1.0'
17+
gem.add_runtime_dependency 'typescript-node', '>= 1.4.1'
1818
gem.add_runtime_dependency 'tilt'
1919
gem.add_runtime_dependency 'railties'
2020

2121
gem.files = `git ls-files`.split($/)
2222
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
2323
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
24-
gem.require_paths = ["lib"]
24+
gem.require_paths = ['lib']
2525

26-
gem.required_ruby_version = ">= 2.0.0"
26+
gem.required_ruby_version = '>= 2.0.0'
2727
end

0 commit comments

Comments
 (0)