Class: TableBeet::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/table_beet/loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Loader

Returns a new instance of Loader.



7
8
9
10
# File 'lib/table_beet/loader.rb', line 7

def initialize(config = {})
  @suffix = config[:suffix] || '_steps.rb'
  @directory = config[:path] || './spec'
end

Instance Method Details

#display_patternObject



25
26
27
# File 'lib/table_beet/loader.rb', line 25

def display_pattern
  pattern
end

#loadObject

Returns Integer Size of loaded file.

Returns:

  • Integer Size of loaded file



15
16
17
18
19
# File 'lib/table_beet/loader.rb', line 15

def load
  # https://github.com/jnicklas/turnip#where-to-place-steps
  paths.each { |f| Kernel.load(f, true) }
  paths.length
end

#pathsObject



21
22
23
# File 'lib/table_beet/loader.rb', line 21

def paths
  Pathname.glob(pattern)
end