ruby on rails - Colon in the front: YAML syntax -
i'm using sidekiq in project , have following yaml config file:
:concurrency: 5 :pidfile: /tmp/pids/sidekiq.pid :logfile: log/sidekiq.log staging: :concurrency: 10 production: :concurrency: 20 queues: - default
i haven't seen having colon in front of key before omitting colon produces interesting results. in case of :pidfile:
example, colon in front creates/overrides destination file without it, uses 1 there , not write it.
is documented somewhere or how sidekiq expects keys?
yaml keys starting colon generate symbolized keys in ruby, whereas keys without colon generate stringified keys:
require 'yaml' string =<<-end_of_yaml :concurrency: 5 :pidfile: /tmp/pids/sidekiq.pid :logfile: log/sidekiq.log staging: :concurrency: 10 production: :concurrency: 20 queues: - default end_of_yaml yaml.load(string) # { # :concurrency => 5, # :pidfile => "/tmp/pids/sidekiq.pid", # :logfile => "log/sidekiq.log", # "staging" => { # :concurrency => 10 # }, # "production" => { # :concurrency => 20 # }, # "queues" => [ # [0] "default" # ] # }
note: if gem depends on symbolized keys stringified keys not override defaults.
Your blog is in a convincing manner, thanks for sharing such an information with lots of your effort and time
ReplyDeleteruby on rails training
ruby on rails training
ruby on rails training
mmorpg oyunlar
ReplyDeleteİNSTAGRAM TAKİPÇİ SATİN AL
Tiktok Jeton Hilesi
Tiktok Jeton Hilesi
Sac Ekim Antalya
INSTAGRAM TAKİPCİ
instagram takipçi satın al
Mt2 pvp serverler
instagram takipçi satın al
perde modelleri
ReplyDeletesms onay
mobil ödeme bozdurma
nft nasıl alınır
ankara evden eve nakliyat
trafik sigortası
dedektör
web sitesi kurma
aşk kitapları