ManageIQ / polisher

Polisher is a Ruby module and set of utilities aimed to assisting the post-publishing packaging process for Ruby gems and applications.
MIT License
14 stars 14 forks source link

Turn off inheritance in const_defined? check #105

Closed strzibny closed 10 years ago

strzibny commented 10 years ago

This will avoid getting uninitialized constant error for Polisher::Gem later on since Gem can be defined but Polisher::Gem not:

> require 'polisher'
NameError: uninitialized constant Polisher::Gem
    from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:253:in `const_get'
    from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:253:in `block in constantize'
    from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `each'
    from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `inject'
    from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `constantize'
    from /home/strzibny/.gem/ruby/gems/activesupport-4.1.4/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/component.rb:38:in `block in require_dependency'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/component.rb:36:in `each'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/component.rb:36:in `rescue in require_dependency'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/component.rb:30:in `require_dependency'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/component.rb:23:in `block in verify'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/component.rb:22:in `each'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/component.rb:22:in `all?'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/component.rb:22:in `verify'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/gem.rb:16:in `<module:Polisher>'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/gem.rb:13:in `<top (required)>'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher/rpm/requirement.rb:6:in `<top (required)>'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/strzibny/.gem/ruby/gems/polisher-0.10.2/lib/polisher.rb:8:in `<top (required)>'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:135:in `require'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:144:in `require'
    from (irb):1
coveralls commented 10 years ago

Coverage Status

Coverage remained the same when pulling da7ace9024e21b4bbe89be4b9ca57afde4a60ff4 on strzibny:fix-const_defined into 3bd13a6c5939faa2199270f7c09a60f39c8d16b9 on ManageIQ:master.

miq-bot commented 10 years ago

Checked commit https://github.com/strzibny/polisher/commit/da7ace9024e21b4bbe89be4b9ca57afde4a60ff4 with rubocop 0.21.0 1 file checked, 0 offenses detected Everything looks good. :cookie:

jrafanie commented 10 years ago

@strzibny Very nice. Thank you!