Class: Raketeer::NokogiriInstallTask

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

Overview

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



21
22
23
24
25
26
27
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 21

def initialize(name)
  super()

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

Instance Attribute Details

#descriptionObject

Since:

  • 0.1.0



17
18
19
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 17

def description
  @description
end

#install_cmdObject

Since:

  • 0.1.0



18
19
20
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 18

def install_cmd
  @install_cmd
end

#nameObject

Since:

  • 0.1.0



19
20
21
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 19

def name
  @name
end

Instance Method Details

#define(&block) ⇒ Object

Since:

  • 0.1.0



29
30
31
32
33
34
35
36
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 29

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



38
39
40
# File 'lib/raketeer/nokogiri_install_tasks.rb', line 38

def run(_task,_args)
  sh(*@install_cmd)
end