Class: Mako::Build

Inherits:
Object
  • Object
show all
Defined in:
lib/mako/commands/build.rb

Class Method Summary collapse

Class Method Details

.load_subscription_listObject



28
29
30
31
# File 'lib/mako/commands/build.rb', line 28

def self.load_subscription_list
  path = File.expand_path(Dir.glob('subscriptions.*').first, Dir.pwd)
  Mako::SubscriptionListParser.new(list: path).parse
end

.perform(args) ⇒ Object

Calls #build on Mako::Core. This class stores knowledge of all of the different component classes needed to build the site.

Parameters:

  • args (Array)

    the following are accepted arguments: “–with-sass”: builds with SassRenderer



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mako/commands/build.rb', line 10

def self.perform(args)
  subscription_list = load_subscription_list
  if args.include? '--with-sass'
    Mako::Core.new(requester: FeedRequester,
                   constructor: FeedConstructor,
                   renderers: [HTMLRenderer,
                               SassRenderer],
                   writer: Writer,
                   subscription_list: subscription_list).build
  else
    Mako::Core.new(requester: FeedRequester,
                   constructor: FeedConstructor,
                   renderers: [HTMLRenderer],
                   writer: Writer,
                   subscription_list: subscription_list).build
  end
end