• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is God.rb ???

 
Tina Ma
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What does this script do? This is from the table of contents in your book.

The contents seem so interesting, just the details i will like to know on-hand when developing a rails project !! I want to read this book.
 
Martin Gross
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taken from an Interview with Tom Preston-Werner (Creator of god) http://www.infoq.com/interviews/preston-werner-powerset-github-ruby:
"God is I call it a process monitoring framework. I like to call it a framework because your configuration files but it's pure Ruby, it's just a Ruby file. And so in this file you can do really advanced things like you can do looping, you can even have variables, you can have abstractions, the way that the config file works it's a lot of block, methods that take blocks and then yields to them. So if you want and have a bunch of functionality that can be the same across a bunch of configuration files you can take that and create a method that contains all of that stuff. And all you do is pass it in a certain block which you then use and applies all of this code that you have written.

And you can reuse that whereas in your traditional systems like monit you don't have looping, you don't have variables, it has a very obtuse syntax that you have to learn specially, and it doesn't have extensibility. Another primary reason that I wrote God is to have an easy way to extend the framework. There is a lot of built in conditions like "Is the process running? Is it using too much memory? Too much CPU? Does it URL respond?" These kinds of things. With God you can write a new condition in Ruby just as easily as a few lines, all you have to do is implement a specific interface.

And when you are done you can just put that into your configuration file if you want. It could be that easy. Or you could refactor it out and include that from elsewhere. But it makes the whole concept of extending the framework so easy, because it's just Ruby and we all know Ruby so why not use that as a configuration file?"
 
Martin Gross
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
God Project Page
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic