Sha256: b6dc1e3198efde17b51b60b54223aacc2298a123ec2c8d69c08d42cdd90f29ca

Contents?: true

Size: 502 Bytes

Versions: 1

Compression:

Stored size: 502 Bytes

Contents

# coding: utf-8
require 'yarf'
require 'fileutils'

module Yarf
  class Recorder

    attr_accessor :config
    def initialize(config)
      @config = config
      @no = (ENV["NO"] || 0).to_i # @test フィクスチャを作成する際にyarfが使用する番号の初期値
    end
    
    def dump(name)
      name.sub!(/\.rb\z/, '')
      dir = File.expand_path("%03d-%s" % [@no, name], config.base_dir)
      FileUtils.mkdir_p(dir)
      config.dumper.dump(dir)
      @no += 1
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yarf-0.1.0 lib/yarf/recorder.rb