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.



5
6
7
8
# File 'lib/table_beet/loader.rb', line 5

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

Instance Method Details

#display_patternObject



23
24
25
# File 'lib/table_beet/loader.rb', line 23

def display_pattern
  pattern
end

#loadObject

Returns Integer Size of loaded file.

Returns:

  • Integer Size of loaded file



13
14
15
16
17
# File 'lib/table_beet/loader.rb', line 13

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

#pathsObject



19
20
21
# File 'lib/table_beet/loader.rb', line 19

def paths
  Pathname.glob(pattern)
end