Sha256: 7babaa137baca409b613ddebf315f92adc4d417e6367687ff9f78c31a6ce77b9

Contents?: true

Size: 712 Bytes

Versions: 9

Compression:

Stored size: 712 Bytes

Contents

require 'rake'
require 'rake/tasklib'
require 'yaml'
require 'spectifly/configuration'

module Spectifly
  class Task < ::Rake::TaskLib
    attr_accessor :configuration

    def configure!
      config_path = File.join(Rake.original_dir, 'config', 'spectifly.yml')
      config_hash = File.exist?(config_path) ? YAML.load_file(config_path) : {}
      @configuration = Spectifly::Configuration.new(config_hash)
    end

    def initialize(task_name, *args, &block)
      configure!
      task task_name, *args do |task_name, task_args|
        block.call(configuration, task_args) if block
      end
    end
  end
end

Dir[File.join(File.dirname(__FILE__), '..', 'tasks', '*.rake')].each do |path|
  load path
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spectifly-0.0.10 lib/spectifly/tasks.rb
spectifly-0.0.9 lib/spectifly/tasks.rb
spectifly-0.0.8 lib/spectifly/tasks.rb
spectifly-0.0.7 lib/spectifly/tasks.rb
spectifly-0.0.6 lib/spectifly/tasks.rb
spectifly-0.0.5 lib/spectifly/tasks.rb
spectifly-0.0.4 lib/spectifly/tasks.rb
spectifly-0.0.3 lib/spectifly/tasks.rb
spectifly-0.0.2 lib/spectifly/tasks.rb