es6_tilt 0.0.3 → 0.0.4

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: da27efd5d2081a5efb508968e382fc2f6b74d398
4
- data.tar.gz: c654f8a5b53dc637656a87e1b49452695ad25fcf
3
+ metadata.gz: 3845993d0ebb67e3a1978bb4eedd8df5d5ef5773
4
+ data.tar.gz: 0cf67d77d3d12283024329d4d6033422fa131411
5
5
  SHA512:
6
- metadata.gz: cffb85fc6b5c5fe6909e09a9dc8530b904d5b0129a095c6c83d3117289d5e33b0d8c6b027cceaea6b299ed40c60516bfe71f7441c6778122a19df801101b2303
7
- data.tar.gz: a90c8373d7d9e28bb670562269584bd24a4b5bf6287ad10b6ce82ba76c9366094046d7c58ba20c14aaccb550ca562fed483a517674a03e609d8fa49fa191958d
6
+ metadata.gz: 4c288fe6c71766f467fb7924fcf2f6fa51b55393a730a7e7d9dcb996f1950f100ba4e2f3c6bfef01362ff301a895b6ff7bf3e258ba848635c49764a5863dd9ee
7
+ data.tar.gz: e489916b8da940c159cd264dfc9ce19463f3e16ed539c9152d193adbb97335e5b5acb8540c592592f7b9e760954d77422eb1bf3e7496fc469e6370ea3c0d6b96
data/README.rdoc CHANGED
@@ -1,3 +1,15 @@
1
1
  = Es6Tilt
2
2
 
3
- This project rocks and uses MIT-LICENSE.
3
+ Allows you to use es6 in your ruby apps (with tilt or sprockets).
4
+
5
+ == Rails Install
6
+ Add this to your Gemfile:
7
+ gem 'es6_tilt'
8
+ Now add an initializer for the filetype you'd like to have. So for example.
9
+ #config/initializers/sprockets.rb
10
+ Rails.application.assets.register_engine '.es6', ES6Tilt::ES6Transformer
11
+
12
+ That will make files ending with .es6 show up as js in your browser.
13
+ Can work on .jsx files as well. It's just Babel in the background.
14
+
15
+ This project rocks and uses MIT-LICENSE.
@@ -1,3 +1,3 @@
1
1
  module Es6Tilt
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/es6_tilt.rb CHANGED
@@ -10,7 +10,7 @@ module ES6Tilt
10
10
  end
11
11
 
12
12
  def evaluate(scope, locals, &block)
13
- output = Babel::Transpiler.transform(data)
13
+ output = Babel::Transpiler.transform(data, {"modules" => "system"})
14
14
  output["code"]
15
15
  end
16
16
 
@@ -242,5 +242,141 @@ Es6TiltTest: test_transpile
242
242
   (0.1ms) begin transaction
243
243
  -----------------------
244
244
  Es6TiltTest: test_truth
245
+ -----------------------
246
+  (0.0ms) rollback transaction
247
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
248
+  (2.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
249
+  (0.1ms) select sqlite_version(*)
250
+  (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
251
+  (0.2ms) SELECT version FROM "schema_migrations"
252
+  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
253
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
254
+  (0.1ms) begin transaction
255
+ ---------------------------
256
+ Es6TiltTest: test_transpile
257
+ ---------------------------
258
+  (0.2ms) rollback transaction
259
+  (0.1ms) begin transaction
260
+ -----------------------
261
+ Es6TiltTest: test_truth
262
+ -----------------------
263
+  (0.1ms) rollback transaction
264
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
265
+  (3.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
266
+  (0.1ms) select sqlite_version(*)
267
+  (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
268
+  (0.2ms) SELECT version FROM "schema_migrations"
269
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
270
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
271
+  (0.2ms) begin transaction
272
+ ---------------------------
273
+ Es6TiltTest: test_transpile
274
+ ---------------------------
275
+  (0.2ms) rollback transaction
276
+  (0.3ms) begin transaction
277
+ -----------------------
278
+ Es6TiltTest: test_truth
279
+ -----------------------
280
+  (0.1ms) rollback transaction
281
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
282
+  (3.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
283
+  (0.1ms) select sqlite_version(*)
284
+  (5.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
285
+  (0.1ms) SELECT version FROM "schema_migrations"
286
+  (2.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
287
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
288
+  (0.1ms) begin transaction
289
+ -----------------------
290
+ Es6TiltTest: test_truth
291
+ -----------------------
292
+  (0.0ms) rollback transaction
293
+  (0.0ms) begin transaction
294
+ ---------------------------
295
+ Es6TiltTest: test_transpile
296
+ ---------------------------
297
+  (0.1ms) rollback transaction
298
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
299
+  (2.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
300
+  (0.1ms) select sqlite_version(*)
301
+  (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
302
+  (0.1ms) SELECT version FROM "schema_migrations"
303
+  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
304
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
305
+  (0.1ms) begin transaction
306
+ ---------------------------
307
+ Es6TiltTest: test_transpile
308
+ ---------------------------
309
+  (0.1ms) rollback transaction
310
+  (0.2ms) begin transaction
311
+ -----------------------
312
+ Es6TiltTest: test_truth
313
+ -----------------------
314
+  (0.1ms) rollback transaction
315
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
316
+  (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
317
+  (0.1ms) select sqlite_version(*)
318
+  (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
319
+  (0.1ms) SELECT version FROM "schema_migrations"
320
+  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
321
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
322
+  (0.1ms) begin transaction
323
+ ---------------------------
324
+ Es6TiltTest: test_transpile
325
+ ---------------------------
326
+  (0.1ms) rollback transaction
327
+  (0.1ms) begin transaction
328
+ -----------------------
329
+ Es6TiltTest: test_truth
330
+ -----------------------
331
+  (0.1ms) rollback transaction
332
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
333
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
334
+  (0.1ms) select sqlite_version(*)
335
+  (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
336
+  (0.1ms) SELECT version FROM "schema_migrations"
337
+  (3.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
338
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
339
+  (0.1ms) begin transaction
340
+ ---------------------------
341
+ Es6TiltTest: test_transpile
342
+ ---------------------------
343
+  (0.1ms) rollback transaction
344
+  (0.1ms) begin transaction
345
+ -----------------------
346
+ Es6TiltTest: test_truth
347
+ -----------------------
348
+  (0.0ms) rollback transaction
349
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
350
+  (2.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
351
+  (0.1ms) select sqlite_version(*)
352
+  (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
353
+  (0.1ms) SELECT version FROM "schema_migrations"
354
+  (3.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
355
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
356
+  (0.1ms) begin transaction
357
+ ---------------------------
358
+ Es6TiltTest: test_transpile
359
+ ---------------------------
360
+  (0.1ms) rollback transaction
361
+  (0.1ms) begin transaction
362
+ -----------------------
363
+ Es6TiltTest: test_truth
364
+ -----------------------
365
+  (0.1ms) rollback transaction
366
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
367
+  (2.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
368
+  (0.1ms) select sqlite_version(*)
369
+  (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
370
+  (0.1ms) SELECT version FROM "schema_migrations"
371
+  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
372
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
373
+  (0.1ms) begin transaction
374
+ ---------------------------
375
+ Es6TiltTest: test_transpile
376
+ ---------------------------
377
+  (0.1ms) rollback transaction
378
+  (0.1ms) begin transaction
379
+ -----------------------
380
+ Es6TiltTest: test_truth
245
381
  -----------------------
246
382
   (0.0ms) rollback transaction
@@ -8,21 +8,30 @@ class Es6TiltTest < ActiveSupport::TestCase
8
8
  test "transpile" do
9
9
  template = ES6Tilt::ES6Transformer.new('./test/dummy/app/assets/javascripts/test.es6')
10
10
  output = template.render
11
- expectation = '"use strict";
11
+ expectation = 'System.register([], function (_export) {
12
+ var _classCallCheck, Person;
12
13
 
13
- var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
14
+ return {
15
+ setters: [],
16
+ execute: function () {
17
+ "use strict";
14
18
 
15
- /**
16
- * Created by michaelarchibald on 3/25/15.
17
- */
19
+ _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
18
20
 
19
- var Person = function Person() {
20
- var args = arguments[0] === undefined ? "default" : arguments[0];
21
+ /**
22
+ * Created by michaelarchibald on 3/25/15.
23
+ */
21
24
 
22
- _classCallCheck(this, Person);
25
+ Person = function Person() {
26
+ var args = arguments[0] === undefined ? "default" : arguments[0];
23
27
 
24
- this.eat = "happy Meal";
25
- };'
28
+ _classCallCheck(this, Person);
29
+
30
+ this.eat = "happy Meal";
31
+ };
32
+ }
33
+ };
34
+ });'
26
35
  assert_equal expectation, output
27
36
  end
28
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: es6_tilt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Archibald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  version: '0'
161
161
  requirements: []
162
162
  rubyforge_project:
163
- rubygems_version: 2.4.5
163
+ rubygems_version: 2.4.6
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: Transpiles es6 to js