Skip to content

Commit 5899d1a

Browse files
committed
Only require pstore if needed
1 parent 1fdef03 commit 5899d1a

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if RUBY_VERSION >= '3.4'
2929
end
3030

3131
if RUBY_VERSION >= '4.0'
32-
gem 'pstore'
3332
gem 'logger'
3433
gem 'ostruct'
34+
gem 'pstore'
3535
end

lib/webmachine/trace/pstore_trace_store.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'pstore'
2-
31
module Webmachine
42
module Trace
53
# Implements a trace storage using PStore from Ruby's standard
@@ -11,6 +9,7 @@ class PStoreTraceStore
119
# @api private
1210
# @param [String] path where to store traces in a PStore
1311
def initialize(path)
12+
require 'pstore' # JIT load of the pstore gem. Avoid requiring the dependency when this class is not used.
1413
@pstore = PStore.new(path)
1514
end
1615

0 commit comments

Comments
 (0)