You are currently looking at an older section of the wincent.com website.
Please check the new version of the site at https://wincent.com/ for updated content.

wincent Wincent Colaiuta's weblog

« September 2007 | Archives index | November 2007 »

October 31, 2007

Switch to WOPublic check and assert macros (WOCommon, c9571fb)

Remove the old assertion macros defined in WOCommon and replace references to them with the new macros provided by WOPublic.

There is now a clear semantic distinction between assertions (debugging aids used only at development-time) and checks (always-enforced confirmations of expectations, present in both debug and release builds). Checks are used in unit tests and wherever a normal assertion would be inadequate (for example, when the assertion is used to uphold an API contract, but can't do so in release builds because it gets preprocessed away to nothing).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 9:20 PM

Additional notes about check macro usage (WOPublic, 0080b3d)

Add note recommending the use of check macros (rather than assertion macros) in unit tests.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 8:26 PM

Add WOPublic to project as folder reference (WOCommon, 153e314)

Add folder reference to WOPublic to make management through Xcode a little easier.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 8:19 PM

Add symlink to WOPublic tree (WOCommon, 9278332)

Some code has been moved from WOCommon into WOPublic; create a symlink so that we can start making use of the exported code.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 8:18 PM

Proof WO_BOOL macro against overflows (WOCommon, d03a5b0)

Use the double-negation trick to ensure that a real boolean value is obtained in the WO_BOOL macro; without this trick the supplied expression is evaluated and cast to BOOL, which may not produce the expected result for large values.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:13 PM

Ignore "index" directory (WOCommon, ae23fd8)

Xcode 3 stores the index inside the project root in a folder called "index"; add it to the ".gitignore" file so that it won't clutter up status listings.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:09 PM

Remove warning about ZeroLink (WOCommon, b65f362)

As ZeroLink is no longer present in Leopard, this warning is now redundant.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:08 PM

Updates for GC (WOCommon, ab457ab)

Update many classes to use Leopard's GC; retains and releases have been eliminated, and dealloc methods have been trimmed down (and replaced with finalize methods) or entirely eliminated.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:57 PM

Fix typo in WOLocaleFormatter class (WOCommon, 9c368a2)

Fix a minor (documentation) typo in the WOLocaleFormatter implementation file.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:55 PM

Modernize WOHost class (WOCommon, 1af0bde)

Move to GC and Objective-C 2.0 properties.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:54 PM

Reformat documentation comments for WOHost header (WOCommon, ae9d97e)

Update format to match rest of code base.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:54 PM

Header clean-up for WODraggableButtonCell class (WOCommon, 4a26658)

Reformat documentation comments and update date formats.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:53 PM

Modernize WODraggableButton class (WOCommon, 8bc3d56)

Switch to GC and Objective-C 2.0 properties.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:52 PM

Remove references to WOSingleton files (WOCommon, e71e374)

Now that all singleton classes implement their own singleton mechanisms the old references to the WOSingleton abstract class files are no longer necessary.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:51 PM

Update convenience macros for Leopard (WOCommon, 75b61e8)

The semantics of some macros have changed under GC and others are no longer required; this commit removes macros and updates others (and their documentation comments) where appropriate.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:50 PM

Add notes to WOProcessLauncher class (WOCommon, 366cbb0)

The retain-based model used by the WOProcessLauncher class won't work under GC, so add a warning as a reminder that it needs to be revised.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:49 PM

Update WORegistrationTextFieldCell for GC (WOCommon, 932eefb)

Changes for GC under Leopard: the move to GC here not only allows us to get rid of lots of retains and releases, but we can also dispose of the reference counting tricks that we needed in order to keep a single shared instance of the field editor.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:47 PM

Update unit tests for Garbage Collection (WOCommon, ba8ebeb)

Eliminate retain and release messages which are no longer necessary in a number of unit tests.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:44 PM

GC changes for WOBundle class (WOCommon, 6e2d71e)

Remove unnecessary retain and release calls for running under GC in Leopard.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:43 PM

GC changes to registration controller core category (WOCommon, db186a6)

Move to GC for Leopard.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:42 PM

GC changes for WOLicense core category (WOCommon, b2646df)

Changes for compatibility with GC under Leopard.

Posted 6:41 PM

GC changes for NSWindow dissolving category (WOCommon, e29d6b3)

Remove retain message that is now a no-up under GC.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:39 PM

Add TODO for NSCondition (WOCommon, fb068b5)

The new NSCondition API in Leopard could prove quite useful in cleaning up the code in the NSThread convenience category; add a TODO note as a reminder.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:38 PM

Mark code for review (WOCommon, de92bdc)

The NSThread convenience category needs to be reevaluated in the light of GC; the previous technique of passing pointers around inside NSNumber needs to be reconsidered.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:37 PM

GC changes for NSThread convenience category (WOCommon, 40d4f3f)

Basically just removing the release messages, using "drain" instead of "release" on autorelease pools, and relying on the "invalidate" method to remove the connection's ports from the run loop.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:18 PM

October 30, 2007

GC changes for NSString+WOEmailUtilities class (WOCommon, 6375f08)

With the changes in semantics of CF objects under GC in Leopard it makes more sense just to work at the CF level throughout the emailMessage:subject:to: method rather than casting to Cocoa objects.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 11:08 PM

GC changes for NSString+WOConversion category (WOCommon, 31c36b5)

With GC under Leopard, must use CFRelease rather than WO_RELEASE.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 11:02 PM

GC changes for NSFileManager+WOPathUtilities category (WOCommon, 0a2b28e)

Under GC and Leopard it no longer makes any sense to use the WO_RELEASE macro; use CFRelease instead.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 11:01 PM

GC changes for NSDictionary+WOCreation category (WOCommon, ca0232d)

In moving from referencing counting to GC for Leopard also fixed a tiny leak that could occur in the dictionaryWithKeysAndObjects: method in the event that an exception were thrown; in doing so we also avoid the expense of entering a @try block.

Posted 10:57 PM

Garbage collection for NSArrayController+WODragUtilities category (WOCommon, 235882a)

Switch to GC for Leopard.

Posted 10:55 PM

Garbage collection for CIImage+WOConvenience category (WOCommon, 35882a2)

Remove old reference-counting code (no longer needed under GC and Leopard).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 10:54 PM

Use public NSMethodSignature API (WOTest, 8ad52f7)

Use formerly private API, now exposed in Leopard.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 10:46 PM

Override ARCHFLAGS only temporarily (wikitext, 7b7504d)

When building on Darwin rather than setting an environment variable permanently just set it for the duration of the mkmf run.

I looked at jettisoning this override entirely but experimentation shows that the ANTLR runtime is not built with cross-compilatin in mind; this was later confirmed on the mailing list by the C runtime author.

So for now the override stays.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 10:41 PM

Fix Leopard GCC warnings (wikitext, cee8b13)

Minor tweak to silence new warnings introduced by the version of GCC that comes with Leopard.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:49 AM

Fix ANTLR installation procedure to allow repeated installs (wikitext, 281927e)

Allow repeated installs by explicitly removing previous installed versions first.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:48 AM

Tweak extension build for Leopard compatibility (wikitext, 7a51010)

These tweaks fix the build breakage under Leopard caused by the fact that the ANTLR runtime is non-Universal and Ruby is Universal. We set the ARCHFLAGS environment variable to force a non-Universal extension to be built.

In the future may actually produce a Universal version of the runtime, at which point will remove this somewhat kludgy hack.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:48 AM

Update Rakefile to really clean (wikitext, b5c0548)

Update the CLEAN definition to really get rid of the Makefile (and mkmf.log) when running the "clean" task.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:45 AM

October 28, 2007

Add Git repository maintenance script (snippets, 9aff981)

Add a script that is intended to be run once per month from a cron job, and which does a "git gc" on all repositories.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 9:58 PM

Remove TODO comment (snippets, e767e66)

Remove comment that should have been taken out with last commit; this feature was already implemented in 07007a0.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 8:43 PM

Use commit date when creating posts (snippets, 07007a0)

Previously the Git post-receive hook just created new posts as commits were received; now the hook extacts the author date (not the committer date) from each commit and uses that to set the creation date on the post.

This means that there will be a perceived delay between the commit date and the time it shows up on the activity log, but this accurately reflects the way in which commits are not actually published until somebody does a "git push". It also avoids the clumping together effect of the old system where a bunch of commits that took place over a period of time would appear to have happened all at once when pushed out.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 8:31 PM

Make "Xidius' Transparent Bar" the new default button set (Synergy, 74a242d)

This button set was especially designed for the new Leopard menu bar and looks considerably better than some of the older Tiger sets.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:01 PM

Make "Xidius' Transparent Bar" the new default button set (Synergy, 74a242d)

This button set was especially designed for the new Leopard menu bar and looks considerably better than some of the older Tiger sets.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:01 PM

Add Xidius' "transparent bar" set (Synergy, e9223f7)

Added to both the application and preference pane bundles.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:50 PM

Add Xidius' "transparent bar" set (Synergy, e9223f7)

Added to both the application and preference pane bundles.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:50 PM

Whitespace fixup for defaults property list (Synergy, 479580c)

Use tabs consistently (previously there were mixed hard tabs and soft tabs).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:46 PM

Whitespace fixup for defaults property list (Synergy, 479580c)

Use tabs consistently (previously there were mixed hard tabs and soft tabs).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:46 PM

Reduce default button spacing to 0 pixels (Synergy, b053a91)

The vast majority of button sets are designed with this in mind.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:40 PM

Reduce default button spacing to 0 pixels (Synergy, b053a91)

The vast majority of button sets are designed with this in mind.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:40 PM

October 24, 2007

Synergy r416, 16 items changed

Bump version number post-release

Posted 10:57 AM

Install r124, 1 item changed

Tagging Synergy 3.2 release.

Posted 10:55 AM

Synergy r415, 1 item changed

Tagging 3.2 release.

Posted 10:54 AM

Synergy r414, 1 item changed

Reduce default button spacing to 0 pixels; the vast majority of button sets are designed with this in mind

Posted 10:47 AM

Install r123, 1 item changed

Bump build settings for Synergy 3.2 release

Posted 10:42 AM

Synergy r413, 16 items changed

Correct version numbers

Posted 10:29 AM

Synergy r412, 4 items changed

Make "Xidius' Transparent Bar" the new default button set

Posted 10:27 AM

Synergy r411, 16 items changed

Bump version number prior to release

Posted 10:23 AM

October 22, 2007

Synergy r410, 16 items changed

Add Xidius' "transparent bar" set to application and preference pane bundles

Posted 9:13 PM

October 21, 2007

More application controller specs (wincent.com, 64cb423)

Specs to confirm that the setup_locale method is protected, and that the parameter logging filters have been correctly set-up.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:15 PM

Add application controller specs (wincent.com, f7ec927)

These specs are defined as shared behaviours, and so can be incorporated by reference in the specs of all application controller subclasses.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:04 PM

October 20, 2007

Refactor code from User model into Authentication module (wincent.com, f625239)

At the moment the authentication logic is spread across several sites: the User model, the ApplicationController (and by inheritance all its subclasses), and the Authentication module itself.

This commit tries to centralize as much of this code as possible inside the Authentication module with the goal of keeping the authentication code in one place. It is unavoidable that an authentication mechanism be involved with both controllers and models (and later views), but at least we can store the logic in a single file, clearly grouped using submodules (Authentication::Model, Authentication::Controller and so forth), and then incorporate it elsewhere using extend and include.

There still is quite a bit of explicit authentication logic in the user model itself (mostly validation and callback related), and I am not sure what to do about that. Although the idea of keeping authentication code bundled together in one place is superficially appealing, if taken to far it can actually make the code less readable. As such, the refactoring done in this commit is relatively conservative and I won't be taking it any further for the time-being.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 4:02 PM

October 19, 2007

Specs for session controller and tweaks to get them passing (wincent.com, 067ca6f)

The session controller is now fully specced; some tweaks were necessary in order to get all specs passing.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:53 PM

Make localization work in sessions controller (wincent.com, 56951c3)

Fix a few typos ("localize" for "localized") and add a "require" to get localization working in the sessions controller.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:51 PM

Add notes on UTF-32 support (wikitext, 2929556)

Add a link to a mailing list post by Jim Idle briefly outlining what would be required to implement a UTF-32 input stream, although I suspect his summary makes it sound less involved than it really may be.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:35 AM

October 18, 2007

Quieten migrations during specs (wincent.com, c287d8f)

One of my specs creates an in-memory SQLite database; prevent ActiveRecord from littering the spec output with progress and profile information by setting the verbose flag.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:50 PM

Add specs for internal link target encoding (wikitext, 914cd51)

Add specs, including comparisons against the behaviour of URI.escape in the standard library. Note that I do not bother testing for handling of invalid encodings here because that would just be duplicating the tests already done elsewhere (we are going through the encoding conversion machinery first, and that is already tested in other specs).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:35 PM

Cleanup conversion specs (wikitext, 374b278)

Cleanup conversion specs by splitting off the invalid coding samples into separate namespaces (UTF8::Invalid and UCS2::Invalid) and referring to them by constants.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:32 PM

Correct submodule usage in specs (wikitext, e37df19)

One group of specs was mislablled as pertaining to Wikitext::Parser when it in fact pertained to the Wikitext module itself.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:07 PM

Add URL encoding for internal target links (wikitext, b29f967)

Add machinery for converting strings into URL-encoded strings suitable for use as internal target links. Unreserved characters are passed through unchanged and all others are escaped using percent encoding; prior to escaping the string is first converted to UTF-8 (so that a string containing the euro symbol, for instance, will be encoded as "%e2%82%ac").

In order for the new functions to make use of the existing text-encoding conversion methods a few minor tweaks had to be made to the conversion functions (because in these cases the conversion is under controlled conditions the converted width is not important in some cases, and in others there is no need to free the target buffer in the event of an error because it is not dynamically allocated).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:06 PM

Factor conversion routines out into per-character functions (wikitext, c5ca963)

Extract two new functions, one for converting a single UCS-2 character into a (possibly multi-byte) UTF-8 representation, and another for performing the reverse operation.

This change will be useful when sanitizing internal link targets in the future; such link targets must be URL-encoded, which means converting them to UTF-8, performing the encoding, and then converting back into UCS-2 for merging into the output stream (whose working format is UCS-2). The functions can be used to efficiently convert on a per-character basis and thus avoid potentially expensive allocations of temporary strings; in fact the whole thing can be done in pure C this way without any Ruby message sends at all.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:55 PM

Flesh out accessor methods for the internal link prefix (wikitext, 17856f8)

Provide a write accessor which accepts an internal link prefix in UTF-8 encoding, stores it to an instance variable, and also stores a UCS-2 copy in a separate instance variable. The latter will be used during transformations while the former is the version that's visible to the caller via the API.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:07 PM

Tighten up module message sends (wikitext, 8cba11d)

Pass in the module rather than just using "self". Although passing self was harmless (because the conversion methods never references it), passing in the module is technically more correct.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:05 PM

Whitespace cleanup (wikitext, b40adde)

Remove a couple of blank lines.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:56 PM

Add specs for encoding methods (wikitext, 292af90)

Although the encoding conversion methods already receive extensive indirect testing (because they are indirectly exercised by all of the parsing specs) this commit adds specific specs so as to test all the possible failure paths when passed invalidly encoding inputs.

As a result of adding these specs I discovered one minor issue: that one of the failing code paths would never be exercised because it was effectively masked by another failing code path; so this commit also changes the order in which the paths in question are tested.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 4:38 AM

Add benchmark runner (wikitext, 9d5875b)

The benchmarks in benchmark.rb show that the custom internal implementation is between 3 and 5 times faster than the Iconv module.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:28 AM

Remove dependence on Iconv module (wikitext, dda7a33)

So as to depend on one less module, perform the UCS-2/UTF-8 conversion using a pair of custom methods written in C. The code would be easy to extend to handle UTF-32 when/if I move to it.

This change doesn't break any of the existing specs, but I'll be adding additional specs to specifically test the conversion methods and confirm that they appropriately reject invalid input (unlike the old wrapper functions these ones are public).

I also intend to add some benchmarks in a future commit to compare performance with the old implementation.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:56 AM

October 17, 2007

Use LEN macros for structure access (wikitext, bd7cbef)

Use macros to insulate against possible future changes in Ruby structures.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:32 PM

Additional dependency info for Rakefile (wikitext, 3fd78b8)

Rather than just firing off the Makefile from within the Rakefile, some basic dependency info is added so that Rake knows when to bother running "make" again.

The default task is the "all" task, which builds (only if necessary) and runs the specs. Note that because the actual building is delegated to make, and the Makefile has its own set of dependency information, the build will only perform as much as is necessary (for example, if the grammar file is touched then everything gets rebuilt; if only the wikitext.c file is touched then only that gets rebuilt and is relinked against the other object files).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 5:40 PM

Refactor for deployment using RubyGems (wikitext, 80ae725)

On thinking about the need for this to run on multiple platforms I decided that it wasn't really suited to being used as a Rails plug-in:

- Rails plugins are usually deployed by simply unpacking them into the "vendor/plugins" directory; given that this is actually a C extension this means that a second step is required (compilation)

- I looked at cross-compiling here locally before deploying the plugin but that seems awfully brittle with plenty of scope for breakage when one of the target systems is upgraded

- There is already a system designed to handle exactly this deployment problem: RubyGems

So even though I would prefer to have all of the dependencies of my Rails applications frozen into the "vendor" directory, it seems that deployment as a RubyGem is the most robust solution. I can still tie my application to a particular version of the gem by doing something like:

require 'rubygems' gem 'wikitext', '>= 1.1'

So this commit refactors the working tree to match the typical RubyGems pattern (ext, spec subdirectories). At the same time while preparing the gem specification I realized that the inconsistencies in the naming conventions were too ugly to bear, and so as part of the move I renamed many of the files and symbols (capitalization changes and omitting underscores).

As all of these changes have to be made in a single batch to keep the specs passing I am not splitting this up into a series of smaller commits.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:59 PM

Add a simple Rakefile (wikitext, 02d11e9)

This is a preliminary Rakefile that can be used to build the extension, run the specs, and wrap up the built extension in a skeletal Rails plugin.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:15 PM

Comment future changes (wikitext, b468471)

Populate the wiki_text.c file with comments indicating future planned changes.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:09 PM

October 16, 2007

Ignore built bundle on Linux (wikitext, caba3f0)

In addition to ignoring the Mac OS X ".bundle" file, ignore the built ".so" archive as well (for Linux).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 10:16 PM

Refactor script into build and install portions (wikitext, 015e869)

Now we have a build script (which builds the ANTLR tool and the C target runtime on Darwin, and only the runtime on Linux) and a separate install script (which installs tool and runtime on Darwin, and only the runtime on Linux).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 10:02 PM

Provide build script for ANTLR (wikitext, 282eee9)

Make the ANTLR build process less error prone by doing it all in a reproducible script which cleans, extracts the tar archives, applies the patches, works around the build bug, and builds both ANTLR itself and the C target runtime.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 9:22 PM

Eliminate SCM noise by changing ANTLR template (wikitext, 39d1565)

I've just made a tweak to the ANTLR 3.0.1 C target code generation template to prevent it from producing SCM noise by embedding build dates inside the generated files; this information properly belongs outside of the files, in the modification-date metadata. The truly important information (the version of ANTLR used to perform the build, the source file name and so on) is preserved.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:38 PM

Makefile cleanup and corrections (wikitext, f2254e1)

The makefile now correctly handles dependencies in an optimal way (the previous version sometimes re-compiled too much or too little). Now touching any of the dependent files will trigger an appropriate ANTLR run (if needed), and/or re-compilation or re-linking of only the necessary files.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:29 PM

Keep known-good ANTLR version in repository (wikitext, 85a0852)

I've had a fair bit of trouble getting things back up and running with the move to ANTLR 3.0.1, so I'm going to store a known-good version of ANTLR (source archive plus patches) in the repository. This may be paranoid but I don't won't to get caught out in the future.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 4:24 PM

Fix typo in defined test (wikitext, 4494181)

Was testing for "define" instead of "defined", breaking the test. GCC on Mac OS X didn't report any warnings for this, but I GCC on RHEL 3 did.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:56 PM

Store generate files in repository (wikitext, 402251b)

Given the fragility of the ANTLR build chain (upgrading from my working 3.0-with-bugfixes copy to 3.0.1-which-also-needed-bugfixes version proved to be quite timeconsuming and error-prone) I'm adding the ANTLR-generated lexer files to the repository to guard against possible future problems. That is, even if I have problems building a working future version of ANTLR and can't re-generate the lexer, at least I'll have a copy on hand of a prior working version in the repository.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:47 PM

Adapt to changes in ANTLR 3.0.1 C runtime (wikitext, eda9b8d)

In version 3.0 of the ANTLR runtime the "start" field in the ANTLR3_COMMON_TOKEN_struct was a character index (the number of characters, not bytes, relative to the start of the input stream). Likewise for the "stop" field.

In version 3.0.1 the "start" field is now an absolute pointer, as is the "stop" field.

One caveat: one thing which appears to be a bug is that the "stop" field does not point to the end of the token, but rather to one byte before it. I suspect that this bug is latent when working with ASCII streams, but it is a problem when working with UCS-2 streams (where each character is 2 byte) because this means that the "stop" field now points to the second half of a character, which is invalid. This commit adjusts the stop field up by 1 byte to compensate.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:26 PM

Fix invisible character (wikitext, 4c107f0)

Remove invisible non-ASCII character in wiki_text.c source file.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:12 AM

October 15, 2007

Initial import (wikitext, db2cb81)

Extracting the wikitext module that was previously in the WOCommon repository.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 11:24 PM

Correct error in User spec (wincent.com, d55c2c6)

Should have been using delete_all, not delete(:all); the delete method expects as a parameter the id of the row to be deleted.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 11:08 PM

Whitespace fix (wincent.com, df00cf2)

Whitespace fix in Tagging migration.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 9:19 PM

Add notes to Taggable spec (wincent.com, 7d06fda)

Add extraction notes to the specs for the Taggable module.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 9:17 PM

Add specs for and fix bugs in Taggable module (wincent.com, 719595d)

This commit adds specs for the three public methods of the Taggable module, corrects a couple of minor bugs discovered during testing (unexpected behaviour of the split method, and typo in a variable name), as well as setting up a destroy trigger for taggings which should go away when a parent record is deleted.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 9:14 PM

Refactoring (directory organization) for acts_as_taggable (wincent.com, 36d2f80)

Switched over a number of model classes to use acts_as_taggable and re-organized some of the subfolders to make the inclusion a little neater (requiring "active_record/acts/taggable" rather than "taggable").

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 8:07 PM

Set up Taggable as "acts_as_taggable" (wincent.com, 5604977)

Following Rails conventions wrap the Taggable module up inside an ActiveRecord mix-in. This allows models to make use of it by doing an "acts_as_taggable".

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:50 PM

Add Taggable module (wincent.com, 003f9f3)

Add a very simple Taggable module designed for use with model classes. The public interface consists of "tag" and "untag" methods (for adding and removing tags) and a "tag_names" method (for getting an array of tag names that apply to a model instance).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:26 PM

Make sure tags only get applied once (wincent.com, 3342585)

Use database-level constraints to ensure that tags only get applied once to any given model instance. Application-level constraints are not appropriate because they're vulnerable to race conditions (due to the window between checking if a tag is already applied and trying to apply it).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 7:24 PM

Whitespace fix (wincent.com, bfa88e8)

Eliminate superfluous spaces.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:05 PM

Add Article and Revision models (wincent.com, 884af44)

These models will be the basis for the wiki functionality. Note that there will be no non-wiki "page" functionality; instead of setting up a separate Page model you may as well just use Articles and benefit from the versioning you get with the wiki workflow.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:19 PM

Add stories subdirectory (wincent.com, 521539e)

Add base files provided by RSpec.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:37 AM

Set up ignores in test subdirectory (wincent.com, 0169c6c)

Set up a gitignore file to ignore everything inside the test subdirectory.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:36 AM

Update script/spec (wincent.com, 57f43c1)

Yet another file which should have been updated as part of the move to the RSpec trunk (b8c4b59).

Posted 3:34 AM

Turn on ActiveRecord session store (wincent.com, 405881e)

For better peformance, and to tie in with the session controller that provides RESTful login and logout.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:33 AM

Add skeletal models (wincent.com, a50b4bc)

Adds basic models and controllers with some skeletal details already in place -- comments, emails, issues, statuses, taggings, tags -- and some other largely empty files (helpers not included in the last commit, spec templates) and migrations.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:32 AM

Pretty formatting for creation/update timestamps (wincent.com, fba09f2)

Add a method to the application helper for human-friendly display of timestamps.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:28 AM

Add sessions (wincent.com, 0d0f571)

Add a sessions controller and helper; no model is required and the truth is that even the helper may prove to be unnecessary in the long run. This commit also includes a migration and modifications to the routes.rb file to direct the "login" and "logout" URLs to the appropriate actions in the sessions controller.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:27 AM

Add user model (wincent.com, d9a50e5)

Add a user model, controller and helper, along with specs, the supporting authentication library (lib/authentication.rb) and an initial migration.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:24 AM

Add localization support (wincent.com, 342183f)

This commit adds a Locale class, a Translation class, and corresponding controllers and migrations. It also modifies the application controller so as to set up the locale if possible using a before_filter. The actual utility methods on the String class are added in lib/string_additions.rb.

This is only a partial implementation, not a full localization stack. Later on may add special support for localized model attributes and possibly other things if the need arises.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:22 AM

Add "distance in words" capability to Time class (wincent.com, 471fe24)

And accompanying specs. This commit actually depends on the localization facilities, which will be checked in in a subsequent commit.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:17 AM

spec_server update (wincent.com, f7ea090)

Minor update to the script/spec_server script; this should have actually been included in the move to the RSpec trunk (b8c4b59).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:14 AM

Prepare spec helper (wincent.com, edf298e)

Include FixtureReplacement from within the spec helper, add a custom matcher class for conveniently verifying validations, and remove excess comments.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:13 AM

October 14, 2007

Add custom db rake tasks (wincent.com, 62dd8af)

Convenience tasks for migrating and resetting the databases under each environment, or all environments at once.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:47 PM

Speed-up FixtureReplacement (wincent.com, 6c036a7)

Call send() directly rather than update_attribute(), thus avoiding a potentially expensive save() operation on each attribute.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:09 PM

Teach FixtureReplacement to avoid mass assignment (wincent.com, 80cf713)

FixtureReplacement uses mass assignment under the hood to create new object instances and this can cause exceptions if any of the assigned attributes are protected. Given that the idea of FixtureReplacement is to quickly and easily set up valid objects (or object graphs) it makes sense to avoid these exceptions and allow all attributes to be specified in the example_data.rb file whether they are protected or not.

This patch makes FixtureReplacement use update_attribute to set the attributes one by one and thus avoid the mass assignment and the possibility of exceptions. A copy has also been sent to Scott Taylor (the author of FixtureReplacement).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:02 PM

October 12, 2007

Switch to RSpec trunk (wincent.com, b8c4b59)

Moving to RSpec trunk (currently at revision 2717) because the latest release (1.0.8) doesn't work with the Rails 2.0 preview.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:50 PM

October 11, 2007

Update to Rails 2.0 preview (1.2.4.7499) (wincent.com, 4eddb40)

This update includes a frozen version of the Rails 2.0 preview as well as updated notes in the application README file.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 4:54 PM

October 5, 2007

Fix capitalization in notes (wincent.com, 705b088)

Properly capitalize RSpec in the installation notes.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:46 PM

Bootstrap FixtureReplacement (wincent.com, 0dfd797)

Set up FixtureReplacement and note how to do so in the documentation.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:46 PM

Tell Rails to use UTF-8 in the database (wincent.com, 4aba1f8)

Update the configuration to reflect the encoding used in the databases.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:41 PM

Ignore logs and temporary files (wincent.com, 322b6f1)

Set up .gitignore files in the log and tmp subdirectories, and remove empty log files that were previously added.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:37 PM

Describe steps for setting up database (wincent.com, 7208f45)

Instructions for setting up local development and test databases (passwordless access to a local MySQL instance). Once the database is up and running "rake spec" can be run without failures.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:25 PM

Bootstrap RSpec (wincent.com, 18f33b5)

Prepare the application by running "script/generate rspec", and advise Git to ignore the "previous_failures.txt" file.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:13 PM

Add Haml plugin (wincent.com, 3cf854a)

Note that HTTP access to hamptoncatlin.com and subdomains (including svn.hamptoncatlin.com) was down so I exported using the SVN protocol.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:06 PM

Indentation in application README (wincent.com, b8b1d12)

For better readability, indent commands by 2 spaces.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:27 PM

Install FixtureReplacement plug-in (wincent.com, 07fe43b)

This is FixtureReplacement with Subversion revision 31.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:22 PM

Install RSpec plugins (wincent.com, cd983c8)

Install RSpec 1.0.8.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:19 PM

Initialize with new Rails application (wincent.com, 94617f2)

Starting point is a freshly-created Rails 1.2.4 application, with Rails itself frozen into the vendor subdirectory.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:06 PM

October 3, 2007

Add note about use of /dev/random (WOCommon, 13b9765)

Reading too many bits from /dev/random may constitute an abuse of a scarce resource, and the read() call may block if there is not enough random data anyway. Ideally in this case we should only read enough to seed another (psuedo-random) generator.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:48 PM

October 2, 2007

Add WOCheck and WOCCheck macros (WOPublic, e9bfc2b)

WOCheck is to NSAssert as WOParameterCheck is to NSParameterAssert, and WOCCheck is to NSCAssert as WOCParameterCheck is to NSCParameterAssert. In other words, these are like assertion macros but they are compiled in to both Release and Debug builds. You use them where throwing an exception is not merely helpful to your testing process but is actually necessary to uphold your API contract.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 6:35 PM

Define macro for "/dev/null" (gdiff, 799c018)

Reduce the likelihood of typing errors by defining a symbolic macro for "/dev/null", which has special meaning in Git. If this ever changes in Git the macro can be modified and gdiff should continue to work.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 2:35 PM

Make file source list table column uneditable (gdiff, d14e56b)

This is for display purposes only, not editing.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:20 PM

Draw top and bottom borders in file source list (gdiff, 094f018)

This is a preliminary attempt at drawing top and bottom borders in the file source list. Some visual glitches may be visible near the bottom border if the window is rapidly resized; the cause of these will need to be investigated. Also, given that the borders are being drawn just inside the view it is possible that they could overlap content inside the view; it may be necessary to find a way to somehow inset the content or instead perform the drawing elsewhere (the split view itself may be a good candidate for this as it would localize all top and bottom border drawing to a single place in the code).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:17 PM

Fix drawing glitches in source list (gdiff, b001fe1)

The cause of the drawing glitches was a missing super call in the drawRect: method in the subclass template. Not only are the glitches fixed but the background color now draws as well.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:08 PM

Use source list selection highlighting (gdiff, d107dbe)

Use the new NSTableViewSelectionHighlightStyleSourceList selection highlighting in the files outline view.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:04 PM

Add source list (gdiff, f6aa0a3)

Add a source list for showing files included in a patch. This is a (currently NSOutlineView subclass); note that in swapping out NSOutlineView for the subclass there are serious drawing glitches of the focus ring. A fairly typical pattern in AppKit (empty subclass behaves radically different to superclass) but hopefully won't be too painful to troubleshoot.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:57 PM

Install r122, 1 item changed

Tag Synergy 3.1.5 release

Posted 3:35 AM

Install r121, 1 item changed

Update project file for Synergy 3.1.5 release

Posted 3:34 AM

Synergy r409, 16 items changed

Bump version numbers post-release

Posted 3:32 AM

Synergy r408, 1 item changed

Tagging 3.1.5 release.

Posted 3:28 AM

Synergy r407, 16 items changed

Bump version number prior to release

Posted 3:27 AM

Switch to NSTextView and prepopulate with test data (gdiff, a0c959b)

Now WOFileView is an NSTextView subclass rather than just a direct NSView subclass. This required extensive fiddling in order to get the desired auto-resizing and wrapping behavior. To show that it works the views are prepopulated with the sample data.

There are still some rough edges and other things to take care of, namely: the horizontal scroll bars don't appear until the window size is manipulated, and; text is drawn aliased (would prefer unaliased text in this case).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:53 AM

Show placeholder line number in WOGutterView (gdiff, 0c87a5b)

Strictly for testing purposes, draw a single line number into the gutter view column.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:45 AM

Change scroll view nesting (gdiff, 106eb63)

Instead of putting the gutter views and file views inside a scroll view put only the file views inside; this change is apparently necessary because otherwise I can't get the autoresizing behaviour and auto-showing/hiding of the horizontal scroll bar to work.

I am not sure whether this is a limitation of the Cocoa text system or there is some kind of magic incantation that would have enabled it to work the other way, but without access to the source code it seems doubtful that it would be worth the effort of trying to figure out what's going on in the bowels of AppKit.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:44 AM

October 1, 2007

Fix inappropriate 1-pixel inset inside grouping views (gdiff, 6c01eb2)

Fix alignment bug introduced along with the addition of upper and lower borders. Only the outermost subviews need to be inset by one pixel; additional subviews nested inside the outermost subviews automatically inherit that base positioning and therefore shouldn't specify an additional inset.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 9:20 PM

Teach WODiffView to draw top and bottom borders (gdiff, dc4575c)

WODiffView now draws 1-pixel-wide light gray borders at the top and bottom of its bounds.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 8:44 PM

Teach glue view to draw borders (gdiff, 63cfac2)

The WOGlueView class now also draws light gray separator borders (1 pixel thick) on the left and right.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:58 PM

Avoid unnecessary re-setting of color (gdiff, 924a2d6)

If left border was already drawn, no need to re-set the border color again before drawing the right border.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:51 PM

Move WO_BORDER_WIDTH macro into global header (gdiff, 8cfdf80)

Make WO_BORDER_WIDTH macro globally accessible so that it can be used by both WOGutterView and WOGlueView. Also clarify Doxygen comments about the unit of measurement used when specifying dimensions.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:46 PM

Conditionalize border drawing (gdiff, a994690)

Only attempt drawing if the border's rectangle intersects with the visible area.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:44 PM

Draw borders in gutter views (gdiff, eff8c91)

Equip WOGutterView with border-drawing code and set up the left gutter view to draw a border on the right and the right gutter view to draw a border on the left.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:39 PM

Move test setup code into windowControllerDidLoadNib (gdiff, 039b748)

In order to do some additional set-up for the test code, move it into the windowControllerDidLoadNib: method (which is called after the nib is already set up and the WODiffView has been initialized).

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:13 PM

Add file property to WODiffView (gdiff, 1ebf57f)

Let WODiffView have a reference to its represented file object.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:11 PM

Add files property to WODiff (gdiff, 1bd48d5)

Expose the WODiff object's files array to outside world.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 3:02 PM

Split WOFileView into superclass with two subclasses (gdiff, 01d3ea9)

WOFileView is now a superclass of two new subclasses, WOFromFileView and WOToFileView. Almost all of the behaviour will be in the superclass with minor overrides in the subclasses. Basically the only difference in behaviour is which part of the represented WOFile object the subclass represents.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 12:22 PM

Add stepper to document window (gdiff, 466ab7f)

Add placeholder stepper and text to the document window. This will later be used to step through changes within a file (option-click will allow you to cross file boundaries if you wish) while showing status text of the form, "Showing change %d of %d (%s)" (two numbers and a change-type string such as "insertion", "deletion" or "edit").

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:57 AM

Use WOParameterCheck (gdiff, efffc30)

Add reference WOPublic and swap out instances of NSParameterAssert for WOParameterCheck where necessary to guarantee fulfilment of the API contract.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:51 AM

Total rewrite of assertion and check macros (WOPublic, 7a0c0be)

Make a really clear distinction between "assertions" and "checks". The former are debugging tools that don't even make it into Release builds and the latter are identical except that they appear in both Debug and Release builds; you use "checks" rather than "assertions" where performing the check is necessary for the fulfilment of your API contract (for example, when checking parameters for conformance with the documented API).

At the same time I got rid of the bascically unused WORequire and WO_DEBUG_ONLY macros.

Signed-off-by: Wincent Colaiuta <win@wincent.com>

Posted 1:18 AM