Module: Gamefic::Sdk::Tasks

Defined in:
lib/gamefic-sdk/tasks.rb,
lib/gamefic-sdk/tasks/web.rb,
lib/gamefic-sdk/tasks/ruby.rb,
lib/gamefic-sdk/tasks/common.rb

Defined Under Namespace

Modules: Common Classes: Ruby, Web

Class Method Summary collapse

Class Method Details

.define_allObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gamefic-sdk/tasks.rb', line 12

def define_all
  define_task 'ruby:run', 'Run a Ruby CLI app' do
    Ruby.new.run
  end

  define_task 'ruby:build', 'Build a distributable CLI app' do
    Ruby.new.build
  end

  Rake::Task.define_task('web:generate', [:version]) { |_, args| Web.new.generate(args[:version]) }
            .tap { |task| task.add_description 'Generate a web app' }

  define_task 'web:run', 'Run a standalone web app' do
    Web.new.run
  end

  define_task 'web:build', 'Build a distributable web app' do
    Web.new.build
  end
end

.define_task(name, desc, &block) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/gamefic-sdk/tasks.rb', line 33

def define_task(name, desc, &block)
  return if Rake::Task.task_defined?(name)

  # @type [Rake::Task]
  task = Rake::Task.define_task(name, &block)
  task.add_description desc
end