mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 06:03:43 +08:00
32dd1e66be
* ignores dot-files and empty emails * new setting to prefer HTML over plaintext emails during import * restore original site settings at the end of import * elided content of HTML mails was not put inside details block
25 lines
641 B
Ruby
25 lines
641 B
Ruby
require 'yaml'
|
|
|
|
module ImportScripts::Mbox
|
|
class Settings
|
|
def self.load(filename)
|
|
yaml = YAML.load_file(filename)
|
|
Settings.new(yaml)
|
|
end
|
|
|
|
attr_reader :data_dir
|
|
attr_reader :split_regex
|
|
attr_reader :batch_size
|
|
attr_reader :trust_level
|
|
attr_reader :prefer_html
|
|
|
|
def initialize(yaml)
|
|
@data_dir = yaml['data_dir']
|
|
@split_regex = Regexp.new(yaml['split_regex']) unless yaml['split_regex'].empty?
|
|
@batch_size = 1000 # no need to make this actually configurable at the moment
|
|
@trust_level = yaml['default_trust_level']
|
|
@prefer_html = yaml['prefer_html']
|
|
end
|
|
end
|
|
end
|