rails-webpack 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +8 -0
- data/lib/generators/webpack/USAGE +8 -0
- data/lib/generators/webpack/config_generator.rb +16 -0
- data/lib/generators/webpack/files/gulp.rake +19 -0
- data/lib/generators/webpack/files/npm.rake +22 -0
- data/lib/generators/webpack/files/prepare.rake +6 -0
- data/lib/generators/webpack/files/webpack.rake +34 -0
- data/lib/generators/webpack/files/webpack.rb +16 -0
- data/lib/generators/webpack/install_generator.rb +20 -0
- data/lib/generators/webpack/templates/webpack.yml.erb +54 -0
- data/lib/rails/webpack/version.rb +5 -0
- data/lib/rails-webpack.rb +4 -0
- data/lib/tasks/files/tasks/bower.coffee +5 -0
- data/lib/tasks/files/tasks/watch.coffee +5 -0
- data/lib/tasks/files/tasks/webpack.coffee +33 -0
- data/lib/tasks/files/tasks.coffee +18 -0
- data/lib/tasks/gulp.rake +19 -0
- data/lib/tasks/npm.rake +22 -0
- data/lib/tasks/prepare.rake +6 -0
- data/lib/tasks/semantic_ui.rake +12 -0
- data/lib/tasks/templates/bower.json.erb +26 -0
- data/lib/tasks/templates/gulpfile.coffee.erb +16 -0
- data/lib/tasks/templates/gulpfile.js.erb +3 -0
- data/lib/tasks/templates/package.json.erb +40 -0
- data/lib/tasks/webpack.rake +34 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fad043655a9f5419a641feee5305df6af0c1dcba
|
4
|
+
data.tar.gz: 588fb459c1ffa50e362d9990f3ef6701b110e4b0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 01fd3d8b7d625770685ed9bc048b4b0c0db597b5e91c05c1afab80fc2a055abea038ed7a6b3685041a54622aafa54a5e7e06560931a59b319d1ba9d4d97d6d32
|
7
|
+
data.tar.gz: b3da78526aa92e79557c9e7c6f4c8a34a397ad4edc877f450c6bae1c3f2b4b30bd9d106e4cabab7d7b1bf015da3f8d02882ec7e6647bc5ffd6252aeaababb5de
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2015 Jeong, Jiung
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
module Webpack
|
2
|
+
class ConfigGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path(__dir__)
|
4
|
+
|
5
|
+
def init_config
|
6
|
+
copy_file 'files/webpack.rb', 'config/initializers/webpack.rb'
|
7
|
+
if File.exist? Rails.root.join('config', 'webpack.yml')
|
8
|
+
log :skipped, 'config/webpack.yml'
|
9
|
+
else
|
10
|
+
template 'templates/webpack.yml.erb', 'config/webpack.yml'
|
11
|
+
end
|
12
|
+
|
13
|
+
puts 'Ready for webpack! Configure with config/webpack.yml.'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
namespace :gulp do
|
2
|
+
desc 'Run webpack'
|
3
|
+
task :webpack => 'webpack:sync' do
|
4
|
+
Dir.chdir 'app/webpack' do
|
5
|
+
sh 'gulp webpack' do |ok, _|
|
6
|
+
fail 'Error running webpack optimization.' unless ok
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
desc 'Run bower install through gulp'
|
12
|
+
task :bower => 'webpack:sync' do
|
13
|
+
Dir.chdir 'app/webpack' do
|
14
|
+
sh 'gulp bower' do |ok, _|
|
15
|
+
fail 'Error running bower install.' unless ok
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
namespace :npm do
|
2
|
+
desc 'Run npm install'
|
3
|
+
task :install => 'webpack:sync' do
|
4
|
+
Dir.chdir 'app/webpack' do
|
5
|
+
sh 'npm install' do |ok, _|
|
6
|
+
fail 'Error running npm install.' unless ok
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
desc 'Clean npm node_modules'
|
12
|
+
task :clean do
|
13
|
+
Dir.chdir 'app/webpack' do
|
14
|
+
FileUtils.rm_rf 'node_modules'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
namespace :install do
|
19
|
+
desc 'Run a clean npm install'
|
20
|
+
task :clean => %w(npm:clean npm:install)
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'rails/generators'
|
3
|
+
|
4
|
+
namespace :webpack do
|
5
|
+
class Webpack < Rails::Generators::Base
|
6
|
+
source_root File.expand_path(__dir__)
|
7
|
+
end
|
8
|
+
|
9
|
+
def thor(*args, &blk)
|
10
|
+
Webpack.new.send *args, &blk
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'Initialize Webpack environments'
|
14
|
+
task :init do
|
15
|
+
thor :empty_directory, 'app/webpack'
|
16
|
+
|
17
|
+
thor :gsub_file, 'config/initializers/assets.rb', /(version\s=\s)["'][0-9]+(\.[0-9]+)*["']$/, "\\1'#{Rails.application.config.webpack.version}'"
|
18
|
+
thor :copy_file, 'files/tasks.coffee', 'app/webpack/tasks.coffee'
|
19
|
+
thor :copy_file, 'files/tasks/bower.coffee', 'app/webpack/tasks/bower.coffee'
|
20
|
+
if File.exist? 'app/webpack/tasks/webpack.coffee'
|
21
|
+
thor :log, :unmanaged, 'app/webpack/tasks/webpack.coffee'
|
22
|
+
else
|
23
|
+
thor :copy_file, 'files/tasks/webpack.coffee', 'app/webpack/tasks/webpack.coffee'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Sync configurations with webpack'
|
28
|
+
task :sync do
|
29
|
+
thor :template, 'templates/package.json.erb', 'app/webpack/package.json', force: true
|
30
|
+
thor :template, 'templates/bower.json.erb', 'app/webpack/bower.json', force: true
|
31
|
+
thor :template, 'templates/gulpfile.js.erb', 'app/webpack/gulpfile.js', force: true
|
32
|
+
thor :template, 'templates/gulpfile.coffee.erb', 'app/webpack/gulpfile.coffee' unless File.exist? 'app/webpack/gulpfile.coffee'
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'settingslogic'
|
2
|
+
|
3
|
+
class WebpackConfig < Settingslogic
|
4
|
+
source Rails.root.join('config', 'webpack.yml')
|
5
|
+
|
6
|
+
def npm_configured?(key)
|
7
|
+
keys.include?('npm') && npm.keys.include?(key.to_s)
|
8
|
+
end
|
9
|
+
|
10
|
+
def bower_configured?(key)
|
11
|
+
keys.include?('bower') && bower.keys.include?(key.to_s)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Rails.application.config.assets.paths << Rails.root.join('app', 'assets', 'compiled')
|
16
|
+
Rails.application.config.webpack = WebpackConfig
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Webpack
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path('files', __dir__)
|
4
|
+
|
5
|
+
def install_tasks
|
6
|
+
copy_file 'npm.rake', 'lib/tasks/npm.rake'
|
7
|
+
copy_file 'gulp.rake', 'lib/tasks/gulp.rake'
|
8
|
+
copy_file 'prepare.rake', 'lib/tasks/prepare.rake'
|
9
|
+
copy_file 'webpack.rake', 'lib/tasks/webpack.rake'
|
10
|
+
end
|
11
|
+
|
12
|
+
def run_init
|
13
|
+
rake 'webpack:init'
|
14
|
+
end
|
15
|
+
|
16
|
+
def run_sync
|
17
|
+
rake 'webpack:sync'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
main: 'common.js'
|
3
|
+
version: '1.0.0'
|
4
|
+
description: 'FIXME: <%= Rails.application.class.parent.name.underscore.gsub('/', '-') %>'
|
5
|
+
#homepage: 'https://github.com/astral1/rails-webpack'
|
6
|
+
license: 'MIT'
|
7
|
+
authors:
|
8
|
+
- name: '<%= `git config user.name`.strip %>'
|
9
|
+
email: '<%= `git config user.email`.strip %>'
|
10
|
+
gulp:
|
11
|
+
default:
|
12
|
+
- 'webpack'
|
13
|
+
tasks:
|
14
|
+
- name: 'webpack'
|
15
|
+
dependencies:
|
16
|
+
- 'bower'
|
17
|
+
bower:
|
18
|
+
dependencies: []
|
19
|
+
npm:
|
20
|
+
# repoistory:
|
21
|
+
# type: 'git'
|
22
|
+
# url: 'git+ssh://git@github.com/astral1/rails-webpack.git'
|
23
|
+
# keywords:
|
24
|
+
# - webpack
|
25
|
+
# - rails
|
26
|
+
dependencies: []
|
27
|
+
# - name: 'socket.io'
|
28
|
+
# version: '~1.3'
|
29
|
+
develop_dependencies:
|
30
|
+
- name: 'coffee-loader'
|
31
|
+
version: '~0.7'
|
32
|
+
- name: 'less-loader'
|
33
|
+
version: '~2.2'
|
34
|
+
- name: 'style-loader'
|
35
|
+
version: '~0.12'
|
36
|
+
- name: 'css-loader'
|
37
|
+
version: '~0.17'
|
38
|
+
- name: 'webpack'
|
39
|
+
version: '~1.8'
|
40
|
+
- name: 'bower'
|
41
|
+
version: '~1.4'
|
42
|
+
- name: 'gulp'
|
43
|
+
version: '~3.8.11'
|
44
|
+
- name: 'gulp-util'
|
45
|
+
version: '~3.0.4'
|
46
|
+
- name: 'gulp-bower'
|
47
|
+
version: '~0.0.10'
|
48
|
+
- name: 'gulp-zip'
|
49
|
+
version: '~3.0.2'
|
50
|
+
- name: 'gulp-load-plugins'
|
51
|
+
version: '1.0.0-rc.1'
|
52
|
+
- name: 'walk-sync'
|
53
|
+
version: '~0.2.5'
|
54
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
webpack = (gulp, plugins, root) ->
|
2
|
+
path = require 'path'
|
3
|
+
webpack = require 'webpack'
|
4
|
+
(callback) ->
|
5
|
+
#run webpack
|
6
|
+
webpack(
|
7
|
+
resolve:
|
8
|
+
root: [root, path.join(root, "bower_components"), path.join(root, 'src')]
|
9
|
+
entry:
|
10
|
+
common: 'pages/common.coffee'
|
11
|
+
devise: 'pages/devise.coffee'
|
12
|
+
output:
|
13
|
+
path: path.join root, '../assets/compiled/'
|
14
|
+
filename: '[name].bundle.js'
|
15
|
+
module:
|
16
|
+
loaders: [
|
17
|
+
#{ test: /\.css$/, loader: 'style!css' },
|
18
|
+
{ test: /\.coffee$/, loader: 'coffee' },
|
19
|
+
{ test: /\.(coffee\.md|litcoffee)$/, loader: 'coffee?literate' },
|
20
|
+
{ test: /\.less$/, loader: 'style!css!less' }
|
21
|
+
]
|
22
|
+
plugins: [
|
23
|
+
new webpack.ResolverPlugin(
|
24
|
+
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
|
25
|
+
)
|
26
|
+
],
|
27
|
+
(err, stats) ->
|
28
|
+
throw new gutil.PluginError('webpack', err) if(err)
|
29
|
+
plugins.util.log('[webpack]', stats.toString())
|
30
|
+
callback())
|
31
|
+
return null
|
32
|
+
|
33
|
+
module.exports = webpack
|
@@ -0,0 +1,18 @@
|
|
1
|
+
load_tasks = (gulp, plugins, options) ->
|
2
|
+
walk_sync = require 'walk-sync'
|
3
|
+
path = require 'path'
|
4
|
+
options ||= {}
|
5
|
+
options['root'] ||= __dirname
|
6
|
+
options['dependencies'] ||= {}
|
7
|
+
|
8
|
+
nodes = walk_sync('./tasks', { globs: ['**/*.coffee'] });
|
9
|
+
|
10
|
+
for node in nodes
|
11
|
+
ext = path.extname node
|
12
|
+
name = node.replace ext, ''
|
13
|
+
if options.dependencies[name] instanceof Array
|
14
|
+
gulp.task name, options.dependencies[name], require(['./tasks', name].join('/'))(gulp, plugins, options.root)
|
15
|
+
else
|
16
|
+
gulp.task name, require(['./tasks', name].join('/'))(gulp, plugins, options.root)
|
17
|
+
|
18
|
+
module.exports = load_tasks
|
data/lib/tasks/gulp.rake
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
namespace :gulp do
|
2
|
+
desc 'Run webpack'
|
3
|
+
task :webpack => 'webpack:sync' do
|
4
|
+
Dir.chdir 'app/webpack' do
|
5
|
+
sh 'gulp webpack' do |ok, _|
|
6
|
+
fail 'Error running webpack optimization.' unless ok
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
desc 'Run bower install through gulp'
|
12
|
+
task :bower => 'webpack:sync' do
|
13
|
+
Dir.chdir 'app/webpack' do
|
14
|
+
sh 'gulp bower' do |ok, _|
|
15
|
+
fail 'Error running bower install.' unless ok
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/tasks/npm.rake
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
namespace :npm do
|
2
|
+
desc 'Run npm install'
|
3
|
+
task :install => 'webpack:sync' do
|
4
|
+
Dir.chdir 'app/webpack' do
|
5
|
+
sh 'npm install' do |ok, _|
|
6
|
+
fail 'Error running npm install.' unless ok
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
desc 'Clean npm node_modules'
|
12
|
+
task :clean do
|
13
|
+
Dir.chdir 'app/webpack' do
|
14
|
+
FileUtils.rm_rf 'node_modules'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
namespace :install do
|
19
|
+
desc 'Run a clean npm install'
|
20
|
+
task :clean => %w(npm:clean npm:install)
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
namespace :prepare do
|
2
|
+
desc 'Prepare Semantic UI'
|
3
|
+
task :semantic do
|
4
|
+
Dir.chdir 'app/webpack' do
|
5
|
+
sh 'gulp semantic-ui' do |ok, _|
|
6
|
+
fail 'Error in installing semantic-ui theme' unless ok
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
Rake::Task['prepare:webpack'].enhance ['prepare:semantic']
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"name": "<%= Rails.application.class.parent.name.underscore.gsub('/', '-') %>",
|
3
|
+
"version": "<%= Rails.configuration.webpack.version %>",
|
4
|
+
"authors": [
|
5
|
+
<%- Rails.configuration.webpack.authors.each do |author| -%>
|
6
|
+
"<%= author['name'] %> <<%= author['email'] %>>"<%= ',' unless author == Rails.configuration.webpack.authors.last %>
|
7
|
+
<%- end -%>
|
8
|
+
],
|
9
|
+
"description": "<%= Rails.configuration.webpack.description %>",
|
10
|
+
"main": "<%= Rails.configuration.webpack.main %>",
|
11
|
+
<%- if Rails.configuration.webpack.bower_configured?(:dependencies) -%>
|
12
|
+
"dependencies": {
|
13
|
+
<%- Rails.configuration.webpack.bower.dependencies.each do |dep| -%>
|
14
|
+
<%= "\"#{dep['name']}\": \"#{dep['version']}\"#{"," unless dep == Rails.configuration.webpack.bower.dependencies.last}" %>
|
15
|
+
<%- end -%>
|
16
|
+
},
|
17
|
+
<%- end -%>
|
18
|
+
"license": "<%= Rails.configuration.webpack.license %>",
|
19
|
+
"ignore": [
|
20
|
+
"**/.*",
|
21
|
+
"node_modules",
|
22
|
+
"bower_components",
|
23
|
+
"app/assets/webpack/test",
|
24
|
+
"app/assets/webpack/tests"
|
25
|
+
]
|
26
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# vim: ts=2:sw=2:ci:ai:si:et :
|
2
|
+
gulp = require 'gulp'
|
3
|
+
plugins = require('gulp-load-plugins')()
|
4
|
+
|
5
|
+
require('./tasks')(gulp, plugins,
|
6
|
+
root: __dirname
|
7
|
+
<%- dependencies = Rails.configuration.webpack.gulp.tasks.select {|task| !task['dependencies'].nil? && !task['dependencies'].empty?} unless Rails.configuration.webpack.gulp['tasks'].nil? -%>
|
8
|
+
<%- unless Rails.configuration.webpack.gulp['tasks'].nil? || dependencies.empty? -%>
|
9
|
+
dependencies:
|
10
|
+
<%- dependencies.each do |task| -%>
|
11
|
+
<%= task.name %>: <%= task.dependencies.to_s.gsub '"', "'" %>
|
12
|
+
<%- end -%>
|
13
|
+
<%- end -%>
|
14
|
+
)
|
15
|
+
|
16
|
+
gulp.task 'default', <%= Rails.configuration.webpack.gulp.default.to_s.gsub '"', "'" -%>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"name": "<%= Rails.application.class.parent.name.underscore.gsub('/', '-') %>",
|
3
|
+
"version": "<%= Rails.application.config.webpack.version %>",
|
4
|
+
"description": "<%= Rails.application.config.webpack.description %>",
|
5
|
+
"main": "<%= Rails.application.config.webpack.main %>",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
<%- if Rails.configuration.webpack.npm_configured?('repository') -%>
|
10
|
+
"repository": {
|
11
|
+
"type": "<%= Rails.configuration.webpack.npm.repository.type %>",
|
12
|
+
"url": "<%= Rails.configuration.webpack.npm.repository.url %>"
|
13
|
+
},
|
14
|
+
<%- end -%>
|
15
|
+
<%- if Rails.configuration.webpack.npm_configured?('keywords') -%>
|
16
|
+
"keywords": [
|
17
|
+
<%- Rails.configuration.webpack.npm.keywords.each do |keyword| -%>
|
18
|
+
"<%= keyword %>"<%= ',' unless keyword == Rails.configuration.webpack.npm.keywords.last %>
|
19
|
+
<%- end -%>
|
20
|
+
],
|
21
|
+
<%- end -%>
|
22
|
+
<%- if Rails.configuration.webpack.npm_configured?('dependencies') -%>
|
23
|
+
"dependencies": {
|
24
|
+
<%- Rails.configuration.webpack.npm.dependencies.each do |dep| -%>
|
25
|
+
"<%= dep['name']%>": "<%= dep['version'] %>"<%= ',' unless dep == Rails.configuration.webpack.npm.dependencies.last %>
|
26
|
+
<%- end -%>
|
27
|
+
},
|
28
|
+
<%- end -%>
|
29
|
+
<%- if Rails.configuration.webpack.npm_configured?('develop_dependencies') -%>
|
30
|
+
"devDependencies": {
|
31
|
+
<%- Rails.configuration.webpack.npm.develop_dependencies.each do |dep| -%>
|
32
|
+
"<%= dep['name']%>": "<%= dep['version'] %>"<%= ',' unless dep == Rails.configuration.webpack.npm.develop_dependencies.last %>
|
33
|
+
<%- end -%>
|
34
|
+
},
|
35
|
+
<%- end -%>
|
36
|
+
"author": "<%= Rails.configuration.webpack.authors.first['name'] %> <<%= Rails.configuration.webpack.authors.first['email'] %>>",
|
37
|
+
"license": "<%= Rails.application.config.webpack.license %>"<%- if Rails.application.config.webpack.keys.include?('homepage') -%>,
|
38
|
+
"homepage": "<%= Rails.application.config.webpack.homepage %>"
|
39
|
+
<%- end -%>
|
40
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'rails/generators'
|
3
|
+
|
4
|
+
namespace :webpack do
|
5
|
+
class Webpack < Rails::Generators::Base
|
6
|
+
source_root File.expand_path(__dir__)
|
7
|
+
end
|
8
|
+
|
9
|
+
def thor(*args, &blk)
|
10
|
+
Webpack.new.send *args, &blk
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'Initialize Webpack environments'
|
14
|
+
task :init do
|
15
|
+
thor :empty_directory, 'app/webpack'
|
16
|
+
|
17
|
+
thor :gsub_file, 'config/initializers/assets.rb', /(version\s=\s)["'][0-9]+(\.[0-9]+)*["']$/, "\\1'#{Rails.application.config.webpack.version}'"
|
18
|
+
thor :copy_file, 'files/tasks.coffee', 'app/webpack/tasks.coffee'
|
19
|
+
thor :copy_file, 'files/tasks/bower.coffee', 'app/webpack/tasks/bower.coffee'
|
20
|
+
if File.exist? 'app/webpack/tasks/webpack.coffee'
|
21
|
+
thor :log, :unmanaged, 'app/webpack/tasks/webpack.coffee'
|
22
|
+
else
|
23
|
+
thor :copy_file, 'files/tasks/webpack.coffee', 'app/webpack/tasks/webpack.coffee'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Sync configurations with webpack'
|
28
|
+
task :sync do
|
29
|
+
thor :template, 'templates/package.json.erb', 'app/webpack/package.json', force: true
|
30
|
+
thor :template, 'templates/bower.json.erb', 'app/webpack/bower.json', force: true
|
31
|
+
thor :template, 'templates/gulpfile.js.erb', 'app/webpack/gulpfile.js', force: true
|
32
|
+
thor :template, 'templates/gulpfile.coffee.erb', 'app/webpack/gulpfile.coffee' unless File.exist? 'app/webpack/gulpfile.coffee'
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails-webpack
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jeong, Jiung
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 4.2.3
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '4.2'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 4.2.3
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: settingslogic
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.0'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.0.9
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '2.0'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.0.9
|
53
|
+
description: Rails Plugin fro webpack support
|
54
|
+
email:
|
55
|
+
- ethernuiel@sanultari.com
|
56
|
+
executables: []
|
57
|
+
extensions: []
|
58
|
+
extra_rdoc_files: []
|
59
|
+
files:
|
60
|
+
- MIT-LICENSE
|
61
|
+
- README.rdoc
|
62
|
+
- Rakefile
|
63
|
+
- lib/generators/webpack/USAGE
|
64
|
+
- lib/generators/webpack/config_generator.rb
|
65
|
+
- lib/generators/webpack/files/gulp.rake
|
66
|
+
- lib/generators/webpack/files/npm.rake
|
67
|
+
- lib/generators/webpack/files/prepare.rake
|
68
|
+
- lib/generators/webpack/files/webpack.rake
|
69
|
+
- lib/generators/webpack/files/webpack.rb
|
70
|
+
- lib/generators/webpack/install_generator.rb
|
71
|
+
- lib/generators/webpack/templates/webpack.yml.erb
|
72
|
+
- lib/rails-webpack.rb
|
73
|
+
- lib/rails/webpack/version.rb
|
74
|
+
- lib/tasks/files/tasks.coffee
|
75
|
+
- lib/tasks/files/tasks/bower.coffee
|
76
|
+
- lib/tasks/files/tasks/watch.coffee
|
77
|
+
- lib/tasks/files/tasks/webpack.coffee
|
78
|
+
- lib/tasks/gulp.rake
|
79
|
+
- lib/tasks/npm.rake
|
80
|
+
- lib/tasks/prepare.rake
|
81
|
+
- lib/tasks/semantic_ui.rake
|
82
|
+
- lib/tasks/templates/bower.json.erb
|
83
|
+
- lib/tasks/templates/gulpfile.coffee.erb
|
84
|
+
- lib/tasks/templates/gulpfile.js.erb
|
85
|
+
- lib/tasks/templates/package.json.erb
|
86
|
+
- lib/tasks/webpack.rake
|
87
|
+
homepage: https://bitbucket.org/amamcloud/rails-webpack
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.4.6
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: Rails Plugin fro webpack support
|
111
|
+
test_files: []
|