This repository was archived by the owner on Feb 1, 2021. It is now read-only.
File tree 1 file changed +31
-0
lines changed
crowbar_framework/lib/tasks
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright 2015, SUSE LINUX Products GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ namespace :assets do
18
+ task non_digested : :environment do
19
+ assets = Dir . glob ( File . join ( Rails . root , 'public/assets/**/*' ) )
20
+ regex = /(-{1}[a-z0-9]{32}*\. {1}){1}/
21
+ assets . each do |file |
22
+ next if File . directory? ( file ) || file !~ regex
23
+
24
+ source = file . split ( '/' )
25
+ source . push ( source . pop . gsub ( regex , '.' ) )
26
+
27
+ non_digested = File . join ( source )
28
+ FileUtils . symlink ( file , non_digested , :force => true )
29
+ end
30
+ end
31
+ end
You can’t perform that action at this time.
0 commit comments