Class: Ukiryu::Extractors::Extractor
- Inherits:
-
Object
- Object
- Ukiryu::Extractors::Extractor
- Defined in:
- lib/ukiryu/extractors/extractor.rb
Overview
Main extractor class that orchestrates extraction strategies
Tries multiple extraction strategies in order:
-
Native flag extraction (–ukiryu-definition)
-
Help parsing (–help output)
Class Method Summary collapse
-
.extract(tool_name, options = {}) ⇒ Hash
Extract definition from a tool.
Instance Method Summary collapse
-
#extract ⇒ Hash
Extract definition using available strategies.
-
#initialize(tool_name, options = {}) ⇒ Extractor
constructor
Initialize the extractor.
Constructor Details
#initialize(tool_name, options = {}) ⇒ Extractor
Initialize the extractor
36 37 38 39 |
# File 'lib/ukiryu/extractors/extractor.rb', line 36 def initialize(tool_name, = {}) @tool_name = tool_name @options = end |
Class Method Details
.extract(tool_name, options = {}) ⇒ Hash
Extract definition from a tool
Tries multiple extraction strategies in order until one succeeds.
28 29 30 |
# File 'lib/ukiryu/extractors/extractor.rb', line 28 def self.extract(tool_name, = {}) new(tool_name, ).extract end |
Instance Method Details
#extract ⇒ Hash
Extract definition using available strategies
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ukiryu/extractors/extractor.rb', line 44 def extract method = @options[:method] || :auto case method when :auto extract_auto when :native extract_with_native when :help extract_with_help else { success: false, error: "Unknown extraction method: #{method}", method: nil, yaml: nil } end end |