Skip to content

Commit acf10bb

Browse files
Merge pull request #3 from mudbugmedia/trigger-generate-after-precompile
Generate the critical CSS automatically after precompiling assets.
2 parents 82829e4 + 917937c commit acf10bb

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

.rubocop_todo.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2015-10-03 13:56:01 -0500 using RuboCop version 0.34.1.
3+
# on 2015-10-20 18:42:42 -0500 using RuboCop version 0.34.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 2
9+
# Offense count: 3
1010
# Configuration parameters: AllowURI, URISchemes.
1111
Metrics/LineLength:
12-
Max: 86
12+
Max: 91

BACKLOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
## Features
77
- Allow the user to pass arguments to Penthouse.js, i.e. Viewport size, etc. For a list of the configurable options, please see [Penthouse](https://github.com/pocketjoso/penthouse)
88
- Improve installation process, if necessary
9-
- Improve manual processes, if possible (i.e having to run the rake task to generate the the critical CSS)
9+
- Improve manual processes, if possible (i.e having to run the rake task to generate the critical CSS)
1010
- Improve implementation. Is their a better solution then using Rails.cache?

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ First, you'll need to configue a few things in the YAML file: `config/critical_p
4747

4848
Before generating the CSS, ensure that your application is running (viewable from a browser) and the main CSS file exists. Then in a separate tab, run the rake task to generate the critical CSS.
4949

50-
If your main CSS file does not already exist, and you are using the Asset Pipeline, generate the main CSS file.
50+
If you are using the Asset Pipeline, precompiling the assets will generate the critical CSS after the assets are precompiled.
5151
```
5252
rake assets:precompile
5353
```
54-
Generate the critical path CSS:
54+
Else you can generate the critical CSS manually using the below task:
5555
```
5656
rake critical_path_css:generate
5757
```
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module CriticalPathCSS
22
module Rails
3-
VERSION = '0.2.0'
3+
VERSION = '0.2.1'
44
PENTHOUSE_VERSION = '0.3.4'
55
end
66
end

lib/tasks/critical_path_css.rake

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ namespace :critical_path_css do
66
CriticalPathCss.generate
77
end
88
end
9+
10+
Rake::Task['assets:precompile'].enhance { Rake::Task['critical_path_css:generate'].invoke }

0 commit comments

Comments
 (0)