johnae/role_playing — pull request #2 by jnv (2014-10-03 13:40:36+00:00)
Title: Require ActiveSupport

I use RolePlaying with non-Rails app and there are some cases, when full ActiveSupport is not required. However, `active_support/core_ext` depends on `ActiveSupport::Autoload` (but doesn't load it itself) so it may end-up with an error:

```
NameError: uninitialized constant ActiveSupport::Autoload
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/number_helper.rb:3:in `'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/number_helper.rb:2:in `'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/number_helper.rb:1:in `'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:2:in `require'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:2:in `'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric.rb:3:in `require'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric.rb:3:in `'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/core_ext.rb:2:in `require'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/core_ext.rb:2:in `block in '
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/core_ext.rb:1:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.5/lib/active_support/core_ext.rb:1:in `'
/app/vendor/bundle/ruby/2.1.0/gems/role_playing-0.1.4/lib/role_playing.rb:1:in `require'
/app/vendor/bundle/ruby/2.1.0/gems/role_playing-0.1.4/lib/role_playing.rb:1:in `'
…
```

The solution is to require ActiveSupport by the gem so Autoload is guaranteed to exist. Note that this error is quite common, e.g. https://github.com/beeminder/beeminder-gem/issues/10