igorkasyanchuk/benchmark_methods

Library will not work outside of Rails without ActiveSupport

Closed this issue · 1 comments

String#demodulize is an ActiveSupport String extension, not a core part of Ruby.

Example File:

# test.rb
require 'benchmark_methods'

class Testing
  include BenchmarkMethods

  cbenchmark :example_class_method

  def self.example_class_method
    1.upto(10_000_000) do |x|
      x ** x
    end
  end
end

Testing.example_class_method

Results:

$ ruby test.rb
/Users/matt/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/benchmark_methods-0.4/lib/benchmark_methods.rb:8:in `included': undefined method `demodulize' for "Testing":String (NoMethodError)
        from test.rb:4:in `include'
        from test.rb:4:in `<class:Testing>'
        from test.rb:3:in `<main>'

Thank you for this testing. Issue is fixed in latest version (0.6) of gem.