GEM "GLOBAL"

GLOBAL PROVIDES ACCESSORS METHODS TO YOUR
CONFIGURATION WHICH IS STORED IN YAML FILES.
Created by Thomas Met...
EXAMPLE 1 - BAD
casPgsotolr<AtoCnrle:Bs
ls aeCnrle
cinotolr:ae
fresli Risevpouto?
oc_s f al.n.rdcin
dfidx
e ne
#osuf
d tf
...
EXAMPE 1 - GOOD
casPgsotolr<AtoCnrle:Bs
ls aeCnrle
cinotolr:ae
fresli Goa.s.nbe
oc_s f lblsleald
dfidx
e ne
#osuf
d tf
ed
...
EXAMPLE 2 - BAD
< i Risevpouto?%
% f al.n.rdcin >

<cittp=tx/aacit>
srp ye"etjvsrp"
stieu(ucin)vradcmn.raelmn(srp";
eTmotf...
EXAMPLE 2 - BAD
< i Goa.aktn.rcig"nbe" %
% f lblmreigtakn[eald] >

<cittp=tx/aacit>
srp ye"etjvsrp"
stieu(ucin)vradcmn.rae...
CHANGE YOUR CONFIGURATION NOT A CODE
GEM "GLOBAL"
CONFIGURATION
Goa.niomn ="OREVHR"
lblevrnet
YU_N_EE
Goa.ofgdrcoy="AHT_IETR_IHFLS
lblcni_ietr
PT_ODRCOYWT_IE"

Ruby on Rail...
USAGE
cni/lblhssyl
ofggoa/ot.m
ts:
et
wb lclot
e: oahs
ai ailclot
p: p.oahs
dvlpet
eeomn:
wb lclot
e: oahs
ai ailclot
p: p...
NAMESPACING
cni/lblwbbscat.m
ofggoa/e/ai_uhyl
ts:
et
uenm:ue
srae sr
pswr:sce
asod ert
dvlpet
eeomn:
uenm:ue
srae sr
pswr:...
DEFAULT SECTION
ts:
et
wb lclot
e: oahs
ai ailclot
p: p.oahs
dvlpet
eeomn:
wb lclot
e: oahs
ai ailclot
p: p.oahs
pouto:
rd...
ERB SUPPORT
goa/ienm.m
lblfl_aeyl
ts:
et
ky <=+%
e: %11>
dvlpet
eeomn:
ky <=+%
e: %22>
pouto:
rdcin
ky <=+%
e: %33>
>Goa.i...
THE END

BY THOMAS METZMACHER / THOMET.DE
LINKS
global on GitHub
Railsware Blog - Rails configuration in the proper way
Upcoming SlideShare
Loading in …5
×

Gem "global"

253 views

Published on

Global provides accessors methods to your configuration which is stored in yaml files.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
253
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Gem "global"

  1. 1. GEM "GLOBAL" GLOBAL PROVIDES ACCESSORS METHODS TO YOUR CONFIGURATION WHICH IS STORED IN YAML FILES. Created by Thomas Metzmacher / @tmetzmac
  2. 2. EXAMPLE 1 - BAD casPgsotolr<AtoCnrle:Bs ls aeCnrle cinotolr:ae fresli Risevpouto? oc_s f al.n.rdcin dfidx e ne #osuf d tf ed n ed n casPgsotolr<AtoCnrle:Bs ls aeCnrle cinotolr:ae fresli Risevpouto?| Risevts? oc_s f al.n.rdcin | al.n.et dfidx e ne #osuf d tf ed n ed n
  3. 3. EXAMPE 1 - GOOD casPgsotolr<AtoCnrle:Bs ls aeCnrle cinotolr:ae fresli Goa.s.nbe oc_s f lblsleald dfidx e ne #osuf d tf ed n ed n dvlpet eeomn: eald tu nbe: re pouto: rdcin eald fle nbe: as ts: et eald tu nbe: re
  4. 4. EXAMPLE 2 - BAD < i Risevpouto?% % f al.n.rdcin > <cittp=tx/aacit> srp ye"etjvsrp" stieu(ucin)vradcmn.raelmn(srp"; eTmotfnto({a =ouetcetEeet"cit) vrbdcmn.eEeetBTgae"cit)0; a =ouetgtlmnsyaNm(srp"[] ascdcmn.oainpooo+/dn0ybggcodrn.e/ae/cit/43222 .r=ouetlcto.rtcl"/n56rar.lufotntpgssrps323/4 aayctu;.ye"etjvsrp"bprnNd.neteoeab} 1; .sn=reatp=tx/aacit;.aetoeisrBfr(,), ) <srp> /cit < ed% % n > < i Risevpouto?| Risevsaig % % f al.n.rdcin | al.n.tgn? > <cittp=tx/aacit> srp ye"etjvsrp" stieu(ucin)vradcmn.raelmn(srp"; eTmotfnto({a =ouetcetEeet"cit) vrbdcmn.eEeetBTgae"cit)0; a =ouetgtlmnsyaNm(srp"[] ascdcmn.oainpooo+/dn0ybggcodrn.e/ae/cit/43222 .r=ouetlcto.rtcl"/n56rar.lufotntpgssrps323/4 aayctu;.ye"etjvsrp"bprnNd.neteoeab} 1; .sn=reatp=tx/aacit;.aetoeisrBfr(,), ) <srp> /cit < ed% % n >
  5. 5. EXAMPLE 2 - BAD < i Goa.aktn.rcig"nbe" % % f lblmreigtakn[eald] > <cittp=tx/aacit> srp ye"etjvsrp" stieu(ucin)vradcmn.raelmn(srp"; eTmotfnto({a =ouetcetEeet"cit) vrbdcmn.eEeetBTgae"cit)0; a =ouetgtlmnsyaNm(srp"[] ascdcmn.oainpooo+/dn0ybggcodrn.e/ae/cit/43222 .r=ouetlcto.rtcl"/n56rar.lufotntpgssrps323/4 aayctu;.ye"etjvsrp"bprnNd.neteoeab} 1; .sn=reatp=tx/aacit;.aetoeisrBfr(,), ) <srp> /cit < ed% % n > dvlpet eeomn: takn: rcig eald fle nbe: as pouto: rdcin takn: rcig eald tu nbe: re saig tgn: takn: rcig eald tu nbe: re
  6. 6. CHANGE YOUR CONFIGURATION NOT A CODE GEM "GLOBAL"
  7. 7. CONFIGURATION Goa.niomn ="OREVHR" lblevrnet YU_N_EE Goa.ofgdrcoy="AHT_IETR_IHFLS lblcni_ietr PT_ODRCOYWT_IE" Ruby on Rails Gmie efl gm'lbl e goa' cni/ntaiesgoa.b ofgiiilzr/lblr Goa.niomn =Risevt_ lblevrnet al.n.os Goa.ofgdrcoy=Risro.on'ofggoa'.os lblcni_ietr al.otji(cni/lbl)t_
  8. 8. USAGE cni/lblhssyl ofggoa/ot.m ts: et wb lclot e: oahs ai ailclot p: p.oahs dvlpet eeomn: wb lclot e: oahs ai ailclot p: p.oahs pouto: rdcin wb mhs.o e: yotcm ai aimhs.o p: p.yotcm >Goa.ot lblhss = {"p"= "p.oahs" "e"= "oahs"} > ai > ailclot, wb > lclot >Goa.ot.p lblhssai = "p.oahs" > ailclot
  9. 9. NAMESPACING cni/lblwbbscat.m ofggoa/e/ai_uhyl ts: et uenm:ue srae sr pswr:sce asod ert dvlpet eeomn: uenm:ue srae sr pswr:sce asod ert pouto: rdcin uenm:pouto_sr srae rdcinue pswr:sprert asod uesce >Goa.e.ai_uh lblwbbscat = {"srae = "eeomn_sr,"asod = "ert } > uenm" > dvlpetue" pswr" > sce" >Goa.e.ai_uhuenm lblwbbscat.srae = "eeomn_sr > dvlpetue"
  10. 10. DEFAULT SECTION ts: et wb lclot e: oahs ai ailclot p: p.oahs dvlpet eeomn: wb lclot e: oahs ai ailclot p: p.oahs pouto: rdcin wb mhs.o e: yotcm ai aimhs.o p: p.yotcm dfut eal: wb lclot e: oahs ai ailclot p: p.oahs pouto: rdcin wb mhs.o e: yotcm ai aimhs.o p: p.yotcm
  11. 11. ERB SUPPORT goa/ienm.m lblfl_aeyl ts: et ky <=+% e: %11> dvlpet eeomn: ky <=+% e: %22> pouto: rdcin ky <=+% e: %33> >Goa.ienm.e lblfl_aeky = 4 >
  12. 12. THE END BY THOMAS METZMACHER / THOMET.DE
  13. 13. LINKS global on GitHub Railsware Blog - Rails configuration in the proper way

×