Class: Rakyll::Compiler::Create

Inherits:
Object
  • Object
show all
Includes:
Apply, SetFilename
Defined in:
lib/rakyll/compiler/create.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SetFilename

#set_filename

Methods included from Apply

#apply

Constructor Details

#initialize(source_filename, opts) ⇒ Create

Returns a new instance of Create.



8
9
10
11
# File 'lib/rakyll/compiler/create.rb', line 8

def initialize(source_filename, opts)
  @source_filename = source_filename
  set_filename(source_filename)
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/rakyll/compiler/create.rb', line 6

def url
  @url
end

Instance Method Details

#load_all(pattern, opts = {}) ⇒ Object



13
14
15
16
17
# File 'lib/rakyll/compiler/create.rb', line 13

def load_all(pattern, opts = {})
  Dir.glob(pattern).map do |filename|
    Match.new filename, opts
  end
end

#saveObject



19
20
21
# File 'lib/rakyll/compiler/create.rb', line 19

def save
  File.write(@filename, @body)
end