07
Apr 08

RailsCasts.com 100th episode!

Posted by Floyd Price

As many of you will know Code Spaces is a Ruby On Rails application and like many of you guys we love Ruby and in particular Ruby on Rails :-)

Most Rails fans will be aware of Ryan Bates and the RailsCasts.com weekly free Rails screen cast, for those who are not aware of Ryan’s work, he has been recording screen casts for the rails community since March 2005 and has covered pretty much every topic you can imagine from simple form helper tips to advanced debugging and performance tips.

RailsCasts.com have this week reached 100 episodes which I’m sure you will agree is an impressive contribution to the Rails community and demonstrates an enormous amount of dedication on Ryan’s part.

Code Spaces would like to thank Ryan for this contribution and wish him every success with the next 100 episodes ;-)

To mark this fantastic milestone Ryan has set up a simple contest where anyone who contributes 5 Rails tips back to the community via a blog or the Rails Forum can win a whole bunch of excellent prizes, some of which including an IPod Touch are donated by Code Spaces which is our very small way of saying thanks to Ryan for this contribution to the Rails community.

For further details about this contest and for a complete list of prizes visit the Rails Casts contest page


28
Mar 08

Code Spaces V2.0 – delays and excuses!

Posted by Floyd Price

First off, please accept our apologies for the delays with version 2.0, its really frustrating for all concerned especially us!

Excuses!

v2.0 is proving much more difficult to roll out than we ever though, so much so that we have decided to employ the services of an expert who will help us write some scripts to automate a lot of the problematic operations.

What does this mean for the release date?

As we are already nearly a month late, it seems a little inappropriate to make further promises about release dates, therefor we are going to aim to do the release in several steps, each step will include a piece of the v2.0 puzzle until the release is complete.

It will take some development effort to split the release up like this however i would expect to see that done this week, after that we will aim for 3 individual releases over 3 weekend with the final one representing a complete install of v2.0. Based on this we are looking at an end of april release.

I will keep you informed via this blog about our progress.


10
Mar 08

Code Spaces v2.0 – New Release Date

Posted by Floyd Price

The Code Spaces version 2.0 release has been delayed again for two reasons:

  1. Floyd 3.0 arrived on Sunday morning!
  2. Upgrading our MySql configuration to include a cluster of database servers, isn’t working as expected, We will be getting some support from mysql next week.

I/we can only apologies for the delay, as I know many of you are keen to use the new features.

The new release date is Sunday 23nd March 2008 (about 2 weeks), this gives us two weeks of database upgrade testing, and a free weekend to do some work on the production environment in preparation for the release.


03
Mar 08

Code Spaces v2.0 – Slight Delay!

Posted by Floyd Price

Code Spaces v2.0 was scheduled to be promoted to the production environment over the weekend however a few technical difficulties caused us to miss the time slot we have planned for.

As a result we had to roll back the deployment and will be rearranging the deployment for next weekend.

I will post further details on this blog, closer to the weekend.


08
Feb 08

Code Spaces v2.0

Posted by Floyd Price

For the last 3 months we have been working on a major update to Code Spaces and as we are now getting to the end of the development phase, I though I would share with you some of the features that will be included in the new Version.

Document Module

This is a basic document management module that allows you to store documents outside of your Subversion Repositories which can be linked to Work Items, Wiki pages or forums. The idea is that you can store specs and requirement documents here and link them to particular work items. These documents can also be marked as public which means they can be accessed by non Code Spaces user via the project portal.

Project Portal

Each Project can have a Project Portal which is a public facing view of your project.
Elements of your project like Work Items, Wiki Pages, Subversion Repositories, Forum Threads and Documents can be marked as marked as public adding them to your project portal.
Your customers and users can access the project portal at any time to raise issues, download files, Participate in the Forums, etc…
The project portal look and feel can be changed by selecting on of the many themes.
Project Portals are optional and can be switched off for any project that does not require public access.

Email Notifications

Code Spaces already exposes notificatoins through RSS, however each user now has the option to recieve notifications via Email.

Twitter Notifications

Each project can send notifications like Subversion Commits, Work Item status changes, Milestone completion/creation, etc to a desigbated Twitter account.

Project Email Addresses

Each project now has an email address which you can use to send messages into the project, messages recieved via this address will be turned into work items. Project Admins can specifiy white lists to avoid spam.

Anonymous Subverison Access

Each Subversion repository can be set to allow anonymous read access enabling you to give out a repository url to your customers or colleagues.

Fragment Caching

Code Spaces heavily uses fragment caching to speed up page requests, Dashboard and Work Item pages are now on average 20x faster, other pages also show impressive improvements.

Bug Fixes

All know issues have been resolved.

RELEASE DATE We are planning to release v2.0 into the production environment at the end of this month (Feb 2008).

NOTE This version was origionally scheduled to be released as v1.1 but due to the amount of new features in this release we have decided to jump to v2.0

UPGRADES All customer will recieve this version for FREE and will get access to ALL the new features, except for FREE users who will not get the Project Portal functoinality.

STAND ALONE VERSION The Code Spaces Stand Alone version (currently not released) will be based on the v2.0 code base, and is scheduled for a Beta release in March-April 2008.


07
Feb 08

Connecting to Subversion via a WebDav client.

Posted by Floyd Price

Subversion has a number of very good clients, but sometimes you need to give non Geek staff access to your repositories, this usually presents a problem as the inner workings of subversion are hard to grasp if your not tech savvy.

Fortunately subversion (when exposed via Apache) partially implements a DeltaV server and exposes just enough to allow a standard WebDav client to connect, add, rename and delete files or folders. You do however need to explicitly enable this in order for it to work.

In your Apache http.conf you will have a location tag that exposes your repository to the out side world (something like this) :


  DAV svn
  SVNPath /path/to/repository
 

To enable WebDav client support add the following:


  DAV svn
  SVNPath /path/to/repository

  #Enable WebDav client access for my marketing department.
  SVNAutoversioning on
  ModMimeUsePathInfo on

All modern Operating Systems allow you to mount a WebDav folder as a drive or folder:

Mounting a WebDav folder in Windows XP

Open the special folder called “My Network Places”, then click on “Add a network place” and fill in the URL of your repository url (like “http://svn.codespaces.com/account/repos”)

Mounting a WebDav folder in OS X

From the finder Go menu, connect to server and supply the repository URL (like “http://svn.codespaces.com/account/repos”)

Mounting a WebDav folder in Linux

You already know how to do this right?

Once the folder (or drive) is mounted you can use it as if it was a normal folder on you hard disk.

NOTE
When adding files or folders to a Repository via WebDav each transaction is a least one commit in the SVN repository and adding a file is two commits (one to add the file, and one to add the file data), so adding 100 files will increment your repository revision by 200! This is also very ineeficient as it has to upload 1 file at a time.

Apart form the limitation and inefficiencies noted above this is a really useful way of granting access to your repositories to non IT users, for instance we have a repository for our marking materials which is simply mounted as a folder (in OS X) or as a drive (in XP) allowing everyone working on a project to simply save images, pdf, etc into the repos without having to update and commit from within a Subversion client.

Code Spaces
If your using Code Spaces for your Subversion Hosting (and why wouldn’t you!!!) we can enable WebDav client access for you (it’s not on by default), simply send a mail to support[at]codespaces.com with your repository URL and we will enable it ASAP.


05
Feb 08

Apple and Microsoft can work together!

Posted by Floyd Price

(Click on the image to see)


05
Feb 08

Streaming Files to the Browser with Ruby on rails

Posted by Floyd Price

Quite often when building a web application you need to store and send Documents, with ruby on rails, streaming files from your application to the browser is simple.


def download_file
    @document = Document.find(params[:id])
    # this is where the magic happens...
    send_file @document.file_location
end

This single line of code will stream a file from your servers filesystem directly to your browser.

The simple use described above is often enough but you have even further control over the file with the following options:

Options:

  • :filename – suggests a filename for the browser to use.
    Defaults to File.basename(path).
  • :type – specifies an HTTP content type.
    Defaults to ‘application/octet-stream’.
  • :disposition – specifies whether the file will be shown inline or downloaded.
    Valid values are ‘inline’ and ‘attachment’ (default).
  • :stream – whether to send the file to the user agent as it is read (true)
    or to read the entire file before sending (false). Defaults to true.
  • :buffer_size – specifies size (in bytes) of the buffer used to stream the file.
    Defaults to 4096.
  • :status – specifies the status code to send with the response. Defaults to ‘200 OK’.
  • :url_based_filename – set to true if you want the browser guess the filename from
    the URL, which is necessary for i18n filenames on certain browsers
    (setting :filename overrides this option).

Pay particular notice to the :disposition option, changing this from its default to ‘inline’ will enable you to display the contents of the file in the browser window rather than downloading it as an attachment.

def download_file
    @document = Document.find(params[:id])
    # this is where the magic happens (inline)...
    send_file @document.file_location, :disposition => "inline"
end

This is especially useful for things like word or excel documents when you know you target audience can read these in the browser.

EDGE RAILS

If you are brave enough to live on the Edge with Edge Rails you will get an extra treat for free, on Edge Rails the send_file method passes the correct information to your balancing server to allow it to stream the file rather than blocking your mongrel server.


01
Feb 08

Import an existing Subversion repository

Posted by Floyd Price

To upload the history of an existing Subversion repository, use the svnsync tool that ships with Subversion 1.4. Run svnsync help to see the help for this tool.

Note that your Code Spaces Subversion repository must be at revision 0 to perforn a sync operation, so create a new repository if you need to.

Here’s a sample transcript that demonstrates how you can import the history from an existing repository (located at file:///c:/path/to/localrepos) to your repository on Code Spaces:

Windows:

C:\> svnsync init --username YOURUSERNAME https://svn.codespaces.com/YOURACCOUNT/YOURREPOSITORY file:///c:/path/to/localrepos
Copied properties for revision 0.
C:\> svnsync sync --username YOURUSERNAME https://svn.codespaces.com/YOURACCOUNT/YOURREPOSITORY
Committed revision 1.
Copied properties for revision 1.
Committed revision 2.
Copied properties for revision 2.
[...]

OSX or Linux:

$ svnsync init --username YOURUSERNAME https://svn.codespaces.com/YOURACCOUNT/YOURREPOSITORY file:///path/to/localrepos
Copied properties for revision 0.
$ svnsync sync --username YOURUSERNAME https://svn.codespaces.com/YOURACCOUNT/YOURREPOSITORY
Committed revision 1.
Copied properties for revision 1.
Committed revision 2.
Copied properties for revision 2.
[...]

When prompted for your password, use your Code Spaces password.

Running svnsync on a large repository will take a significant amount of time. If you are disconnected during the process, you may see the error message “svnsync: Couldn’t get lock on destination repos after 10 attempts”. If this happens, you can remove the lock yourself, see the “Locks” section of svnsync.txt.


01
Feb 08

The Great Blogger Giveaway!

Posted by Floyd Price

For the month of February we are running a promotion where you can get $49 of Code Spaces plan time for FREE.

All we require from you is that you write a small entry on your Blog or website about Code Spaces and link back to us.

This offer is open to new or existing customers and the $49 can be applied to any Plan type you like.

To make use of this offer, please send a link to your blog or website that contains the short piece about Code Spaces to blogoffer[at]codespaces[dot]com and we will do the rest ;-)