Class: GemLint::Strategies::RubyFileLocationStrategy

Inherits:
AbstractStrategy show all
Defined in:
lib/gem_lint/strategies/ruby_file_location_strategy.rb

Instance Attribute Summary

Attributes inherited from AbstractStrategy

#filename, #metadata_path, #path

Instance Method Summary collapse

Methods inherited from AbstractStrategy

#initialize, #level_char

Constructor Details

This class inherits a constructor from GemLint::Strategies::AbstractStrategy

Instance Method Details

#descriptionObject



7
8
9
# File 'lib/gem_lint/strategies/ruby_file_location_strategy.rb', line 7

def description
  "Gem contains ruby files outside of lib, test and spec"
end

#fail?Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
# File 'lib/gem_lint/strategies/ruby_file_location_strategy.rb', line 19

def fail?
  all_files.any? do |filename|
    filename[0,3] != "lib" && filename[0,4] != "spec" &&
      filename[0,4] != "test" && filename[-3,3] == ".rb"
  end
end

#levelObject



15
16
17
# File 'lib/gem_lint/strategies/ruby_file_location_strategy.rb', line 15

def level
  :warning
end

#tagObject



11
12
13
# File 'lib/gem_lint/strategies/ruby_file_location_strategy.rb', line 11

def tag
  :"ruby-files-outside-lib-test-spec"
end