Class: GemLint::Strategies::BinWithoutShebangStrategy
Instance Attribute Summary
#filename, #metadata_path, #path
Instance Method Summary
collapse
#initialize, #level_char
Instance Method Details
#description ⇒ Object
5
6
7
|
# File 'lib/gem_lint/strategies/bin_without_shebang_strategy.rb', line 5
def description
"A file in bin/ doesn't have a shebang on the first line"
end
|
#fail? ⇒ Boolean
17
18
19
20
21
22
23
|
# File 'lib/gem_lint/strategies/bin_without_shebang_strategy.rb', line 17
def fail?
bin_files.any? { |path|
data = File.open(self.path + "/" + path) { |f| f.read }
first_line = data.split("\n")[0]
!first_line.to_s.include?("env ruby")
}
end
|
#level ⇒ Object
13
14
15
|
# File 'lib/gem_lint/strategies/bin_without_shebang_strategy.rb', line 13
def level
:warning
end
|
#tag ⇒ Object
9
10
11
|
# File 'lib/gem_lint/strategies/bin_without_shebang_strategy.rb', line 9
def tag
:"bin-without-shebang"
end
|