Sha256: 91089ed6d75203f2546d43c3f8308d95e433671cf25bc7dd1d109d70029f14b8

Contents?: true

Size: 688 Bytes

Versions: 24

Compression:

Stored size: 688 Bytes

Contents

require 'cxxproject/buildingblocks/building_block'

# todo...
module Cxxproject

  class CustomBuildingBlock < BuildingBlock
    attr_reader :custom_command, :actions

    def set_custom_command(c)
      @custom_command = c
      self
    end

    def get_task_name()
      name
    end

    def set_actions(actions)
      if actions.kind_of?(Array)
        @actions = actions
      else
        @actions = [actions]
      end
    end

    def convert_to_rake()
      desc get_task_name
      res = task get_task_name do
        actions.each do |a|
          a.call
        end
      end
      res.type = Rake::Task::CUSTOM
      setup_rake_dependencies(res)
      res
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
cxxproject-0.6.31 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.30 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.29 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.28 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.27 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.26 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.25 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.24 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.23 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.21 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.18 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.17 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.14 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.12 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.13 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.11 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.10 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.9 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.6 lib/cxxproject/buildingblocks/custom_building_block.rb
cxxproject-0.6.5 lib/cxxproject/buildingblocks/custom_building_block.rb