Wiped away my install of XCode this evening to install the new version of Xcode (which I installed straight to /Applications!).
Prior to doing this I also completely deleted the /Developer folder.
Upon successfully reinstalling RVM and homebrew using the devtools, I cd’d into a rvm managed folder and did the standard bundle install, upon which time I eventually received this error:
Error - error.sh
1
: fatal error: 'stdio.h' file not found
I had installed the Command Line Tools for Xcode, but I had not yet switched where it should resolve those tools. Running the following command fixed the issue:
A couple of people have asked me how to get rvm working successfully on windows with cygwin.
I’ll write another post later about how I use devtools to successfully run msys and cygwin side by side from the same set of dotfiles (customized per environment)!
I started with a brand new vm image with the software installed according to the post here.
If you don’t wish to read that previous post just know I installed cygwin to C:\utils\cygwin (for the purpose of this post it you are following along, I would suggest installing to that path also). I also included the following packages (some of these are not necessary for ruby compilation, but they have become my base for a cygwin install):
Archive
unzip - Unzipping zip files
Net
openssl - bin and sources
openssh - Only if you are not going to compile openssh yourself
curl - download internet resources
Devl
colorgcc
gcc
gcc-core - compiler
git
git-completion
git-gui
git-svn
gitk
libtool - Shared library generation tool. You’ll need it when trying to compile rubies
libncurses-devel - Used when compiling several other tools I use
make
mercurial
openssl-devel - Required for compiling openssh (not necessarily required for rvm, but I always install it to compile openssh myself)
readline
Libs
zlib
zlib-devel
Utils
ncurses - Enabling better handling of terminal
patch - Apply a diff file to an original. Again, you’ll need it when rvm is trying to patch the ruby installs
Once the cygwin install completes we can continue.
Setting Up
Open up a new cygwin session (C:\utils\cygwin\cygwin.bat).
Issue the following commands in the cygwin session:
Get The devtools - devtools.sh
123456
mkdir repositories
cd repositories
mkdir developwithpassion
cd developwithpassion
git clone git://github.com/developwithpassion/devtools
cd devtools
The results should look as follows:
You should now be sitting in the devtools folder so you can now run the kick_off_script:
Prep - kick_off.sh
1
./osx_or_cygwin_kick_off
Repeat the above step(the first time you run it, it creates a settings file for your user that can be edited further if you are going to make further use of devtools later on)
This webinar will be an opportunity for people to get an understanding of how I structure my devtools folder and how it is leveraged to facilitate working effectively between osx and windows.
Title: Develop With Passion® - devtools
Date: Wednesday, March 28, 2012
Time: 12:00 PM - 1:00 PM MDT
After registering you will receive a confirmation email containing information about joining the Webinar.
System Requirements
* PC-based attendees
* Required: Windows® 7, Vista, XP or 2003 Server
* Macintosh®-based attendees
* Required: Mac OS® X 10.5 or newer
I am sorry to announce that next month’s .Net Software Craftmanship BootCamp in Brussels, has been rescheduled until the week of September 17th.
Being our first time in Brussels, we are hoping that pushing back the date will provide more people with an opportunity to convince their bosses that the course is a good investment!
I apologize for any inconvienience this may cause.
I am sorry to announce that next month’s .Net Software Craftmanship BootCamp in the UK, has been rescheduled until the week of September 10th.
Since we only come to the UK once a year, we are hoping that pushing back the date will provide more people with an opportunity to convince their bosses that the course is a good investment!
I apologize for any inconvienience this may cause.
Just added a new feature to fakes-rspec to handle a scenario I ran into. The following test will hopefully explain it:
Interrogating Multiple Argument Sets on the same ignored method - ignored.rb
12345678910111213141516171819202122
context"when expanding all of the items"dolet(:folder){"item"}let(:target){"blah"}let(:sources){[]}let(:args){:sources=>sources,:shell=>fake}#this syntax is incorrect, but the formatting was getting garbledsubject{Copy.new(target,args)}before(:each)do%w[1 2 3].each{|item|sources<<item}endbefore(:each)dosubject.expand_all_itemsendit"should copy each of the sources to the target"dosources.eachdo|source|item="cp -rf #{source}#{target}"shell.shouldhave_received(:run,item)endendend
The following line:
Verifying a Call - verify.rb
1
shell.shouldhave_received(:run,item)
I am testing to see whether the run method (which was never set up to get explicitly called), was actually called 3 different times, and am also verifying that each time it was called it was called with a specific set of arguments.
In the test above I am verifying that for each “source”, a call was made to do a recursive, forced copy, to the “target” location.
Not needing to specify the call while also being able to verify each of the argument sets on each of the 3 invocations of the same method is handy, and introduced solely so I could support this feature that I was working on.
This is a library to aid in the usage of fakes when using RSpec. It adds a bunch of convienience methods and matchers to aid in the usage of the heavily AAA style isolation library.
Installation
Installing - install.sh
1
gem install fakes-rspec
Or (preferably using bundler), in your gemfile:
Bundler - gemfile.rb
12
source"http://rubygems.org"gem'fakes-rspec'
When you install the gem it will install the rspec gem also, so you will immediately ready to go.
Usage
Creating a fake
Using a let block
Let Initialization - let.rb
123
describe"Some Feature"dolet(:my_fake){fake}end
Inline
Inline Initialization - inline.rb
12345
describe"Some Feature"doit"should be able to create a fake"doitem=fakeendend
Configuring a fake with return values for calls
Irrespective of arguments:
Faking Return Values Regardless Of Arguments - code.rb
1234567
it"should be able to setup a fakes return values"dothe_fake=fakefake.stub(:hello).and_return("World")fake.hello.should=="World"fake.hello("There").should=="World"end
Caring about arguments:
Faking Return Values With Specific Sets Of Arguments - specific_arguments.rb
1234567891011
it"should be able to setup a fakes return values"dothe_fake=fakefake.stub(:hello).with("There").and_return("World")fake.stub(:hello).with("You").and_return("Again")fake.stub(:hello).and_return("Does Not Matter")# when you use the catch_all, make sure that it is the last step used for a particular method (as above)fake.hello("There").should=="World"fake.hello("You").should=="Again"fake.hello.should=="Does Not Matter"end
Determining whether a call was made
One of the big strengths of this library compared to some of the other ruby isolation libraries is the ability to let you make assertions against the fake after the [subject] has run its code. The following examples demonstrate some typical usage scenarios:
Irrespective of arguments:
Verifying Call Made Ignoring Arguments - call_verify_ignoring_arguments.rb
123456
it"should be able to determine if a call was made on a fake"dothe_fake=fakefake.hello("World")fake.shouldhave_received(:hello)#trueend
With a specific set of arguments:
Verifying Calls Made With Specific Arguments - verifying_calls_made_with_specific_arguments.rb
1234567
it"should be able to determine if a call was made on a fake"dothe_fake=fakefake.hello("World")fake.shouldhave_received(:hello,"World")#truefake.shouldhave_received(:hello,"Other")#falseend
Remember, that because it is just a matcher, to negate the matcher you can use the should_not qualifier to do the opposite:
Determine whether a call was not made with a specific set of arguments:
Verifying A Call Was Not Made With A Specific Set Of Arguments - not_made_with_specific_arguments.rb
123456
it"should be able to determine if a call was not made on a fake"dothe_fake=fakefake.hello("World")fake.should_nothave_received(:hello,"Other")#trueend
Determining that a call was made a certain number of times
Irrespective of arguments:
Verifying Occurences Of A Call Ignoring Arguments - verifying_occurences_ignoring_arguments.rb
123456
it"should be able to determine if a call was made on a fake"dothe_fake=fakefake.hello("World")fake.shouldhave_received(:hello).once#trueend
Caring about arguments:
Verifying Occurences Of A Call Including Arguments - verifying_occurences_including_arguments.rb
1234567
it"should be able to determine if a call was made on a fake"dothe_fake=fakefake.hello("World")fake.shouldhave_received(:hello,"World").once#truefake.shouldhave_received(:hello,"Earth").once#falseend
Remember, that because it is just a matcher, to negate the matcher you can use the should_not qualifier to do the opposite:
Determine whether a call was not made a specific number of times with a specific set of arguments:
1234567
it"should be able to determine if a call was made on a fake"dothe_fake=fakefake.hello("World")fake.should_nothave_received(:hello,"World").twice#truefake.should_nothave_received(:hello).twice#trueend
After calling have_received, you can specify occurences using one of the following methods:
once
twice
at_least_once
at_least_twice
at_most_once
at_most_twice
at_least(times)
at_most(times)
exactly(times)
occurs(match_block) - Where match_block is a proc/lambda that matches the signature lambda{|number| bool}
An example of using the occurs method would be as follows:
Determine whether a call was not made between a certain number of times
Verifying Calls Using Occurs - occurs.rb
1234567
it"should be able to determine if a call was made on a fake"dothe_fake=fakefake.hello("World")fake.hello("Again")fake.shouldhave_received(:hello).occurs(lambda{|number|(1..3)===number})#trueend
Contributing
Feel free to fork this codebase and submit any pull requests you think would be useful.
In this quick video I show you how to use the purge command to quickly free up virtual memory on your machine.
Because I run a fair amount of vms on my machine, at any point in the day I can look at my memory usage and realize that I have almost no memory availabe.
For those that don’t want to watch the video (it’s only 2 minutes), I start the video having almost 6.81GB inactive and only 284.7GB available (and this is a 16GB machine.)
The long and short is I run the following command:
Free Up Your Memory - purge_memory.sh
1
purge
After the command finished running, I had only 138.6MB of inactive memory and 9.56GB of free memory!!
On Thurday my windows vm image died along with my backup of it!!
I thought this was a good opportunity to repave a brand new vm that I can also create linked clones from to quickly scaffold new vm’s moving forward.
This post is mostly to help me remember the install process and the base tools that I install on a fresh windows 7 vm, as this is not something I do very often!! I included screenshots of most of the install steps, just so I can both remind myself what my defaults are, as well as for your benefit if you wish to copy this setup.
Well that’s it for the base tool install!! There are a couple of other steps I do to configure msys and cygwin to play nice together, but that’s another post!! Outside of that, this is what constitutes my bare minimum for a usable windows vm. From this base image, I can create linked clones that allow me to create project specific vm’s that have further tools installed (such as vs, vs.net etc) specific to the contract/project I am working on.
Still To Come
In a follow up post I’ll detail a set of tools, scripts and code that allows me to configure this entire toolset, so that I can have a seamless environment that supports :
Vim with a host of my favourite plugins
An organized eaash environment with well partitioned dotfiles etc
Simple, plugin style automation tasks
Most importantly, the bash/vim/automation setup I have allows me to share all of the important scripts such as: