Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 858493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:33:02+00:00 2026-05-15T08:33:02+00:00

requrie ‘yaml’ hash = {:title=>’abc’} hash.to_yaml will output: — title: abc Is there any

  • 0
requrie 'yaml'
hash = {:title=>'abc'}
hash.to_yaml

will output:

--- 
title: abc

Is there any method to force the title to be a binary, like:

---
title: !binary|
  5Lit5pa

UPDATE

I’m asking this because I want to dump the data from database to yml files. But the text in the database, contains English and non-English text, and both may have such code:

<% xxx %>

When I use rake db:fixtures:load, there will be an error like method xxx not found.

I can replace ‘<%’ with ‘<%%’ before writing to file, but it’s only works for the English text — If there is any non-English charactors, the content will be binary. When loading back, ‘<%%’ is still ‘<%%’. I don’t find a good solution unless I can force ‘to_yaml’ always using ‘binary’ for text.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:33:02+00:00Added an answer on May 15, 2026 at 8:33 am

    The short answer is ‘no’.

    The long is – override an String#to_yaml (or Object#to_yaml) method with your custom implementation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: PHP: Require() and Class Hierarchies Is this bad practice? Is there any
This will require a little setup. Trust me that this is for a good
require 'rubygems' require 'mysql' db = Mysql.connect('localhost', 'root', '', 'mohit') //db.rb:4: undefined method `connect'
require 'sketchup' entities = Sketchup.active_model.entities summa = Hash.new for face in entities next unless
require 'rubygems' require 'xmlsimple' data = XmlSimple.xml_in(<Product><ProductId>12341234</ProductId><Title>Some text here, 11234. and here, 234. and
require_once'modules/logger.php'; $Logger = new Logger(); require_once 'templates/list.php'; $Templates = new templatesList(); require_once 'widgets/list.php'; $Widgets
I require a tree / directed acyclic graph implementation something like this: public class
I require a star rating control (which allows partial rating like 4.5) for my
I require a SQL script to validate a VARCHAR field in a table in
I require a means of checking to see if a string has the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.