One night coding with a bug at the end
Tuesday, December 09, 2008
We’ve spend several hurs this afternoon with Seb to see how to refactor his system, and how to use the last ruby technologies, like Merb and a lot of nice little gems available on GitHub to make it even easier to manage.
Then, I’ve spent the night starting to implement the idea, which is nearly working:
- In the CMS part, pages are created
- These pages contain dynamic elements, they would call code references in various Merb Slice that would be availble in the app
- First Slice is the typical Hello World_: if user place a *@@helloworldshow* element in his page content, it will be replaced automaticly by Hello World in the generated page content
To manage this experimentation various steps had been necessary:
- Use rSpec to be sure the page model and its elements are solidly built
- Create a Slice: it’s the long, boring part, we’ll need to see how to automatize it, because actually there’s a lot of small edits each time to add a new Slice
- Connect from the CMS part to the Slice using RestClient: it’s a ruby gem that allows you to make an http request in the simplest way. For example, the HelloWorld Slice return json object (it could be html or xml) containing the page element content
Next, it might be useful to have a look at the Merb Parts, they are small widgets with their own controller that could be used to generate simple content, we’ll need to see where to separate the CMS part from the various dynamic slices we’ll build.
And the night finish on this beautiful bug that have just appeared:
I’ll have to rollback on the git commit to understand where a conflict has been created, or look for a new version of DataMapper some reference to this LazyArray::RETURN_SELF constant were recently deleted from some of its forks in github.