cssbundling-rails 0.1.7 → 0.1.8

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
  SHA256:
3
- metadata.gz: 7b949bceafaa77019bd9d046505043f55499bd2a7a8d388c8452fb6013b9875e
4
- data.tar.gz: 0f9fd5b7e082e8d40dea90996a309482cb92e5716f7f65e847e116bccc21e2dc
3
+ metadata.gz: a70423b8588a0b537518131ad10a0a702e5891343a3800ac099c13de2a2b8e1f
4
+ data.tar.gz: 237ee6613b56c3296a1ad95b78cdb6bac8cd78a900879f006ce06c1ec314fca8
5
5
  SHA512:
6
- metadata.gz: 48fe191fae553691b4f5cb94559795090356cb9d3eb00f4a5f4b7625e56f194ba7711b2c296a068d41097b27f21e3b4ad20da62edac535530d52e9e83a5d0ef4
7
- data.tar.gz: a6b27be310ae773882019806a5a2256a0cf2a74898cf8b9f9dd9e994c2fd942bc6b0cea7ed05f39b6d1a64bc9fc4896cee61f53cfd8424351a0afc5f34113a03
6
+ metadata.gz: 005d6451373ec31e23cdca38b8f75bd32426bcabb94bc7c7d88675e682a24c75a104b8fcab0725806503f22cf04c388fe25bdb2ffd67ff92871856f711576ef3
7
+ data.tar.gz: '08966254d0702d793a7f09322b8a01820c42a5cc76d23ee4d6cc991a849a23be5a548329f7c804afcbeff422b672689cff1b49a4de66a57bc3f25f2f32b74d85'
@@ -1,3 +1,3 @@
1
1
  module Cssbundling
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -4,22 +4,41 @@ keep_file "app/assets/builds"
4
4
  append_to_file "app/assets/config/manifest.js", %(//= link_tree ../builds\n)
5
5
 
6
6
  say "Stop linking stylesheets automatically"
7
- gsub_file "app/assets/config/manifest.js", "//= link_directory ../stylesheets .css", ""
7
+ gsub_file "app/assets/config/manifest.js", "//= link_directory ../stylesheets .css\n", ""
8
8
 
9
9
  if Rails.root.join(".gitignore").exist?
10
- append_to_file(".gitignore", %(/app/assets/builds/*\n!/app/assets/builds/.keep\n))
10
+ append_to_file(".gitignore", %(\n/app/assets/builds/*\n!/app/assets/builds/.keep\n))
11
+ append_to_file(".gitignore", %(\n/node_modules\n))
11
12
  end
12
13
 
13
14
  say "Remove app/assets/stylesheets/application.css so build output can take over"
14
15
  remove_file "app/assets/stylesheets/application.css"
15
16
 
17
+ if (app_layout_path = Rails.root.join("app/views/layouts/application.html.erb")).exist?
18
+ say "Add stylesheet link tag in application layout"
19
+ insert_into_file(
20
+ app_layout_path.to_s,
21
+ defined?(Turbo) ?
22
+ %(\n <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>) :
23
+ %(\n <%= stylesheet_link_tag "application" %>),
24
+ before: /\s*<\/head>/
25
+ )
26
+ else
27
+ say "Default application.html.erb is missing!", :red
28
+ if defined?(Turbo)
29
+ say %( Add <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> within the <head> tag in your custom layout.)
30
+ else
31
+ say %( Add <%= stylesheet_link_tag "application" %> within the <head> tag in your custom layout.)
32
+ end
33
+ end
34
+
16
35
  unless Rails.root.join("package.json").exist?
17
36
  say "Add default package.json"
18
37
  copy_file "#{__dir__}/package.json", "package.json"
19
38
  end
20
39
 
21
40
  if Rails.root.join("Procfile.dev").exist?
22
- append_to_file "Procfile.dev", "css: yarn build:css --watch"
41
+ append_to_file "Procfile.dev", "\ncss: yarn build:css --watch"
23
42
  else
24
43
  say "Add default Procfile.dev"
25
44
  copy_file "#{__dir__}/Procfile.dev", "Procfile.dev"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cssbundling-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-13 00:00:00.000000000 Z
12
+ date: 2021-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties