🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

embulk-parser-script_ruby

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embulk-parser-script_ruby

0.1.0
Rubygems
Version published
Maintainers
1
Created
Source

Script Ruby parser plugin for Embulk

TODO: Write short description here and embulk-parser-script_ruby.gemspec file.

Overview

  • Plugin type: parser
  • Guess supported: no

Configuration

  • script: script (string, required)
  • class: class name (string, required)
  • columns: Array of columns name & type (Array, required)

Example

config.yaml

in:
  type: any file input plugin type
  parser:
    type: script_ruby
    script: parser_hoge
    class: ParserHoge
    columns:
      - name: id
        type: string
      - name: url
        type: string

lib/parser_hoge.rb

require 'json'

class ParserHoge
  def initialize
  end

  def parser(io)
    json = io.read
    obj = JSON.parse(json)
    obj.each do | row |
      yield row
    end
  end
end

run

embulk run config.yaml -I lib 

Build

$ rake

FAQs

Package last updated on 24 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts