Class: Raketeer::NokogiriInstallTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/raketeer/nokogiri_install_tasks.rb

Overview

Author:

  • Jonathan Bradley Whited

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ NokogiriInstallTask

Returns a new instance of NokogiriInstallTask.

Since:

  • 0.1.0



26
27
28
29
30
31
32
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 26

def initialize(name)
  super()

  @description = nil
  @install_cmd = nil
  @name = name
end

Instance Attribute Details

#descriptionObject

Since:

  • 0.1.0



22
23
24
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 22

def description
  @description
end

#install_cmdObject

Since:

  • 0.1.0



23
24
25
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 23

def install_cmd
  @install_cmd
end

#nameObject

Since:

  • 0.1.0



24
25
26
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 24

def name
  @name
end

Instance Method Details

#define(&block) ⇒ Object

Since:

  • 0.1.0



34
35
36
37
38
39
40
41
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 34

def define(&block)
  block&.call(self)

  desc @description
  task @name do |task,args|
    run(task,args)
  end
end

#run(task, args) ⇒ Object

Since:

  • 0.1.0



43
44
45
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 43

def run(task,args)
  sh(*@install_cmd)
end