Class: RuboCop::Cop::Chef::Ruby::GemspecLicense
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/chefstyle/ruby/gemspec_license.rb
Overview
All gemspec files should define their license.
Constant Summary collapse
- MSG =
'All gemspec files should define their license.'
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_new_investigation ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/rubocop/cop/chefstyle/ruby/gemspec_license.rb', line 43 def on_new_investigation # exit if we find a license statement or any eval since that usually happens # when we have a windows platform gem that evals the main gemspec return if license(processed_source.ast).first || eval_method(processed_source.ast).first range = source_range(processed_source.buffer, 1, 0) add_offense(range, message: MSG, severity: :warning) end |