alexrothenberg/ammeter — pull request #22 by strzibny (2013-09-23 10:20:23+00:00)
Title: Require Rails first since rspec-rails use the Rails constant

Requiring `ammeter/init` directly fails[1] due to missing constant in rspec-rails[2]:

```
/usr/share/gems/gems/rspec-rails-2.14.0/lib/rspec/rails/example/rails_example_group.rb:10:in `': uninitialized constant Rails::VERSION (NameError)
from /usr/share/gems/gems/rspec-rails-2.14.0/lib/rspec/rails/example/rails_example_group.rb:7:in `'
from /usr/share/gems/gems/rspec-rails-2.14.0/lib/rspec/rails/example/rails_example_group.rb:6:in `'
from /usr/share/gems/gems/rspec-rails-2.14.0/lib/rspec/rails/example/rails_example_group.rb:5:in `'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:51:in `require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:51:in `require'
from /usr/local/share/gems/gems/ammeter-0.2.9/lib/ammeter/rspec/generator/example/generator_example_group.rb:4:in `'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:51:in `require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:51:in `require'
from /usr/local/share/gems/gems/ammeter-0.2.9/lib/ammeter/rspec/generator/example.rb:2:in `'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:51:in `require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:51:in `require'
from /usr/local/share/gems/gems/ammeter-0.2.9/lib/ammeter/init.rb:1:in `'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:116:in `require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:116:in `rescue in require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:122:in `require'
from test.rb:2:in `

'

```

Reversing the order fixes the issue.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1007631
[2] https://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/example/rails_example_group.rb#L10