Module: FactoryToys

Defined in:
lib/factory_toys.rb,
lib/factory_toys/parser.rb,
lib/factory_toys/f_factory.rb

Defined Under Namespace

Classes: CloseTagNotFoundError, FFactory, InternalForEachError, MissingEnvironmentError, MissingForeachListError, MissingScenarioError, Parser, UnknownInlineError

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.factoriesObject

Returns the value of attribute factories.



12
13
14
# File 'lib/factory_toys.rb', line 12

def factories
  @factories
end

.features_directoryObject

Returns the value of attribute features_directory.



11
12
13
# File 'lib/factory_toys.rb', line 11

def features_directory
  @features_directory
end

.max_feature_lengthObject

Returns the value of attribute max_feature_length.



14
15
16
# File 'lib/factory_toys.rb', line 14

def max_feature_length
  @max_feature_length
end

.scenarioObject

Returns the value of attribute scenario.



13
14
15
# File 'lib/factory_toys.rb', line 13

def scenario
  @scenario
end

.scenariosObject

Returns the value of attribute scenarios.



13
14
15
# File 'lib/factory_toys.rb', line 13

def scenarios
  @scenarios
end

.source_directoryObject

Returns the value of attribute source_directory.



11
12
13
# File 'lib/factory_toys.rb', line 11

def source_directory
  @source_directory
end

Class Method Details

.features_locationObject



26
27
28
29
30
# File 'lib/factory_toys.rb', line 26

def features_location
  @features_location = ::RAILS_ROOT + '/' + self.features_directory
rescue NameError
  raise MissingEnvironmentError
end

.source_locationObject



20
21
22
23
24
# File 'lib/factory_toys.rb', line 20

def source_location
  @source_location = ::RAILS_ROOT + '/' + self.source_directory
rescue NameError
  raise MissingEnvironmentError
end

.update_featuresObject



46
47
48
49
50
51
52
53
# File 'lib/factory_toys.rb', line 46

def update_features
  self.source_files.each do |file|
    ft = FactoryToys::FFactory.new(file)
    if self.update_required(file, ft.output_filename)
      ft.write
    end
  end
end