similar to: Question about yaml. Thank you !!

Displaying 20 results from an estimated 10000 matches similar to: "Question about yaml. Thank you !!"

2012 Jul 05
1
hash to_yaml in erb template not giving valid yaml
Hi, I want to use a file resource to write a facts.yaml file for Mcollective. For some reason it won''t provide a valid yaml format if I dump my scope to hash and convert to_yaml. file { "/etc/mcollective/facts.yaml" : owner => root, group => root, mode => 400, loglevel => debug, #content => inline_template("<%= scope.to_hash.reject {
2012 Dec 03
4
Unnecessary changes when creating facts.yaml
I have set up puppet to create a facts.yaml file for mcollective using the following line: content => inline_template("<%= scope.to_hash.reject { |k,v| k.to_s =~ /(uptime.*|timestamp|.*free|macaddress.*|ipaddress)/ }.to_yaml %>"), However, it is creating a lot of unnecessary changes by reordering the facts in the yaml output as you can see in the diff output between to
2007 Oct 07
1
How to store a Mechanize object in the database?
Hi, I am trying to save a Mechanize object in database (using a Rails Model). But the save operation throws a TypeError Considering that "agent" is an instance of a Rails Model and "user" is defined as a "text" type in the Model. irb(main):039:0> agent.user = WWW::Mechanize.new #<WWW::Mechanize:0xb71295f0 @follow_meta_refresh=false, @key=nil,
2012 Dec 14
11
Puppet and Mcollective yaml file changing when it shouldn't
Has anyone else ran into this? debug: /Stage[main]/Mcollective/File[/var/tmp/facts.yaml]/content: Executing ''diff -u /var/tmp/facts.yaml /tmp/puppet-file20121214-13448-933j3r-0'' notice: /Stage[main]/Mcollective/File[/var/tmp/facts.yaml]/content: --- /var/tmp/facts.yaml 2012-12-14 00:53:20.000000000 +0000 +++ /tmp/puppet-file20121214-13448-933j3r-0 2012-12-14
2007 May 29
1
YAML fails when has_one is null
My model has_one :association If I call model.to_yaml (or y model) in the console, and the association is nil, I get a yaml error. Anyone else get this? Is this a confirmed bug? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2010 Jul 17
1
not able to find to_yaml definition
I am looking at rails edge source code. I am able to do puts User.find.to_yaml However I am not able to find piece of code where ''def to_yaml'' is. How this to_yaml serialization is working? can fully understand how to_json and to_xml is working but to_yaml beats me. Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Apr 20
5
Mystified by ActiveRecord.serialize
I''m either missing a step, confused or seeing some odd behavior with ActiveRecord''s serialize feature. When I load an ActiveRecord object from the database, my serialized attribute is a YAML::Object, not the original object. My code is based on an example of this capability in the "Agile Web Dev. w/ Rails" book (p. 196). In create.sql: <code> create table
2011 May 06
3
Reading Yaml files and getting an 'uninitialized constant ActionView::CompiledTemplates' Error
Want to load a configuration from a yaml file ala config/database.yml. I am following http://blog.innovativethought.net/2009/01/02/making-configuration-files-with-yaml-revised/ but, I am getting uninitialized constant ActionView::CompiledTemplates::DOMAIN_CONFIG from rails. I''ve documented my code to make this simpler. I''m running Rails 3.0.7 I know isn''t the
2013 Mar 21
0
how to remove changed_attributes from yaml response
Hi, I am using attr_accessor attributes in model class and assigning the values to attr_accessor dynamically in controller. And am sending the data object to display in Yaml format. I am getting the response along with changed_attributes but I don''t want changed_attributes details in my response. build Model code class Test < ActiveRecord::Base attr_accessor: t_1, t_2, t_3, t_4 end
2006 Jan 12
0
yaml: custom saving and loading of specific classes
I''m trying to use ruby''s yaml library to serialise and deserialise some legacy classes. Simply adding a to_yaml_properties() method isn''t sufficient as special methods need to be called to get and set the properties (they''re not stored simply in instance variables that I can access), and I don''t want to change the class any more than I have to.
2008 Oct 21
6
detecting width overflow in serialized column with mysql
So I''ve got an ActiveRecord model pointing to a MySQL db, with an auto-serialized column ("serialize :columnName"). Thing is, MySQL, depending on how it''s configured (like, by default), has a bad habit of just truncating your data if it''s too wide for the column, with no error raised. Yeah, I can probably reconfigure MySQL and/or my AR connection to it. But
2007 Apr 12
0
dumping data to yaml in specs
I''m wondering whether I could dump out an object to yaml if a certain spec fails. I believe you can do this sort of thing in test unit. E.g.: hash_one.should == hash_two if_failed? hash_two.to_yaml Scott
2011 Mar 29
0
Issue / code smell in AssociationProxy
I came across an issue in my code and after a hard debug session I found something that smells. First the context of my issue. I have a AR object that has a polymorphic belongs_to currently tied to nothing, I want to dump it to YAML. record.to_yaml This raises the following exception: TypeError: wrong argument type nil (expected Data) from
2006 Jun 23
0
to_yaml problem with option hash
Hi, I''m trying to make a fixture for testing with a serialized column. In the YAML fixture I''m trying to fill the serialized column with the to_yaml function. But I keep getting the ''---'' separator, which I don''t want because it is only a ''partial'' yaml fill. According to the documentation to_yaml takes a hash of options, so
2012 Oct 23
0
[LLVMdev] Status of YAML IO?
On Oct 22, 2012, at 4:40 PM, Sean Silva wrote: > Hey Nick, what's the status on YAML IO? The other thread seems to have died.\ I'm waiting on Michael Spencer's feedback. The issues I know of right now are: 1) Should we structure YAML I/O to be a more general I/O utility that could support reading and writing other data formats such as JSON or plists. RIght now, all the code is
2006 Mar 23
1
YAML inconsistencies...
I figured I''d post here before submitting a ticket, but I''m seeing some confusing stuff when dealing with YAML now. I was using it to freeze objects in my database, and so i had some data already around to mess with. I upgraded both Ruby (1.8.3 -> 1.8.4) and Rails ( -> 1.1RC1) and this junk started. I''ve outlined the problem in two pastes, which I''ll
2009 Aug 07
1
Yaml for jqgrid
Anyone have a more extensive yaml file for jqgrid than the one that''s shown with the example Jqgrid Demos page? Also, I''ve been successful in just using the straight jQuery javascript code, rather than invoking the yaml file to produce it), but sometimes get an "unitialized class variable @@grid_name" error. I was doing this because all the code I see on the web to
2012 Jan 24
1
bugzilla + centos 5.7 + yaml errors
Hi all, Struggling with installing ol Bugzy 4.0.3 onto Centos 5.7. When I run the checksetup.pl script included with Bugzilla, I get the message; /usr/bin/perl install-module.pl Email::MIME So I run this from the command line and get YAML errors; Checking for YAML (any) not found I had installed YAML via; yum install *YAML* The package perl-YAML-0.72-1.el5.rf.noarch
2012 Jul 25
1
[LLVMdev] [RFC] YAML I/O
I've been working on reading and writing yaml encoded documents for the lld project. Michael Spencer added the YAMLParser.h functionality to llvm/Support to help in parsing yaml documents. That parser greatly helps at the syntax level, but you still need to hand write a lot of semantic checking and then convert the various node types in to something usable. I've developed a layer on
2006 Jan 11
0
Limit attributes written out by to_yaml
I want to write out a series of records to a text file so that I can quickly edit them and then upload then again into the database. To do this I am using YAML and some code that looks like this: item = Item.find 153 File.open( ''item.yaml'', ''w'' ) do |out| YAML.dump( item, out ) end This dumps out all the field names and values which are stored in the