Top Level Namespace
Defined Under Namespace
Modules: CloudinaryHelper, OFA
Classes: ActivityLog, ActivityLogsController, ApiController, ApplicationController, ApplicationMailer, AuthController, AuthMiddleware, CSRFMiddleware, CartController, DashboardController, JwtMiddleware, MaintenanceMiddleware, Page, PagesController, Post, PostsController, Product, ProductsController, Project, ProjectsController, User
Instance Method Summary
collapse
Instance Method Details
#desc(text) ⇒ Object
5
6
7
|
# File 'lib/task_helper.rb', line 5
def desc(text)
@last_desc = text
end
|
#run_task(name) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/task_helper.rb', line 17
def run_task(name)
task_data = @tasks[name.to_sym]
if task_data
puts "=> Running task: #{name}"
task_data[:block].call
puts "=> Completed task: #{name}"
else
puts "❌ Error: Task '#{name}' not found."
puts "Available tasks:"
@tasks.each do |n, data|
puts " #{n.to_s.ljust(15)} # #{data[:desc]}"
end
end
end
|
#task(name, &block) ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/task_helper.rb', line 9
def task(name, &block)
@tasks[name.to_sym] = {
desc: @last_desc,
block: block
}
@last_desc = nil
end
|