Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-data

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-data

  • 0.3.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

This is the ruby implementation of the simple-data spec

Example

require 'simple-data'

SimpleData.generate('spacecraft.sda', 
                    [ [ :cstr, 'name',   nil, 'spacecraft'     ],
                      [ :cstr, 'origin', nil, 'serie or movie' ],
                      [ :f64,  'x',      'm'                   ],
                      [ :f64,  'y',      'm'                   ],
                      [ :f64,  'z',      'm'                   ] ],
                    tags: { author:  "Stephane D'Alu",
                            url:     "http://www.sdalu.com/",
                            license: "MIT" }) do |sda|
    sda.put("Enterprise", "Star Trek",    1.0, 2.0, 3.0);
    sda.put("Rocinante",  "The Expanse",  1e6, 2e6, 3e6);
    sda.put("Serenity",   "Firefly",      0.0, 0.0, 0.0);
    sda.put("Bebop",      "Cowboy Bebop", 4.0, 6.8, 8.0);
end

SimpleData.open('spacecraft.sda') do |sda|
	puts sda.fields.inspect
	while row = sda.get do
	    puts row.inspect
    end
end

FAQs

Package last updated on 13 Feb 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc