Class: SpecFileGenerator::Core
- Defined in:
- lib/spec_file_generator/core.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(source_file, config = OpenStruct.new) ⇒ Core
constructor
A new instance of Core.
Methods inherited from Service
Constructor Details
#initialize(source_file, config = OpenStruct.new) ⇒ Core
Returns a new instance of Core.
8 9 10 11 12 |
# File 'lib/spec_file_generator/core.rb', line 8 def initialize(source_file, config = OpenStruct.new) @source_file = source_file @config = config @logger = TTY::Logger.new end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 |
# File 'lib/spec_file_generator/core.rb', line 14 def call generated_spec_file = FileBuilder.call(KlassExtractor.call(@source_file), @config) @logger.success "Spec file has been successfully generated at #{generated_spec_file}." rescue StandardError => e @logger.error "[#{e.class}]: #{e}" end |