Skip to content

Commit 7e3cd3d

Browse files
committed
fix: name of default extractor constant wasn't that constant
1 parent 3a00f3c commit 7e3cd3d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/html2rss/generator/item_extractor_question.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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?

0 commit comments

Comments
 (0)