Skip to content

Commit fb79e7f

Browse files
committed
style: apply rubocop fixes
1 parent 00f958c commit fb79e7f

8 files changed

Lines changed: 39 additions & 39 deletions

File tree

lib/html2rss/generator/channel_question.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'faraday'
44

5-
require_relative './question'
5+
require_relative 'question'
66

77
module Html2rss
88
module Generator

lib/html2rss/generator/collector.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# frozen_string_literal: true
22

3-
require_relative './channel_question'
4-
require_relative './items_selector_question'
5-
require_relative './selector_question'
3+
require_relative 'channel_question'
4+
require_relative 'items_selector_question'
5+
require_relative 'selector_question'
66

77
module Html2rss
88
module Generator

lib/html2rss/generator/file_create_question.rb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require 'fileutils'
4-
require_relative './files_and_paths'
4+
require_relative 'files_and_paths'
55

66
module Html2rss
77
module Generator
@@ -19,6 +19,26 @@ class FileCreateQuestion
1919

2020
attr_reader :prompt, :feed_config, :channel_url
2121

22+
def self.print_files(relative_yml_path, relative_spec_path)
23+
PrintHelper.markdown <<~MARKDOWN
24+
Created YAML file at:
25+
`#{relative_yml_path}`
26+
27+
Created spec file at:
28+
`#{relative_spec_path}`
29+
30+
Use this config to generate RSS with:
31+
`bundle exec html2rss feed #{relative_yml_path}`
32+
MARKDOWN
33+
end
34+
35+
def self.create_file(file_path, content)
36+
raise 'file exists already' if File.exist? file_path
37+
38+
FileUtils.mkdir_p File.dirname(file_path)
39+
File.write(file_path, content)
40+
end
41+
2242
def initialize(prompt, state, **_options)
2343
@prompt = prompt
2444
@state = state
@@ -40,26 +60,6 @@ def ask
4060
create(fps)
4161
end
4262

43-
def self.print_files(relative_yml_path, relative_spec_path)
44-
PrintHelper.markdown <<~MARKDOWN
45-
Created YAML file at:
46-
`#{relative_yml_path}`
47-
48-
Created spec file at:
49-
`#{relative_spec_path}`
50-
51-
Use this config to generate RSS with:
52-
`bundle exec html2rss feed #{relative_yml_path}`
53-
MARKDOWN
54-
end
55-
56-
def self.create_file(file_path, content)
57-
raise 'file exists already' if File.exist? file_path
58-
59-
FileUtils.mkdir_p File.dirname(file_path)
60-
File.write(file_path, content)
61-
end
62-
6363
private
6464

6565
def print_feed_config

lib/html2rss/generator/files_and_paths.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ module Generator
77
class FilesAndPaths
88
attr_reader :config_name, :config_dir
99

10+
##
11+
# @return [String]
12+
def self.gem_root
13+
File.expand_path(File.join(__dir__, '../../../..'))
14+
end
15+
1016
def initialize(config_name, config_dir)
1117
raise 'config_name is required' if config_name.to_s == ''
1218
raise 'config_dir is required' if config_dir.to_s == ''
@@ -15,12 +21,6 @@ def initialize(config_name, config_dir)
1521
@config_dir = config_dir
1622
end
1723

18-
##
19-
# @return [String]
20-
def self.gem_root
21-
File.expand_path(File.join(__dir__, '../../../..'))
22-
end
23-
2424
##
2525
# @return [String]
2626
def yml_dir

lib/html2rss/generator/helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require 'nokogiri'
55
require 'yaml'
66

7-
require_relative './print_helper'
7+
require_relative 'print_helper'
88

99
module Html2rss
1010
module Generator

lib/html2rss/generator/items_selector_question.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
require_relative './selector_question'
3+
require_relative 'selector_question'
44

55
module Html2rss
66
module Generator

lib/html2rss/generator/question.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ module Generator
77
class Question
88
attr_reader :state, :prompt_options, :prompt
99

10+
def self.validate(input:, **_opts)
11+
input.to_s != ''
12+
end
13+
1014
def initialize(prompt, state, **options)
1115
@prompt = prompt
1216
@state = state
@@ -28,10 +32,6 @@ def ask
2832
state.store(path, processed_input) if path
2933
end
3034

31-
def self.validate(input:, **_opts)
32-
input.to_s != ''
33-
end
34-
3535
private
3636

3737
def process(input)

lib/html2rss/generator/selector_question.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

3-
require_relative './question'
4-
require_relative './item_extractor_question'
3+
require_relative 'question'
4+
require_relative 'item_extractor_question'
55

66
module Html2rss
77
module Generator

0 commit comments

Comments
 (0)