Enough Ruby To Be Dangerous. I am a recovering System Administrator. It's a title I was chained to for the first decade of my career. I've only recently decided to tackle Software Engineering full-time, and despite the challenges of changing careers, it has kept me free of on-call pager duties. That was until my company decided to start a new cloud-based service offering. This service was to be run 'DevOps' style - a perfect hybrid of my experience in both System Administration and Software Engineering. To scale this new service, we were going to use Chef for infrastructure automation. At this point, I was becoming well versed in Python.
I'm going to have to learn Enough Ruby to be Dangerous. What is Ruby, right? Ruby is a Python DSL for Hipsters. j/k. According to Yukihiro 'Matz' Matsumoto, the creator of Ruby: An interpreted scripting language for quick and easy object-oriented programming. Matz created Ruby in the 90's from a desire for a language more powerful than Perl, and more object-oriented than Python. Awesome. Just Enough Ruby for Chef.
Ruby is a simple programming language that is designed to be easy to read and to behave in a predictable manner. The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL (domain-specific language) that is used for specific resources. Enough resources are available to support the most common infrastructure automation scenarios natively within Chef; however, this DSL can also be extended when additional resources and capabilities are required. The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL (domain-specific language) that is used for specific resources. These settings are saved as Ruby files and are stored in the chef-repo.
When these files are uploaded to the Chef server, they are converted to JSON. Each time the chef-repo is refreshed, the contents of all domain-specific Ruby files are re-compiled to JSON and are re-uploaded to the Chef server. to return: ! !!
Learning Ruby. Ruby Cheat Sheets. Ruby is an easy language to learn, but it's often necessary to look up something we've forgotten. A combination of Google plus any Ruby books we have on our shelves can help, but sometimes it's handy to refer to a simpler set of notes - such as a "cheat sheet. " This post attempts to cover the most interesting ones.
Resource_init :package, "puppet", :ensure => :installed Variable setting: var_set "nameofvar", "value" Variable getting: var_get "nameofvar" Variable unsetting: var_unset "nameofvar" For relationships I wouldn't use the term 'edge' for semantic reasons. Foo[bar] -> Bar[baz] -> Bob[mary] Syntax like this: Could be done like this: ken.