Class: Logi

Inherits:
Object
  • Object
show all
Defined in:
lib/logi.rb,
lib/logi/post.rb,
lib/logi/config.rb,
lib/logi/loader.rb,
lib/logi/logger.rb,
lib/logi/runner.rb,
lib/logi/version.rb,
lib/logi/compiler.rb,
lib/logi/command/list.rb,
lib/logi/command/post.rb,
lib/logi/command/wiki.rb

Defined Under Namespace

Modules: Command, Logger, Runner Classes: Compiler, Config, Loader

Constant Summary collapse

VERSION =
'0.1.0'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Logi

Returns a new instance of Logi.



7
8
9
10
11
# File 'lib/logi.rb', line 7

def initialize options={}
  @options  = options
  @config   = Config.new(options)
  @compiler = Compiler.new(options)
end

Instance Attribute Details

#compilerObject (readonly)

Returns the value of attribute compiler.



6
7
8
# File 'lib/logi.rb', line 6

def compiler
  @compiler
end

#configObject (readonly)

Returns the value of attribute config.



6
7
8
# File 'lib/logi.rb', line 6

def config
  @config
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/logi.rb', line 6

def options
  @options
end

Instance Method Details

#makeObject



13
14
15
16
17
18
19
20
21
# File 'lib/logi.rb', line 13

def make
  config.posts.each_value do |post|
    io = compiler.compile(post.command,
                          config.post_path_for(post),
                          config.layout_path_for(post))

    compiler.write(config.output_path_for(post), io)
  end
end