Class: Ariadne::Thread

Inherits:
Object
  • Object
show all
Defined in:
lib/ariadne/thread.rb

Constant Summary collapse

LOG_FILE =
"thread.log"
DEFAULT_INCLUDE_PATHS =
Open3.capture3("pwd").first.strip
DEFAULT_EXCLUDE_PATHS =
[].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(include_paths: nil, exclude_paths: nil) ⇒ Thread

Returns a new instance of Thread.



15
16
17
18
19
# File 'lib/ariadne/thread.rb', line 15

def initialize(include_paths: nil, exclude_paths: nil)
  @include_paths = Array(include_paths) || DEFAULT_INCLUDE_PATHS
  @exclude_paths = Array(exclude_paths) || DEFAULT_EXCLUDE_PATHS
  @seams = []
end

Instance Attribute Details

#seamsObject (readonly)

Returns the value of attribute seams.



9
10
11
# File 'lib/ariadne/thread.rb', line 9

def seams
  @seams
end

Instance Method Details

#callObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/ariadne/thread.rb', line 21

def call
  prepare
  open_file
  trace.enable
  yield
ensure
  trace.disable
  log
  close_file
end