Class: Makimono::Command::Build

Inherits:
Thor::Group
  • Object
show all
Defined in:
lib/makimono/command/build.rb

Instance Method Summary collapse

Instance Method Details

#load_user_configObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/makimono/command/build.rb', line 11

def load_user_config
  user_config = if File.file?(options[:config])
                  yaml = File.read(options[:config])
                  filename = File.basename(options[:config])
                  YAML.safe_load(yaml, permitted_classes: [Date, Time], filename: filename, symbolize_names: true)
                else
                  {}
                end
  @config = Configuration.new(user_config)
end

#load_user_libraryObject



22
23
24
# File 'lib/makimono/command/build.rb', line 22

def load_user_library
  Dir[File.join(@config[:library], '**/*.rb')].sort.each { |f| require f } if Dir.exist?(@config[:library])
end

#processObject



26
27
28
# File 'lib/makimono/command/build.rb', line 26

def process
  Makimono::Processor.new(@config).process
end