11# frozen_string_literal: true
22
33require 'fileutils'
4- require_relative './ files_and_paths'
4+ require_relative 'files_and_paths'
55
66module 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
0 commit comments