syck

YAML, delayed_job : Psych vs Syck. How to make pysch read attr_accessors for a ruby object

回眸只為那壹抹淺笑 提交于 2019-12-12 17:09:41
问题 I'm having problems using delayed_job (3.0.3) with ruby 1.9.3. Previously we were using ruby 1.8.7 which comes with yaml syck parser which read all the attributes that are set for a ruby object (including attr_accessors) but with the upgrade to 1.9.3 the yaml parser was switched to psych (which was re-written) and it doesn't take into account any attributes except those persisted in the database. How can we make psych to take the attr_accessors into account as well. I tried to switch to syck

How to install syck 1.0.1 on Ubuntu 15.04?

拜拜、爱过 提交于 2019-12-08 07:33:44
问题 I'm getting an error installing syck on Ubuntu 15.04. Building the native extensions fails: Installing syck 1.0.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /home/markus/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150618-8242-1z0c5iw.rb extconf.rb checking for st.h... yes creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling bytecode.c compiling implicit.c compiling token.c token.re: In function ‘sycklex_yaml_utf8’: token.re:541:36

why does psych yaml interpreter add line breaks around 80 characters?

送分小仙女□ 提交于 2019-12-05 13:54:37
问题 Psych is the default yaml engine since ruby 1.9.3 Why, oh why does psych add a line break in its output? Check the example below. ruby -v # => ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-linux] require 'yaml' "this absolutely normal sentence is more than eighty characters long because it IS".to_yaml # => "--- this absolutely normal sentence is more than eighty characters long because it\n IS\n...\n" YAML::ENGINE.yamler = 'syck' "this absolutely normal sentence is more than eighty

how to serialize an object using TCPServer inside?

被刻印的时光 ゝ 提交于 2019-11-29 08:32:30
In an effort to speedup frequent repeated runs of a particular script in my chain, I started serializing to disk custom objects that otherwise take too much time to create aggregately. Using built-in Yaml and/or Marshal. Yaml serializes fine to a seemingly healthy text file but produces the following error when trying to deserialize: b2 = YAML::load(File.open("browserObj.yaml", 'r')) Syck::TypeError: Invalid Regular expression: "/\\A\\s*\n ([a-zA-Z][-+.a-zA-Z\\d]*): ...and many more strange lines However even trying to save to a binary file via Marshal errors: puts File.open("browserObj.bin",

how to serialize an object using TCPServer inside?

给你一囗甜甜゛ 提交于 2019-11-28 01:56:52
问题 In an effort to speedup frequent repeated runs of a particular script in my chain, I started serializing to disk custom objects that otherwise take too much time to create aggregately. Using built-in Yaml and/or Marshal. Yaml serializes fine to a seemingly healthy text file but produces the following error when trying to deserialize: b2 = YAML::load(File.open("browserObj.yaml", 'r')) Syck::TypeError: Invalid Regular expression: "/\\A\\s*\n ([a-zA-Z][-+.a-zA-Z\\d]*): ...and many more strange