Skip to content

Commit 404048b

Browse files
Satisfy rubocop
Conflicts: lib/critical_path_css/css_fetcher.rb
1 parent 25a6866 commit 404048b

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

lib/critical-path-css-rails.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ module CriticalPathCss
44
CACHE_NAMESPACE = 'critical-path-css'
55

66
def self.generate(route)
7-
Rails.cache.write(route, CssFetcher.new.fetch_route(route),
8-
namespace: CACHE_NAMESPACE, expires_in: nil)
7+
Rails.cache.write(
8+
route,
9+
CssFetcher.new.fetch_route(route),
10+
namespace: CACHE_NAMESPACE,
11+
expires_in: nil
12+
)
913
end
1014

1115
def self.generate_all
@@ -19,7 +23,7 @@ def self.clear(route)
1923
end
2024

2125
def self.clear_matched(routes)
22-
Rails.cache.delete_matched(routes,namespace: CACHE_NAMESPACE)
26+
Rails.cache.delete_matched(routes, namespace: CACHE_NAMESPACE)
2327
end
2428

2529
def self.fetch(route)

lib/critical_path_css/css_fetcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def fetch_route(route)
1717
css_for_route route
1818
end
1919

20-
protected
20+
protected
2121

2222
def css_for_route(route)
2323
url = @config.base_url + route

lib/tasks/critical_path_css.rake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ namespace :critical_path_css do
55
task generate: :environment do
66
CriticalPathCss.generate_all
77
end
8+
89
desc 'Clear all critical CSS from the cache'
910
task clear_all: :environment do
10-
# Use the following for Redis cache implmentations
11-
CriticalPathCss.clear_matched('*')
12-
# Some other cache implementations may require the following syntax instead
13-
# CriticalPathCss.clear_matched(/.*/)
11+
# Use the following for Redis cache implmentations
12+
CriticalPathCss.clear_matched('*')
13+
# Some other cache implementations may require the following syntax instead
14+
# CriticalPathCss.clear_matched(/.*/)
1415
end
1516
end
1617

0 commit comments

Comments
 (0)