Sha256: 35a31883ce57f5befd20a8e8110f3d060dd28b10dba341f126d4a532e630cd73

Contents?: true

Size: 873 Bytes

Versions: 1

Compression:

Stored size: 873 Bytes

Contents

require 'rubygems/ext'

module Shoe
  module Tasks

    class Compile < Abstract
      def active?
        !spec.extensions.empty?
      end

      def define
        desc 'Compile C extensions'
        task :compile do
          top_level_path   = File.expand_path('.')
          destination_path = File.join(top_level_path, spec.require_paths.first)

          spec.extensions.each do |extension|
            Dir.chdir File.dirname(extension) do
              Gem::Ext::ExtConfBuilder.build(
                extension,
                top_level_path,
                destination_path,
                results = []
              )
            end
          end
        end

        %w(
          test
          cucumber:ok
          cucumber:wip
          release
        ).each do |name|
          before_existing(name, :compile)
        end
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoe-0.4.0 lib/shoe/tasks/compile.rb