I've worked with SVN very successfully with a bunch of companies... In short: We moved to Bzr. We had some issues. We moved back to SVN.. we cry every day.
Due to a drive from the developers in my team we moved to a distributed version control system. When I say 'moved' there was a stipulation from above that we keep using SVN as the repository of record. The perceived benefits were being able to make branches easily and work in sub-features in a more controlled manner. Being an 'XP' Nutter I didn't buy this.. "Integrate as often as possible".. you hear me cry. Still.. the developers wanted it.. so I was happy to give it a go.
We looked at a bunch of distributed version control solutions (mainly looking for something fast that will still work with SVN). We picked Bazaar.
We got to use it for a few months. I never really shared a branch with anyone.. but I did like working on a branch per feature.. being able to switch branches to do the refactoring I just found I need to do before my feature can continue.. etc.
Then we hit a snag... something in the SVN/Bazaar integration would sometimes cause SVN to store the wrong meta-data and all bazaar users would stop being able to commit changes. Management didn't really like the effort it took to get BZR working in the first place, so that was it's death toll.
We moved back to SVN and working off trunk. Everything goes ok. It's not very speedy, but hay... we can deal with that.
What get's me is this... BZR makes sure you commit before you merge from trunk. In SVN, when you get latest (and haven't committed yet).. SVN will merge what it can into your unbacked up files. More than anything, that's starting to really bother me.
Nigel Thorne's software development blog, focusing on finding simple solutions to real work problems.
Thursday, October 28, 2010
Monday, March 15, 2010
Ruby BlankSlate Issue.. or The Problem Of Accidental Monkey Patching
I was updating a Rails app recently and found the tests weren't running.
The error was reported in HoboField (an ace gem that lets define your model fields within your model and auto-generate your migrations by 'diff'ing between schema and models).
The error was .../hobo_fields/field_declaration_dsl.rb:22 'field': wrong number of arguments (1 for 2)
This was being thrown when ruby was getting to a model class like this...
The error turns out to be because the DSL class in Hobofields uses BlankSlate as it's base class. ActiveSupport also has a definition for BlankSlate, so Hobofields does an 'unless defined? BlankSlate' check before it defines one.
However... I was also using 'Riot' for my testing. Riot also defines BlankSlate.
The ActiveSupport version leaves the instance_eval method on the BlankSlate class. The Riot version removes it and doesn't check to see that BlankSlate is not already defined. Riot was accidentally Monkey Patching ActiveSupport.
As both libraries were being loaded, so the Riot definition was extending the ActiveSupport version and it was loosing it's instance_eval method. This leads to missing method picking up calls it shouldn't and eventually ends in the error I was getting.
I patched Riot and the problem went away. I expect to run into this sort of problem again in the future.
Do me a favor :) If you are developing a gem, please be really careful what you define in global space. It is best to namespace any classes you define so you don't risk cross over.
Thanks
The error was reported in HoboField (an ace gem that lets define your model fields within your model and auto-generate your migrations by 'diff'ing between schema and models).
The error was .../hobo_fields/field_declaration_dsl.rb:22 'field': wrong number of arguments (1 for 2)
This was being thrown when ruby was getting to a model class like this...
class SomeModel < ActiveRecord::Base
fields do
timestamps
end
...
end
The error turns out to be because the DSL class in Hobofields uses BlankSlate as it's base class. ActiveSupport also has a definition for BlankSlate, so Hobofields does an 'unless defined? BlankSlate' check before it defines one.
However... I was also using 'Riot' for my testing. Riot also defines BlankSlate.
The ActiveSupport version leaves the instance_eval method on the BlankSlate class. The Riot version removes it and doesn't check to see that BlankSlate is not already defined. Riot was accidentally Monkey Patching ActiveSupport.
As both libraries were being loaded, so the Riot definition was extending the ActiveSupport version and it was loosing it's instance_eval method. This leads to missing method picking up calls it shouldn't and eventually ends in the error I was getting.
I patched Riot and the problem went away. I expect to run into this sort of problem again in the future.
Do me a favor :) If you are developing a gem, please be really careful what you define in global space. It is best to namespace any classes you define so you don't risk cross over.
Thanks
Friday, March 12, 2010
Visual Studio 2010 Beta2 says "The application cannot start."
We have been having this issue with Visual Studio 2010 Beta2. It just stops loading. For some it stops loading unless you load it via loading a solution, others it's the opposite.
We can't move to the RC2 until we it supports Silverlight 4 properly..
The solution?
We have had some success by just loading up a visual studio command prompt and running:
UPDATE:
Also try:
Give it a go. Let me know how you get on :)
(It might also be worth backing up your currentsettings.xml file first)
We can't move to the RC2 until we it supports Silverlight 4 properly..
The solution?
We have had some success by just loading up a visual studio command prompt and running:
devenv /ResetSettingsUPDATE:
Also try:
devenv /resetdevenv /resetuserdataGive it a go. Let me know how you get on :)
(It might also be worth backing up your currentsettings.xml file first)
Monday, January 11, 2010
accepts_nested_attributes_for and sti
I have a site that lets you create child entities on the create form for the aggregate root. Thanks to accepts_nested_attributes_for this isn't too hard.
accepts_nested_attributes_for :kids, :allow_destroy => true
The problem I hit was mixing this with single table inheritance. When the child node is for a derived class, it saves without the 'type' information being set.
It seems the accepts_nested_attributes only creates new instances of the generic base class entity, which then ignores the value passed to the 'type' field.
I ended up doing this work around to get it to replace #new on the base class with an implementation that returns the correctly typed derived instance when the hash passed includes a 'type' field.
Thanks to Coderrr for posting this work around.
Note: I've backed up the code to http://gist.github.com/273858
accepts_nested_attributes_for :kids, :allow_destroy => true
The problem I hit was mixing this with single table inheritance. When the child node is for a derived class, it saves without the 'type' information being set.
It seems the accepts_nested_attributes only creates new instances of the generic base class entity, which then ignores the value passed to the 'type' field.
I ended up doing this work around to get it to replace #new on the base class with an implementation that returns the correctly typed derived instance when the hash passed includes a 'type' field.
Thanks to Coderrr for posting this work around.
Note: I've backed up the code to http://gist.github.com/273858
Monday, September 21, 2009
Insert multiple word documents into another.
Just thought I would share this quick macro I wrote for our test team to let them join a bunch of documents together in word..
http://gist.github.com/190041
It's just simple enough to work.
http://gist.github.com/190041
It's just simple enough to work.
Subscribe to:
Posts (Atom)