Sha256: e995bcc65872f40e6ebe33ace706fc6eebd67de4e1c9cc02d07fe87567627438

Contents?: true

Size: 974 Bytes

Versions: 1

Compression:

Stored size: 974 Bytes

Contents

# frozen_string_literal: true

require 'English'
require 'yaml'
require 'binding_of_caller'
require 'logger'
require 'ostruct'
require 'curses'
require 'fileutils'
require 'csv'
require 'hirb'
require 'parallel'

require 'fasten/state'
require 'fasten/logger'
require 'fasten/stats'
require 'fasten/task'
require 'fasten/ui'
require 'fasten/dag'
require 'fasten/yaml'
require 'fasten/executor'
require 'fasten/worker'
require 'fasten/version'

module Fasten
  class << self
    include Fasten::Logger

    def from_yaml(path, **options)
      executor = Fasten::Executor.new(**options)
      executor.load_yaml(path)

      executor
    end

    def map(list, **options, &block)
      executor = Fasten::Executor.new(**options)
      executor.block = block

      list.each do |item|
        executor.add Fasten::Task.new name: item.to_s, request: item
      end

      executor.perform
      executor.stats_table

      executor.task_list.map(&:response)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fasten-0.5.4 lib/fasten.rb