Class: Soundwave::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/soundwave/rake.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :pages, source = "./", destination = "./_site") ⇒ RakeTask

Returns a new instance of RakeTask.



9
10
11
12
13
14
# File 'lib/soundwave/rake.rb', line 9

def initialize(name=:pages, source="./", destination="./_site")
  @name = name
  @site = Site.new(source)
  @destination = Pathname(destination).expand_path
  define
end

Instance Attribute Details

#destinationObject

Returns the value of attribute destination.



7
8
9
# File 'lib/soundwave/rake.rb', line 7

def destination
  @destination
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/soundwave/rake.rb', line 7

def name
  @name
end

#siteObject

Returns the value of attribute site.



7
8
9
# File 'lib/soundwave/rake.rb', line 7

def site
  @site
end

Instance Method Details

#defineObject



16
17
18
19
20
21
# File 'lib/soundwave/rake.rb', line 16

def define
  desc "Build pages in #{@site.source}"
  task(name) do
    @site.generate(@destination)
  end
end