Skip to content

Commit ab0a3e3

Browse files
Generate configuration yaml file through the install generator
1 parent 6fdc667 commit ab0a3e3

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

lib/config/critical_path_css.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
defaults: &defaults
2+
routes:
3+
- /
4+
5+
development:
6+
<<: *defaults
7+
base_url: http://localhost:3000
8+
9+
staging:
10+
<<: *defaults
11+
base_url: http://staging.example.com
12+
13+
production:
14+
<<: *defaults
15+
base_url: http://example.com

lib/generators/critical_path_css/install_generator.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@ def copy_rake_task
99
task_filename = 'critical_path_css.rake'
1010
copy_file "../../tasks/#{task_filename}", "lib/tasks/#{task_filename}"
1111
end
12+
13+
# Copy the needed configuration YAML file for generating critical CSS
14+
def copy_config_file
15+
task_filename = 'critical_path_css.yml'
16+
copy_file "../../config/#{task_filename}", "config/#{task_filename}"
17+
end
1218
end
1319
end

0 commit comments

Comments
 (0)