Class: Hanami::CLI::RakeTasks

Inherits:
Object
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/hanami/cli/rake_tasks.rb

Overview

Install Rake tasks in an app

Since:

  • 2.0.0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.install_tasksObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.6.0



40
41
42
# File 'lib/hanami/cli/rake_tasks.rb', line 40

def self.install_tasks
  new.call(tasks)
end

.register_tasks(&blk) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0



23
24
25
26
27
28
# File 'lib/hanami/cli/rake_tasks.rb', line 23

def self.register_tasks(&blk)
  @_mutex.synchronize do
    @tasks << blk
    @tasks.uniq!
  end
end

.tasksObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0



32
33
34
35
36
# File 'lib/hanami/cli/rake_tasks.rb', line 32

def self.tasks
  @_mutex.synchronize do
    @tasks
  end
end

Instance Method Details

#call(tasks) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0



46
47
48
# File 'lib/hanami/cli/rake_tasks.rb', line 46

def call(tasks)
  tasks.each(&:call)
end