File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ module Generator
88 class ItemExtractorQuestion
99 attr_reader :prompt , :state , :options
1010
11+ ##
12+ # @return [Array<Symbol>] the available extractor names, with default extractor at index 0
13+ def self . choices ( default = Html2rss ::ItemExtractors ::DEFAULT_EXTRACTOR )
14+ [ default ] . concat ( Html2rss ::ItemExtractors ::NAME_TO_CLASS . keys - [ default ] )
15+ end
16+
1117 def initialize ( prompt , state , **options )
1218 @prompt = prompt
1319 @state = state
@@ -24,12 +30,6 @@ def ask
2430 prompt . yes? ( "Use extractor '#{ extractor_name } '?" ) ? state . store ( path , full_extractor_options ) : ask
2531 end
2632
27- ##
28- # @return [Array<Symbol>] the available extractor names, with default extractor at index 0
29- def self . choices ( default = Html2rss ::ItemExtractors ::DEFAULT_NAME )
30- [ default ] . concat ( Html2rss ::ItemExtractors ::NAME_TO_CLASS . keys - [ default ] )
31- end
32-
3333 def print_extractor_result ( extractor_options )
3434 channel_config = Html2rss ::Config ::Channel . new ( { url : state . fetch ( 'feed.channel.url' ) } )
3535 extractor_result = Html2rss ::ItemExtractors . item_extractor_factory (
@@ -54,7 +54,7 @@ def path
5454 end
5555
5656 def extractor_default?
57- extractor_name == Html2rss ::ItemExtractors ::DEFAULT_NAME
57+ extractor_name == Html2rss ::ItemExtractors ::DEFAULT_EXTRACTOR
5858 end
5959
6060 def extractor_html?
You can’t perform that action at this time.
0 commit comments