lib/pdd/sources.rb in pdd-0.23.1 vs lib/pdd/sources.rb in pdd-0.23.2

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright (c) 2014-2022 Yegor Bugayenko +# Copyright (c) 2014-2023 Yegor Bugayenko # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the 'Software'), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -86,10 +86,11 @@ end end def text_file?(file) fm = FileMagic.new(FileMagic::MAGIC_MIME) - fm.file(file) =~ %r{^text/} + type = fm.file(file) + type =~ %r{^(text/|application/javascript)} ensure fm.close end end end