Sha256: 8a766cce75a762194a4d69eb8060b5df04715077eba2ec3233058ed1ca5f5306

Contents?: true

Size: 845 Bytes

Versions: 20

Compression:

Stored size: 845 Bytes

Contents

module Embulk
  def self.create_example(path)
    require 'fileutils'
    require 'zlib'

    puts "  Creating #{path}/"
    FileUtils.mkdir_p File.join(path, 'csv')
    puts "  Creating #{path}/csv/"

    puts "  Creating #{path}/csv/sample_01.csv.gz"
    Zlib::GzipWriter.open(File.join(path, 'csv', 'sample_01.csv.gz')) do |f|
      f.write <<EOF
id,account,time,purchase,comment
1,32864,2015-01-27 19:23:49,20150127,embulk
2,14824,2015-01-27 19:01:23,20150127,embulk jruby
3,27559,2015-01-28 02:20:02,20150128,"Embulk ""csv"" parser plugin"
4,11270,2015-01-29 11:54:36,20150129,NULL

EOF
    end

    puts "  Creating #{path}/seed.yml"
    File.open(File.join(path, 'seed.yml'), 'w') do |f|
      f.write <<EOF
in:
  type: file
  path_prefix: "#{File.expand_path File.join(path, 'csv', 'sample_')}"
out:
  type: stdout
EOF
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
embulk-0.8.18 lib/embulk/command/embulk_example.rb
embulk-0.8.18-java lib/embulk/command/embulk_example.rb
embulk-0.8.17 lib/embulk/command/embulk_example.rb
embulk-0.8.17-java lib/embulk/command/embulk_example.rb
embulk-0.8.16 lib/embulk/command/embulk_example.rb
embulk-0.8.16-java lib/embulk/command/embulk_example.rb
embulk-0.8.15 lib/embulk/command/embulk_example.rb
embulk-0.8.15-java lib/embulk/command/embulk_example.rb
embulk-0.8.14 lib/embulk/command/embulk_example.rb
embulk-0.8.14-java lib/embulk/command/embulk_example.rb
embulk-0.8.13 lib/embulk/command/embulk_example.rb
embulk-0.8.13-java lib/embulk/command/embulk_example.rb
embulk-0.8.12 lib/embulk/command/embulk_example.rb
embulk-0.8.12-java lib/embulk/command/embulk_example.rb
embulk-0.8.11-java lib/embulk/command/embulk_example.rb
embulk-0.8.11 lib/embulk/command/embulk_example.rb
embulk-0.8.10 lib/embulk/command/embulk_example.rb
embulk-0.8.10-java lib/embulk/command/embulk_example.rb
embulk-0.8.9 lib/embulk/command/embulk_example.rb
embulk-0.8.9-java lib/embulk/command/embulk_example.rb