Commit 50b96fb

mo <mo.khan@gmail.com>
2018-02-27 04:34:27
add ruby-prof.
1 parent fa39468
Changed files (2)
spec/support/ruby_prof.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+require 'ruby-prof'
+
+module RubyProfiler
+  def with_profiler
+    result = RubyProf.profile do
+      yield
+    end
+    printer = RubyProf::CallTreePrinter.new(result)
+    printer.print(path: "tmp/profile/", profile: Time.now.utc.iso8601)
+  end
+end
+
+RSpec.configure do |config|
+  config.include RubyProfiler
+end
saml-kit.gemspec
@@ -40,4 +40,5 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency 'rubocop-rspec', '~> 1.22'
   spec.add_development_dependency 'simplecov', '~> 0.15'
   spec.add_development_dependency 'webmock', '~> 3.1'
+  spec.add_development_dependency 'ruby-prof'
 end