r5 0.4.0.2 → 0.4.0.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 +4 -4
- data/lib/r5/recipes/materialize.rb +35 -20
- data/lib/r5/starter.rb +8 -3
- data/lib/r5/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae3414e9df9b6b59cdaa4d7878e32d08e2e58204
|
4
|
+
data.tar.gz: 4ec373b9a429d70a3e43a27e12792721378206ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00321c3a4c01006c5c441763c6392ee24eed975b00ad497cbf82c25beb9bc03972b249ceef4c024d7f484c22cb3e106e420613398fc2da537fdc625614b11804
|
7
|
+
data.tar.gz: 977072d4966d971202f3d5dd05566662d73e940a7441feef01538d099146670094b3fae51049f10e0567713c93e0d24f9a4000f54d56153059ac9499989de5fa
|
@@ -17,6 +17,27 @@ before: "\n//= require_tree ." do <<-TXT
|
|
17
17
|
TXT
|
18
18
|
end
|
19
19
|
|
20
|
+
|
21
|
+
create_file "#{@project_path}/config/webpack/custom.js" do <<-JS
|
22
|
+
const webpack = require('webpack')
|
23
|
+
|
24
|
+
module.exports = {
|
25
|
+
resolve: {
|
26
|
+
alias: {
|
27
|
+
jquery: 'jquery/src/jquery',
|
28
|
+
}
|
29
|
+
},
|
30
|
+
}
|
31
|
+
|
32
|
+
// config/webpack/development.js
|
33
|
+
const merge = require('webpack-merge')
|
34
|
+
const environment = require('./environment')
|
35
|
+
const customConfig = require('./custom')
|
36
|
+
|
37
|
+
module.exports = merge(environment.toWebpackConfig(), customConfig)
|
38
|
+
JS
|
39
|
+
end
|
40
|
+
|
20
41
|
insert_into_file "#{@project_path}/app/javascript/packs/application.js",
|
21
42
|
after: "console.log('Hello World from Webpacker')" do <<-JS
|
22
43
|
|
@@ -25,32 +46,26 @@ window.jQuery = jQuery
|
|
25
46
|
|
26
47
|
let ready;
|
27
48
|
ready = function() {
|
28
|
-
$(".datepicker").datetimepicker({locale: 'cs', format: 'D. M. YYYY'});
|
49
|
+
// $(".datepicker").datetimepicker({locale: 'cs', format: 'D. M. YYYY'});
|
29
50
|
};
|
30
51
|
// Fire javascript after turbolinks event
|
31
52
|
$(document).on('turbolinks:load', ready);
|
32
53
|
JS
|
33
54
|
end
|
34
55
|
|
35
|
-
insert_into_file "#{@project_path}/config/webpack/
|
36
|
-
after: "
|
37
|
-
]," do <<-JS
|
38
|
-
|
39
|
-
resolve: {
|
40
|
-
alias: {
|
41
|
-
jquery: "jquery/src/jquery"
|
42
|
-
}
|
43
|
-
},
|
44
|
-
JS
|
45
|
-
end
|
46
|
-
|
47
|
-
insert_into_file "#{@project_path}/config/webpack/shared.js",
|
48
|
-
after: "new ExtractTextPlugin(env.NODE_ENV === 'production' ? '[name]-[hash].css' : '[name].css')," do <<-JS
|
56
|
+
insert_into_file "#{@project_path}/config/webpack/environment.js",
|
57
|
+
after: "const { environment } = require('@rails/webpacker')" do <<-JS
|
49
58
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
59
|
+
const webpack = require('webpack')
|
60
|
+
|
61
|
+
// Add an additional plugin of your choosing : ProvidePlugin
|
62
|
+
environment.plugins.set(
|
63
|
+
'Provide',
|
64
|
+
new webpack.ProvidePlugin({
|
65
|
+
$: 'jquery',
|
66
|
+
jQuery: 'jquery',
|
67
|
+
jquery: 'jquery',
|
68
|
+
})
|
69
|
+
)
|
55
70
|
JS
|
56
71
|
end
|
data/lib/r5/starter.rb
CHANGED
@@ -13,16 +13,21 @@ class Starter < Thor
|
|
13
13
|
create_config_file
|
14
14
|
end
|
15
15
|
|
16
|
-
if
|
16
|
+
if (system "rails -v").nil? or (%x[rails -v] =~ /Rails 5.1.*/).nil?
|
17
17
|
say "You didn't install Rails or have version lower than 5.1 Please install proper version.", :red
|
18
18
|
abort
|
19
19
|
end
|
20
20
|
|
21
|
-
if
|
21
|
+
if (system "yarn --version").nil?
|
22
22
|
say "You need to install yarn on your system to manage javascript assets", :red
|
23
23
|
abort
|
24
24
|
end
|
25
25
|
|
26
|
+
if (system "webpack").nil?
|
27
|
+
say "You need to install webpack", :red
|
28
|
+
abort
|
29
|
+
end
|
30
|
+
|
26
31
|
unless Config.check_settings.empty?
|
27
32
|
say Config.check_settings, :green
|
28
33
|
say 'Check structure of your config file - it seems you are missing required options mentioned above', :red
|
@@ -54,7 +59,7 @@ class Starter < Thor
|
|
54
59
|
def new project_name
|
55
60
|
@project_name = project_name
|
56
61
|
run "rails new #{@project_name} -T --skip-bundle --webpack"
|
57
|
-
run 'rake webpacker:install'
|
62
|
+
#run 'rake webpacker:install'
|
58
63
|
|
59
64
|
@project_path = "#{@dir}/#{@project_name}"
|
60
65
|
@project_label = @project_name.capitalize.gsub('_', ' ')
|
data/lib/r5/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r5
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.0.
|
4
|
+
version: 0.4.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mousse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|