mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
only check for shebangs in executable files
This commit is contained in:
@@ -146,7 +146,8 @@ module Linguist
|
||||
#
|
||||
# Return true or false
|
||||
def shebang_extname?
|
||||
extname.empty?
|
||||
extname.empty? &&
|
||||
(mode.to_i(8) & 05) == 05
|
||||
end
|
||||
|
||||
MEGABYTE = 1024 * 1024
|
||||
|
||||
@@ -32,6 +32,13 @@ module Linguist
|
||||
# Returns a String
|
||||
attr_reader :name
|
||||
|
||||
# Public: Read file permissions
|
||||
#
|
||||
# Returns a String like '100644'
|
||||
def mode
|
||||
File.stat(@path).mode.to_s(8)
|
||||
end
|
||||
|
||||
# Public: Read file contents.
|
||||
#
|
||||
# Returns a String.
|
||||
|
||||
0
test/fixtures/script.bash
vendored
Normal file → Executable file
0
test/fixtures/script.bash
vendored
Normal file → Executable file
0
test/fixtures/script.foo
vendored
Normal file → Executable file
0
test/fixtures/script.foo
vendored
Normal file → Executable file
0
test/fixtures/script.groovy
vendored
Normal file → Executable file
0
test/fixtures/script.groovy
vendored
Normal file → Executable file
0
test/fixtures/script.js
vendored
Normal file → Executable file
0
test/fixtures/script.js
vendored
Normal file → Executable file
0
test/fixtures/script.mrb
vendored
Normal file → Executable file
0
test/fixtures/script.mrb
vendored
Normal file → Executable file
0
test/fixtures/script.nu
vendored
Normal file → Executable file
0
test/fixtures/script.nu
vendored
Normal file → Executable file
0
test/fixtures/script.pl
vendored
Normal file → Executable file
0
test/fixtures/script.pl
vendored
Normal file → Executable file
0
test/fixtures/script.py
vendored
Normal file → Executable file
0
test/fixtures/script.py
vendored
Normal file → Executable file
0
test/fixtures/script.rake
vendored
Normal file → Executable file
0
test/fixtures/script.rake
vendored
Normal file → Executable file
0
test/fixtures/script.rb
vendored
Normal file → Executable file
0
test/fixtures/script.rb
vendored
Normal file → Executable file
0
test/fixtures/script.rkt
vendored
Normal file → Executable file
0
test/fixtures/script.rkt
vendored
Normal file → Executable file
0
test/fixtures/script.scala
vendored
Normal file → Executable file
0
test/fixtures/script.scala
vendored
Normal file → Executable file
0
test/fixtures/script.sh
vendored
Normal file → Executable file
0
test/fixtures/script.sh
vendored
Normal file → Executable file
0
test/fixtures/script.zsh
vendored
Normal file → Executable file
0
test/fixtures/script.zsh
vendored
Normal file → Executable file
Reference in New Issue
Block a user