3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/fewer/rails_helpers.rb', line 3
def fewer_encode_sources(app, sources, friendly_ext = nil)
ext = app.engine_klass.extension
sources.map! { |source|
ext && source[-ext.length, ext.length] != ext ? "#{source}#{ext}" : source
}
if config.perform_caching
engine = app.engine(sources)
["#{engine.mtime.to_i.to_s(36)}/#{engine.encoded}#{friendly_ext}"]
else
sources.map { |source|
engine = app.engine([source])
friendly_name = File.basename(source, '.*')
"#{engine.mtime.to_i.to_s(36)}/#{engine.encoded}-#{friendly_name}#{friendly_ext}"
}
end
end
|