What I like to call BDC
First off let me explain the move from my old blog to here at wordpress. Firstly I have learned a great deal since I originally wrote the app I was using to blog from and felt it was in dire need of a rewrite. That and I will soon be moving my blog and would like to launch the rewrite once I get things squared away.
Now onto BDC… What is BDC? Well it’s something I was thinking about while trying to become a little more proficient with Rspec and stories. Basically it would be a file that you can place in your rails app that explains what you basically want the app to do and from there uses a generator to go through the “story” and create the models, controllers and views from that. Let’s see if I can post and example of what a “story” would look like.
class ExampleBlogStory < BehaviorDrivenCreation :: Base
A user which requires a
login that has between 4 and 6 characters
password that has between 6 and 8 characters
email that is valid
and has
many posts
many comments
one ProfileA post which requires a
title
body
and has
many comments
and belongs to
a userA comment which requires a
email that is valid
comment
and belongs to a
post
userend
This story would create a user, post, and comment model that
- use validations for the requirements
- Create the model associations for users, posts, and comments
- Create the necessary migrations
- create the standard crud controllers and views for each model.
I don’t know if it would be possible but it could really give a project a head start as well as set a direction for development and give a good working base to start with. I think it would at least make for a good plugin or gem… Just my two cents let me know what you think.
Most Recent Commit to Rblog
I have made quite a few commits here lately and most have been small minor things that don’t really effect much. I did make a couple of pretty meaningful changes and I wanted to go over them here a little bit.
Archiving System.
Rblog’s Archiving system is something that I’m kind of proud of mainly cause I came up with it all by myself. Now while it works it’s not exactly functioning the way I want. So what I did was make some modifications to it as to get it pointed in the right direction.
The first change was in the post model. where I have a method that’s called before creation. Originally this method would check for an archive from the existing month and add the id of said archive to the posts archive_id column if it existed. If it didn’t then it would create a new archive based on the month and year of the post. The problem with this was the creation of the archive was the only thing that used the year of the post. Now while this may not be a big problem for small short lived blogs it could cause a lot of confusion and errors for longer lived blogs. So I went in and changed the method to check for an existing archive based on month and year. I also changed the partial that displays the list of archives to sort them out by year.
Next I added and archives controller to handle the displaying of the archives. Now these changes are just steps in the right direction but not by any means completion of the system. I’m probably going to be spending a lot of time getting this system running right before I move on to other things.
If you want to grab the code from GitHub
and take a look I’m more than open to suggestions so you can add to the comments of this post to let me know your thoughts.
What’s going on.
A lot of things have happened today so I thought I’d go over what’s up.
Firstly I decided to open source the code for my blog. It’s available from GitHub. The project is called RBlog. You can get all the info to get your own copy from there. I would like to encourage anyone interested to take it and make it your own. I’m actually going to be toning it down a little so that it’s easier to extend. Then I’ll probably branch it off and make a more feature rich version. Now you’ll notice I’m using WordPress to host this blog. Since I decided to open up my app I feared there may be security risks I haven’t tracked down yet so I’m doing this till I feel a little more comfortable with the stability of the software.
Also I’ve been playing with Heroku and I have to admit that it’s pretty cool. Still seems a little buggy but I think as it stabalizes it will bring a whole new era of mobility to web development. With this service you can work on your application from anywhere you can get an internet connection. Now if this isn’t cool enough you can still work on your app while out of reach by using the service to clone your app using git and then updating everything when you get a connection again. It’s a very impressive service and just pure genius as far as I’m concerned so Kudos to those from Heroku and keep up the good work. I for one am very excited to see what the future holds.
Now I was going to post some more stuff but I’m getting a little tipsy so I better save it for another day. Don’t forget to check out RBlog and I’ld love to hear any feedback you have.










Recent Comments