Sha256: 74e544fc54390ba01ca29ea44553ab35563c0e1fda2c630c3bf8930049825e2b

Contents?: true

Size: 628 Bytes

Versions: 7

Compression:

Stored size: 628 Bytes

Contents

#!/usr/bin/env ruby 

require 'faker'
require 'json'

results = []
1.upto(100){ |n|
  record = {
    'name' => Faker::Name.name,
    'city' => Faker::Address.city,
    'street_name' => Faker::Address.street_name,
    'zip_code' => Faker::Address.zip_code,
    'registered_at' => Faker::Time.between(DateTime.now - 1825,DateTime.now - 30).strftime("%Y-%m-%d %H:%M:%S"),
    'vegetarian' => Faker::Boolean.boolean(0.2),
    'age' => Faker::Number.between(20,80).to_i,
    'ratio' => Faker::Number.decimal(2, 3).to_f
  }
  results << record
}

data = {
  "count" => 100,
  "page" => 1,
  "results" => results
}

print data.to_json

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
embulk-parser-jsonpath-0.3.1 example/dummy.rb
embulk-parser-jsonpath-0.3.0 example/dummy.rb
embulk-parser-jsonpath-0.2.0 example/dummy.rb
embulk-parser-jsonpath-0.1.3 example/dummy.rb
embulk-parser-jsonpath-0.1.2 example/dummy.rb
embulk-parser-jsonpath-0.1.1 example/dummy.rb
embulk-parser-jsonpath-0.1.0 example/dummy.rb