Fork me on GitHub

Drew's World

Rants, News, Etc on my Life and Projects

Sublime Text 2 Guard Plugin Updates

by Andrew De Ponte (@cyphactor)

I woke up early this morning and thought it was time for a little sublime_guard love. I went through and tackled all of the syntax highlighting issues. This included the following issues (#27, #30, #31, #38, #43, #29).

I also cleaned up a number of tickets that were lying around and had either been completed already or were tickets that were invalid.

I also started a branch for adding python3 support to the plugin. The branch is named python3_support. I would love it if anyone out there in the ether would grab that branch, test it out, and give me some feedback.

Anyways, I hope you guys enjoy the updates. As usual if you installed from Package Control just restart Sublime Text 2. If you installed manually then just pull the latest version down with Git.

See you all next time.

Ruby and Rails Mountain Lion Hiccups

by Andrew De Ponte (@cyphactor)

So when Mac OS X Mountain Lion was released a few days ago I jumped on upgrading and got switched over as soon as I could. My mentality for upgrading is that I would much rather deal with the pain of upgrading in smaller chunks when needed rather than waiting. Plus, I just like to be on the latest and greatest in terms of the tools I use for my job.

Anyways, below is going to be a listing of some of the hiccups that either I or other developers on my team have run into in terms of their Ruby and Rails development environment setups.

Git

Some of the devs on my team had Git installed via the git-osx-installer. These developers seemed to lose their Git installs when they upgraded. I was using a Homebrew install of Git and it worked just fine for me after upgrading. So be aware of what your situation is and resort to brew because it is awesome.

XCode 4.4

In order to build gems with the native exensions and just to have the basic development tools around I installed the latest XCode 4.4. Once installed I went to the preferences menu, in the download tab, and chose to install the Command Line Tools because that is really what I was looking for more than anything. I have read on other posts online that you can download the Command Line Tools alone and install just them. I personally chose to install XCode as I do use XCode and the native tools to work on iPhone/iPad app development as well.

gcc-4.2

The latest XCode now comes with clang/llvm which is a new C/C++/Objective-C compiler. The problem is that the Ruby language isn’t fully compatible with clang and llvm. Therefore, you need to install GCC 4.2 using Homebrew. GCC 4.2 is the latest version of the GCC compiler that apple provided before switching to clang/llvm. Anyways, you can install GCC 4.2 by doing the following with brew:

brew tap homebrew/dupes
brew install apple-gcc42

The above will install the apple gcc-4.2 in a side by side fashion with XCode. This means that it won’t mess up your existing XCode install like other solutions.

Once you install gcc-4.2 then you can install/reinstall your ruby version inside of RVM as needed.

Apache 2 (Web Sharing)

In the upgrade it seems that they have revamped the Sharing preference pane. In the process of this it seems that Apple has decided to remove the Web sharing component of this preference pane. Don’t worry though. Apache is still there and running. You just can’t start it and stop it from the preferences pane anymore. You can use the following commands instead.

sudo apachectl stop
sudo apachectl start
sudo apachectl restart

Note: When the upgrade happened it nuked all my /etc/apache2/users/ configs and all my other apache configs. So, if you have any custom apache configs as I did you should probably back them up before upgrading.

X11

It seems that another thing that was changed with the upgrade to Mac OS X Mountain Lion was that they removed the X11 that I had previously installed and seemed to no longer provide it. Thats ok though because XQuartz 2.7.2 is what you want and it is available freely at http://xquartz.macosforge.org/landing/. Just install that bad boy and follow the on screen instructions to reboot when it is done and you should be good to go in terms of X11.

ImageMagick

Before upgrading I had ImageMagick installed via Homebrew. After, the upgrade was finished my ImageMagick was exiting with failures about some dylib. To solve this problem I simply ran the following and I was back in running order with respect to ImageMagick:

brew upgrade imagemagick

Pygments

I use Pygments to handle syntax highlighting in my jekyll sites and it seemed to not be working after the upgrade. I believe this is because it is now using Python 2.7.2. To resolve this issue I just re-installed Pygments using the following:

sudo easy_install Pygments

Sublime Text 2 Guard Plugin Updates

by Andrew De Ponte (@cyphactor)

It has been a while since I have provided an update on my Sublime Text 2 Guard Plugin and I just made some changes so I figured I would make a quick post. The project has recently had a number of contributions which I will list in the changes below.

I have been completely stoked with the growing usage of this plugin as well as the abundance of contributions people have been making to the plugin. In this update there are a number of people that need to be called out with special thanks.

@diogomafra provided a Clear output when predefined text found feature. I am sure many users will find this feature a nice addition to smoothing out their workflow. Thank you for your contribution @diogomafra.

@chrislerum provided rbenv support. I know that this feature will be huge for a number of the users as this was a highly requestd feature. Thank you so much for your contribution @chrislerum.

@brandonblack provided the ability to function without bundler. This will allow users who aren’t using bundler to be able to use this plugin. I think this is a great addition as the more people we can get using this plugin the more feedback we can get. Hence, the better it will become. Thanks for your contribution @brandonblack.

@whitequark provided the basis for the Run all Tests & Show Guard Output feature. I know a number of developers who have been waiting for something like this to fit their personal workflow. Thank you very much for your contribution @whitequark.

A big thanks goes out to all the above listed contributors and all of our prior contributors. Thank you all for helping make this a solid very useful plugin for the development community. As usual please make issues for any bugs or feature requsets you have at Sublime Text 2 Guard Plugin.

A New Rails Tagging Plugin

by Andrew De Ponte (@cyphactor)

A little over 3 months ago I had the need for a good tagging plugin for Rails. I tried out a number of the popular ones but they just weren’t up to my standards in terms of their APIs and their functionality. To accomplish the user experience goals that had been set forth for the project I would have had to hack the existing Rails tagging plugins to pieces.

So after some discussion about the Rails plugins with my team. We decided that I should just start my own Rails tagging plugin. Anyways, I started developing Tagalong, my Rails tagging plugin, immediately. The library is now 3 months old and I figured I should let people know that it exists and provide a breakdown of its features.

Tagalong has two major concepts that a developer needs to understand before being able to use it. The first concept is a Tagger. A Tagger is simply an object that can perform the act of tagging other objects (Taggables). As I am sure you have guessed the second concept is a Taggable. A Taggable is simply an object in the system that can be tagged.

The Tagalong Rails plugin is built entirely around these two concepts a Tagger and a Taggable. This architecture decision is one of the major differences between this Rails tagging plugin and the other tagging plugins out there. A brief breakdown of the plugin is as follows.

  • clean easy to understand API
  • does NOT require saving of the model when tagging/untagging
  • keeps history of tags Taggers have used
  • allows defining multiple Taggers and Taggables
  • tracks number of times tags are used
  • returns tag lists in alphabetical order

The above are simply a few brief points. For details on all its features and how to use it please refer to the GitHub project http://github.com/cyphactor/tagalong.