Popularity
7.9
Growing
Activity
0.0
Declining
32
5
9
Monthly Downloads: 16
Programming language: Haskell
License: MIT License
Tags:
Data
Latest version: v0.2.0
ruby-marshal alternatives and similar packages
Based on the "Data" category.
Alternatively, view ruby-marshal alternatives based on common mentions on social networks and blogs.
-
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text.
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Promo
www.influxdata.com
Do you think we are missing an alternative of ruby-marshal or a related project?
README
ruby-marshal
Haskell library to parse a subset of Ruby objects serialised with Marshal.dump.
Supported Types
NilClass
TrueClass | FalseClass
Array
Fixnum
Float
Hash
String
Symbol
If you would like to add support for another type, please feel free to create an issue or open a pull request using the guidelines below.
Usage
Example
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Ruby.Marshal
import Data.ByteString (ByteString)
import System.Directory (getCurrentDirectory)
import qualified Data.ByteString as BS
import qualified Data.Map.Strict as DM
lookupUserID :: (ByteString, RubyStringEncoding)
-> RubyObject
-> Maybe (ByteString, RubyStringEncoding)
lookupUserID key hash = fromRuby hash >>= \cookie -> DM.lookup key cookie
main :: IO ()
main = do
dir <- getCurrentDirectory
rbs <- BS.readFile (mconcat [dir, "/test/bin/railsCookie.bin"])
print $
case decode rbs of
Just cookie -> lookupUserID ("user_id", UTF_8) cookie
Nothing -> Nothing
Contributing
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin my-new-feature
). - Create new Pull Request.