babel-rails 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccd64ad5747aae0d7794196d752e9c82a89aee12
4
- data.tar.gz: 6ea06da9c7d88cf365fc2e382dbbda3828e232da
3
+ metadata.gz: dfe9f71c620f62d0ae763e9be5ba03a28a68989a
4
+ data.tar.gz: b1ddf9f6862cf458f3f040a2657527bbecaec8ac
5
5
  SHA512:
6
- metadata.gz: 42f050b317d54ab66eff3986508dc454f8b363ce4693c2c0f659565b3311cd04becf1d0dbd561a8dfb4fa9850963113b7f14b92cf922b5a5731574a2df3b1e6c
7
- data.tar.gz: a84b9cade19a31d80a382417f823f36d1db7791c44a21020f4a9b916ff0c20fce74801d232df5715a7de950c641ff8cb74a4f59a92d3deaf2a49ab9aa549c7e7
6
+ metadata.gz: 574980e34e358bf68cdbfc9a33ab170defaa4acfb9b11b642182df2be39b96d55344d67615b89e2cd0fbea533ba750b006675f9bcdb9964631e77a995f5b81b2
7
+ data.tar.gz: 0e179e99efa6dcf963b29ae0b85d7ee94fc322374832055289bf20e28c23a6746aa72e84b1b0ab54b0d072cd6124768ba827c3c3ffda945af1a86d3f0c6285a3
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -0,0 +1,3 @@
1
+ require 'babel-transpiler'
2
+ require 'babel/rails/railtie'
3
+ require 'babel/rails/version'
@@ -0,0 +1,15 @@
1
+ module Babel
2
+ module Rails
3
+ module JsHook
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ no_tasks do
8
+ redefine_method :js_template do |source, destination|
9
+ template(source + '.es6', destination + '.es6')
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ require 'rails/railtie'
2
+ require 'rails/generators'
3
+ require 'babel/rails/js_hook.rb'
4
+
5
+ module Babel
6
+ module Rails
7
+ class Railtie < ::Rails::Railtie
8
+ config.app_generators.javascript_engine :es6
9
+
10
+ initializer 'override js_template hook' do |app|
11
+ if app.config.generators.rails[:javascript_engine] == :es6
12
+ ::Rails::Generators::NamedBase.send :include, Babel::Rails::JsHook
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  module Babel
2
2
  module Rails
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
- end
5
+ end
Binary file
Binary file
Binary file
@@ -0,0 +1,13 @@
1
+ require "rails/generators/named_base"
2
+
3
+ module Babel
4
+ module Generators
5
+ class AssetsGenerator < ::Rails::Generators::NamedBase
6
+ source_root File.expand_path("../templates", __FILE__)
7
+
8
+ def copy_es6
9
+ template "javascript.es6", File.join('app/assets/javascripts', class_path,"#{file_name}.es6")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
3
+ // You can use ES2015+ in this file: https://babeljs.io/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babel-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - liceova22@gmail.com
@@ -102,8 +102,17 @@ files:
102
102
  - babel-rails.gemspec
103
103
  - bin/console
104
104
  - bin/setup
105
+ - lib/babel-rails.rb
105
106
  - lib/babel/rails.rb
107
+ - lib/babel/rails/js_hook.rb
108
+ - lib/babel/rails/railtie.rb
106
109
  - lib/babel/rails/version.rb
110
+ - lib/rails/.DS_Store
111
+ - lib/rails/generators/.DS_Store
112
+ - lib/rails/generators/es6/.DS_Store
113
+ - lib/rails/generators/es6/assets/.DS_Store
114
+ - lib/rails/generators/es6/assets/assets_generator.rb
115
+ - lib/rails/generators/es6/assets/templates/javascript.es6
107
116
  homepage: https://github.com/Liceth/babel-rails.
108
117
  licenses:
109
118
  - MIT