Skip to content

Commit 9bc1f05

Browse files
committed
Fix rubocop errors
1 parent 8a5bc11 commit 9bc1f05

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/bankrupt/tasks.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,24 +102,24 @@
102102
file_glob = '*.{css,jpg,js,pdf,png,svg,eot,ttf,woff,woff2}'
103103

104104
config = begin
105-
YAML.safe_load(File.read(File.join(APP_ROOT, '.bankrupt.yml')),
105+
YAML.safe_load_file(File.join(APP_ROOT, '.bankrupt.yml'),
106106
[], [], true, symbolize_names: true)
107107
rescue Errno::ENOENT
108108
{}
109109
end
110110

111-
Dir.glob(File.join(APP_ROOT, 'public', file_glob)).sort.each do |file|
111+
Dir.glob(File.join(APP_ROOT, 'public', file_glob)).each do |file|
112112
md5 = Digest::MD5.file(file).to_s
113113
basename = File.basename(file)
114114

115115
# undo the hash that we have webpack insert (but is important so the
116116
# final css uses the correct path)
117117
if basename.match?(/-#{md5}\.#{File.extname(file).delete('.')}$/)
118118
File.rename(file,
119-
(file = File.join(
119+
file = File.join(
120120
File.dirname(file),
121-
(basename = basename.gsub("-#{md5}", ''))
122-
)))
121+
basename = basename.gsub("-#{md5}", '')
122+
))
123123
end
124124

125125
manifest[basename] = {

lib/bankrupt/util.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class Util
2222
# @param path [String] path to the manifest
2323
# @return [Hash] parsed manifest or empty hash on error
2424
def self.parse_manifest(path)
25-
JSON.parse(File.read(path)).map do |k, v|
25+
JSON.parse(File.read(path)).to_h do |k, v|
2626
[k.freeze, v.map { |l, b| [l.to_sym, b.freeze] }.to_h.freeze]
27-
end.to_h.freeze
27+
end.freeze
2828
rescue StandardError
2929
{}
3030
end

0 commit comments

Comments
 (0)