New plugin - Personalise Site

This is a stylistic nit pick, but typically methods that end in "?" return true or false rather than some other value. I would personally name the methods "user_browser_version" or "user_platform" or something like that.

--Jeremy

Just some ideas…

Hi Jeremy,

Thanks for your feedback, I have made the changes to remove the ‘?’ based on your comments.

You could also add some methods like the following:

running_windows?

running_os_x?

then your example becomes:

<% if running_windows? -%> ruby script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/ <% elsif running_os_x? -%> ./script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/ <% else -%> script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/ <% end -%>

What? Replace methods? No way. Just add some nice convenience methods to pretty up the views.

For example:

def running_osx? which_platform == ‘Mac’ end

def running_windows which_platform == “Windows”

end

Etc. You’re not replacing methods… you are adding a DSL to your plugin… which makes views much easier.

It also allows you to change the underlying implementation. For example… which_platform might return “Windows” right now… but what if it returns win32 in some cases? It might also return something else in the future.

This is one reason why you access your params in a Rails application via params (a method) and not @params (an instance variable)

Nice plugin btw… have you submitted this to agilewebdevelopment.com/plugins yet?