Politics, Programming and Possibilities
27 Feb
For anyone not following the discussion on the rails dev mailing list, you’ll need to upgrade to Rake 0.7.0 to use any of the standard ‘rake’ commands from now on. An error message that you might get without upgrading, for example, would be:
[duane@mail1 socialconference]$ rake -T
(in /home/www/socialconference)
rake aborted!
undefined method `namespace’ for main:Object
./Rakefile:10
So go on and ’sudo gem update rake’ or whatever it is you do to upgrade your gems under your environment and get those namespaces in to rake!
27 Feb
I meant to include Sami Samhuri’s Snippets and Macros in the last release—and, unfortunately, did so in a half-baked manner. In this release, the snippets and macros are all there, and they sure are cool! Thanks, Sami.
Some people asked about the enter key that was bound to the Intelligent Go To File command. Please note that the enter key will no longer be bound to this command by default. See my earlier post for more information on why this key was split in to two commands. Use ⌘⌥↓, bound to the “Go To File” command and ⌘⌥↑, bound to the “Go To File on Current Line” command instead. I’ve included the older (combined) Intelligent Go To File command in the library, but this time I’ve not bound it to any keys.
As usual, please let me know if you find anything amiss.
26 Feb
My friends on IRC have helped me track down and understand better the way TextMate helps its bundles by setting up the environment for Ruby code. The Rails bundle now uses the TM_RUBY environment variable to determine which ruby on your system to use (i.e. if you have multiple ruby shell commands installed).
One of the biggest problems with this environment stuff has been trying to figure out the best way to support all of the many ways you can get Ruby on your system: the built-in version patched with fixrbconfig, DarwinPorts, your own version, or perhaps even Locomotive’s ruby-in-a-box. For those of you who’ve been experiencing problems with past versions of the Rails bundle, I think this one may fix it for you. If you’re still having problems, try adding a TM_RUBY environment variable to your TextMate shell variables (in Preferences, go to Advanced, then Shell Variables). Point TM_RUBY to the location you installed ruby at.
As usual, please feel free to contact me and we can try to work out a solution if you’re still having trouble. Comments showing your problems or solutions are also welcome.
26 Feb
Looks like RC1 didn’t get some of the updated textmate_footnotes plugin code. This release candidate includes the newest testmate_footnotes, and also attempts to fix some issues people have been experiencing with ‘command not found’ and other PATH-related problems. Let me know if we’re getting any closer for those of you having these issues.
UPDATE: Looks like I’m still learning a few things. The folks on IRC tell me that adding the .profile is a very bad thing, so I’m going to have to try to solve this in another way. Download and try if you’d like, but wait for another release if you’re paranoid
25 Feb
After talking with my partner, Greg Narain, as well as Allan Odgaard, the creator of TextMate, we (syncPEOPLE) have decided to release our Rails bundle under the MIT license so that it can nest itself nicely within its new home, the TextMate Subversion Bundle Repository. If you have subversion set up with TextMate, update your bundles and you’ll get it all.
What this means for the rest of us is that all of these great features we’ve been madly developing are going to be available as the default Rails bundle when the next version of TextMate is released. Thanks to all who’ve contributed to this work already. Keep it up!
There are some major key binding changes in this release, due to my own slow but steady understanding of TextMate conventions and the evolving complexity of making this intuitive. Bundle keys are normally bound to the ctrl-shift combination, not the command-option combination. Therefore, in following with this convention, the new bundle uses the following bindings for its commands:
The Enhanced TODO List has been moved to the TODO bundle itself, so everyone (Rails and non-Rails folks alike) will benefit from it. It will be updated soon.
In order to create the “Show Go To File Choices” command and its list of choices, I created some new language scoping rules in TextMate that may prove interesting in the future. Basically, there are 6 new scopes available for Rails bundle creators to play with:
What this amounts to is that you can bind certain snippets, commands or macros to specific scopes within the rails project. For example, suppose you want to create a macro that adds scaffolding code to your controller. With the new scopes, you can bind your command to meta.rails.controller and rest assured that you won’t accidentally add scaffold actions to your model. In addition, this new scoping allows you to bind multiple commands with the same key binding to a single scope to create a pop-up menu with choices. Try ⌘⌥⇧↓ to see this latter benefit in action.
After some discussion, we (Allan and I) decided to remove the keypad enter binding and replace it with the ⌘⌥↓ key combination. There were a number of reasons for doing this:
With that said, however, there’s certainly nothing stopping you from re-binding the enter key to your Rails bundle. If it works for you that way, great!
I’ve put a lot of work in to making this release a much more robust, refactored release. There are some really handy classes that have been created just for TextMate (included in the bundle) that I’d like to mention for the benefit of other bundle makers:
If you don’t use the subversion repository, download the new Rails bundle as a Disk Image here.
22 Feb
I did a presentation at our local Utah Ruby Users Group tonight on the motivation and application of the bundled_resource plugin.
You can download the slides in Microsoft PowerPoint format or view the slides as an html presentation.
Thanks to everyone who showed up to participate tonight!
21 Feb
Kudos to Allan Odgaard the creator of TextMate for building such a powerful and flexible editor for the Mac. Without his brilliant work, making these 4 releases in 3 days would certainly not have been possible.
I’d also like to thank the several contributors who have worked with me to improve this Rails bundle in so short a time: Sami Samhuri for his Snippets contributions, Cliff Matthews for his patches for the Intelligent Go To File command, Kent Siblev for fixing a CocoaDialog issue and Pete Lasko (my coworker and partner) for many of his bright ideas.
Tim Lucas proposed an interesting challenge in his comments following the 0.7 Release:
…and now for the ultimate challenge: recognise a URL through an app’s route configuration and take you to the relevant action. Combine this with a bookmarklet and you could go from any web page straight to the relevant controller action.
My initial reaction to his idea was, “That’d be cool, but forget it right now. Maybe in the 2.0 release .” Way too much work for a bundle, it seemed. But then another approach bubbled up from a conversation between me and Pete Lasko. Why not add footnootes to each page that link you to the appropriate action or view? Why not indeed. This is very similar to the calling and purpose of the textmate_backtracer plugin—but instead of showing links to just error pages, show links to each and every page while in development mode on the Mac. From thence was born the textmate_footnotes plugin, now included in syncPEOPLE on Rails 0.9.
Oh yeah, and as a bonus, textmate_footnotes includes all of the functionality of the textmate_backtracer, thus deprecating the backtracer.
Well, yes, actually. As part of this release, we’ve included a novel “plugin installer” from within TextMate. Hit ctrl-command-option-\ and you will be given a choice of plugins to install from the syncPEOPLE on Rails Bundle to your active Rails application. Currently the Rails Engines and the textmate_footnotes plugins are available as options.
For the adventuresome among you (yes, that’s just about all of you) you can add any plugins you’d like to the tmbundle/Support/plugins directory and they will be automatically included in the drop-down select box when you invoke the plugin installer. In future releases, we may have a way for you to “tag” external plugins or repositories to automatically download and install them as options.
Also included in this release are a number of snippets that make migration files a little easier to build. Documentation is included in the Disk Image download.
Without a doubt, this bundle is becoming the essential resource for Rails developers on TextMate. Jamis Buck and Tobias Luetke on the Rails core team have downloaded and installed it—perhaps we’ll soon hear some reviews from them and others.
20 Feb
Suggestions and features just keep bursting from everywhere.
In this release, we’ve added Inline Partial Editing, bound to the same command as the Create Partial from Selection feature (command-option-p). Now you can edit your partials inline and save them out again to their appropriate files. Thanks to Kyle Maxwell for the suggestion.
There’s also an experimental “generate” command that will generate scaffolding, controllers, models and more right from within TextMate. Bound to command-option-g by default.
Works in many different contexts. Checks the current line first to see if there are any “render”, “redirect_to” statements or javascript / stylesheet files. Goes to the file if found. Otherwise, if you’re inside a controller’s action, it will take you to the view. If you’re inside a view, it will take you to the corresponding controller action. Also works for ActionMailer models with their corresponding views.
When inside a view file, select some HTML or erb code that you would like to turn in to a partial. Hit ‘command-option-p’ and a dialog asking you for the name of your new partial will pop up. Name your partial and hit ‘ok’. The selected text will be replaced by a “render :partial” erb fragment and the text will be saved in the newly named partial file.
When inside a view file that contains one or more “render :partial” statements, hit “command-option-p” without any selection and your partials will be brought in to the current file to be edited. Once done with them, hit command-option-p again and they will be saved to their appropriate locations and removed.
Hit ‘command-option-g’ from any file and you will be taken through 2 or 3 simple dialogs to help you generate scaffolds, models, migrations, controllers and more.
Lists all mentions of TODO, CHANGED, and FIXME within your project. Lets you toggle the three categories on and off.
20 Feb
I’m not sure if this is all black magic or what, but the process seems to be pretty undocumented around the ‘net. I’d like to make a nice drag-n-drop installer for the new syncPeople on Rails Bundle. Something with a nice background image, and an internet-enabled bit so it opens right up in Safari.
So far, the only two good links I’ve found to creating a Disk Image with a picture background are:
Still looking for that ultimate “Free, Instantaneous and Perfect” product…
19 Feb
Isn’t it great when you find some time to work on a project you’ve been meaning to do for a while?
Following the 0.5 release and the 0.6 release, the “syncPeople on Rails” TextMate bundle has reached version 0.7. Here are the feature updates:
This was a gem I picked up from the TextMate mailing list that we’ll be using at syncPeople. Basically it gathers all of your TODO, FIXME, and CHANGED messages from all of your project files and color codes them in a nicely formatted HTML window. In addition, you can turn any of the categories on and off if you need to focus on one aspect or the other in your work flow. Replaces the old TODO list with ctrl-shift-t.
Note: You may have to turn off the old TODO list key combo in your commands.
Hitting the ‘enter’ key is even smarter: it will now visit javascript and stylesheet files. For example, clicking on any of the following formats will take you to the javascript or stylesheet:
Also, following the suggestion of procreate, “Mailers also have views!” Now you can hop, skip and jump your way from ActionMailer models to their views and back.
And lastly, you can swap between your controller and helper when it makes sense to do so. Normally, hitting ‘enter’ inside a controller will take you to an action’s view, but if your caret is near the top of the file (not inside an action method) then ‘enter’ will take you to the helper. Hitting ‘enter’ again brings you back to the controller.
So that you can rest your mind and use or re-use this however you’d like, we’ve released this under the GNU Lesser General Public License.