Read my latest article: Announcing RailsDeveloper (posted Wed, 01 Sep 2010 17:01:00 GMT)

Every Second Counts with a Piston in your Trunk

Posted by Robby Russell Tue, 16 Jan 2007 07:15:00 GMT

27 comments Latest by whole house fm transmitter Tue, 31 Aug 2010 02:33:56 GMT

Recently, I wrote about using RSpec and autotest (...which I think should be called autospec) together to help boost productivity while working on Rails projects. It seems that a few members of the PLANET ARGON team have picked up on using it, which I’m happy to hear about. :-)

It’s not the only thing that I’m happy about though.

I recently came across another gem. Several of my comrades in #caboose are using piston to manage external plugins for Ruby on Rails. Wait! Isn’t this what Subversion externals is meant for? Well, yes… but externals also eat away at productivity. For example, each day, we may have anywhere from 4-6 designers and developers working on one client project. When we’re in crunch mode, this could account for quite a few subversion commits throughout the day. We all know that we should run svn up on a regular basis to make sure that we’re keeping things in sync… especially when designers and developers are working really closely and fine tuning something specific in the application. Well, the one downside to this process is that each svn up not only checks our repository, but it also checks external repositories.

“But wait! Can’t you just ignore externals on an update?”

Of course, but who wants to type out --ignore-externals each time they run an update? ...or perhaps you could make an alias for this in your shell. In any event, everyone on the team is then left to be responsible for doing this… and an extra 30-60 seconds (if not longer) per svn update times x number of people on project… well… time wasted if you’re closely watching the svn updates. Also, TextMate doesn’t have an option currently (that I could find) to ignore externals, so for those who manage subversion through it… they’re waiting on externals within their primary workspace.

Another issue with svn externals is that when a repository goes down, it really starts to slow stuff down your updates. This is always fun when you go to deploy your application with Capistrano and realize that you can’t finish the update because it can’t connect it to http://svn.lazyatom.com/public/plugins/acts_as_hasselhoff/ to make sure that your application has the latest version of the best plugins available for Rails.

acts_as_hasselhoff

Then there is the whole issue of wanting to make changes to the plugin that you’re including as an external. How does that fit into the whole mix?

There is Hope!

Piston encourages you to keep your external plugins in your local repository. Don’t worry, it remembers where it retrieved the code from so that you can update from the external repository at any time.

Installing Piston

Again, this is really simple like most gems.


    $ sudo gem install -y piston
    Password:
    ...
    Successfully installed piston-1.2.1

Great, that’s all that you have to do to get started with Piston. Now, let’s get on with the show.

If you don’t have any existing Subversion externals, feel free to skip this section.

Converting existing externals

Okay, so let’s say that you’re working on a Ruby on Rails project and are relying on several external repsitories. For example, a project that I’m working on… currently looks like this.


    $ svn proplist --verbose vendor/plugins/               
    Properties on 'vendor/plugins': 
      svn:externals : 
    authorization                 http://svn.writertopia.com/svn/plugins/authorization
    svn_tools                     http://svn.planetargon.org/rails/plugins/svn_tools
    simply_helpful                http://dev.rubyonrails.com/svn/rails/plugins/simply_helpful
    exception_notification        http://dev.rubyonrails.com/svn/rails/plugins/exception_notification
    asset_field                   http://svn.planetargon.org/rails/plugins/asset_field
    rspec_on_rails                svn://rubyforge.org/var/svn/rspec/tags/REL_0_7_5/rspec_on_rails/vendor/plugins/rspec_on_rails
    rspec_autotest                http://svn.caldersphere.net/svn/main/plugins/rspec_autotest

Piston is smart enough to know how to convert these Subversion externals into Piston-friendly plugins. This can be done by passing the piston command the convert option from within your Rails application directory.

Go ahead and run the following.


    $ piston convert
    Importing 'http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-0_RC1' to vendor/rails (-r 5619)
    Exported r5619 from 'http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-0_RC1' to 'vendor/rails'

    Importing 'http://svn.writertopia.com/svn/plugins/authorization' to vendor/plugins/authorization (-r 83)
    Exported r83 from 'http://svn.writertopia.com/svn/plugins/authorization' to 'vendor/plugins/authorization'

    Importing 'http://svn.planetargon.org/rails/plugins/svn_tools' to vendor/plugins/svn_tools (-r 119)
    Exported r119 from 'http://svn.planetargon.org/rails/plugins/svn_tools' to 'vendor/plugins/svn_tools'

    Importing 'http://dev.rubyonrails.com/svn/rails/plugins/simply_helpful' to vendor/plugins/simply_helpful (-r 5700)
    Exported r5700 from 'http://dev.rubyonrails.com/svn/rails/plugins/simply_helpful' to 'vendor/plugins/simply_helpful'

    Importing 'http://dev.rubyonrails.com/svn/rails/plugins/exception_notification' to vendor/plugins/exception_notification (-r 3900)
    Exported r3900 from 'http://dev.rubyonrails.com/svn/rails/plugins/exception_notification' to 'vendor/plugins/exception_notification'

    Importing 'http://svn.planetargon.org/rails/plugins/asset_field' to vendor/plugins/asset_field (-r 50)
    Exported r50 from 'http://svn.planetargon.org/rails/plugins/asset_field' to 'vendor/plugins/asset_field'

    Importing 'svn://rubyforge.org/var/svn/rspec/tags/REL_0_7_5/rspec_on_rails/vendor/plugins/rspec_on_rails' to vendor/plugins/rspec_on_rails (-r 1330)
    Exported r1330 from 'svn://rubyforge.org/var/svn/rspec/tags/REL_0_7_5/rspec_on_rails/vendor/plugins/rspec_on_rails' to 'vendor/plugins/rspec_on_rails'

    Importing 'http://svn.caldersphere.net/svn/main/plugins/rspec_autotest' to vendor/plugins/rspec_autotest (-r 48)
    Exported r48 from 'http://svn.caldersphere.net/svn/main/plugins/rspec_autotest' to 'vendor/plugins/rspec_autotest'

    Done converting existing svn:externals to Piston    

All we have to do now is checkin our changes to subversion and we’re golden.

svn ci -m "updating repository to use piston instead of those lame-o externals..."

If you find this interesting and want to learn more, be sure to check out this post on Ruby Inside for a detailed introduction to Piston.

update

the following morning I saw this come across our development team channel…

< argonbot> svn.commit( project_name, { :author => 'brian.ford', :rev => 83, :log => 'converted svn:externals to piston for product, cus I can.' } 

:-)

Subscribe to my RSS feed Enjoying the content? Be sure to subscribe to my RSS feed.
Comments

Leave a response

  1. Avatar
    James Tue, 16 Jan 2007 10:07:39 GMT

    But… why would you ever want to change acts_as_hasselhoff? It’s Freaking Perfect!! :)

    Piston does seem like the way forward, combining the best of SVN:Externals with the ability to really be in control of your application’s dependencies. Nice.

  2. Avatar
    Robby Russell Tue, 16 Jan 2007 13:57:06 GMT Recommend me on Working with Rails

    why would you ever want to change acts_as_hasselhoff?

    In my latest web 2.0 application, I am using a different picture of hasselhoff for all of my links than the one that was chosen by the original of author aah. It’s a difference of opinion and I’m an opinionated developer. Piston allows me to be even more opinionated now and that’s just my opinion.

  3. Avatar
    iain Mon, 22 Jan 2007 15:59:31 GMT

    How are you dealing with switching urls later? for example, above you’ve piston’d vendor/rails to 1.2.0RC1; how did you go about changing it to 1.2.1 once that released?

    The path of least resistance that I could find was to nuke vendor/rails, commit then piston import the new version. The commit is required because svn throws its dummy out of the pram when moving one thing over another thing; in fact, once something is being ‘A’dded it can’t be moved until it’s committed.

  4. Avatar
    iain Tue, 23 Jan 2007 23:46:51 GMT

    And the day after I ask, piston 1.3.0 is released containing a switch command. woo!

  5. Avatar
    Mark Wilden Thu, 06 Nov 2008 02:12:00 GMT

    @iain: “in fact, once something is being ‘A’dded it can’t be moved until it’s committed.”

    Just revert it. Seems weird to revert something that’s not in the repository yet, but there you go.

  6. Avatar
    abercrombie clothes Wed, 17 Mar 2010 07:43:31 GMT

    wonderful

  7. Avatar
    laptop battery china Thu, 13 May 2010 07:07:53 GMT

    Well, the one downside to this process is that each svn up not only checks our repository, but it also checks external repositories.

  8. Avatar
    nike shox shoes Mon, 07 Jun 2010 02:59:38 GMT

    Your article was wonderful, and I have share it with my friends! chi flat irons, chi straightener,

  9. Avatar
    lida daidaihualida Tue, 29 Jun 2010 05:53:11 GMT

    uk Tiffany accused eBay of false advertising because its website touted Tiffany rings , but many of them were actually counterfeit. He ruled in July 2008 that eBay was not liable for trademark infringement by allowing Tiffany earrings to be sold on the website by individuals. Tiffany necklaces then appealed to the higher court. These effective lida daidaihua do not have any harmful side-effects. You get great discounts on your box of daidaihua , the entire details and instructions to take these effective lida slimming is clearly mentioned on the site, slimming capsule that are easily available on the online stores. slimming capsules are mostly safe and able but several affected and abortive articles actualize a bad name for all slimming capsule .

  10. Avatar
    air jordan 11 Wed, 30 Jun 2010 09:19:08 GMT

    Demonstrate a unique new conceptjordan shoesAwA518

  11. Avatar
    dongge1234 Fri, 16 Jul 2010 01:18:39 GMT

    ok

  12. Avatar
    fivefinger shoes Mon, 26 Jul 2010 02:49:56 GMT
  13. Avatar
    logo designw Mon, 02 Aug 2010 07:30:29 GMT

    Thanks a lot for a bunch of good tips. I look forward to reading more on the topic in the future. Keep up the good work! This blog is going to be great resource. Love reading it.

  14. Avatar
    website design Mon, 02 Aug 2010 07:30:55 GMT

    I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.

  15. Avatar
    bag manufacturer Mon, 09 Aug 2010 03:44:38 GMT

    sure that we’re keeping things in sync… especially when designers and developers are working really closely and fine tuning something specific in the application. Well, the o

  16. Avatar
    http://www.bestretroshoes.com Tue, 10 Aug 2010 08:58:55 GMT
    Women Air Yeezy shoes,Women Air Yeezy shoes
    Air jordan Fusion 4.5,Air jordan Fusion 4.5
    Nike Air Jordan b’loyal,Nike Air Jordan b’loyal
    Nike Air jordan dube zero,Nike Air jordan dube zero
    Paul series,Paul series
    Louis Vuitton,Louis Vuitton
    Air Yeezy,Air Yeezy
    Air Jordan 1,Air Jordan 1
    Air Jordan 3,Air Jordan 3
    Air Jordan 4,Air Jordan 4
  17. Avatar
    chi hair straighteners Fri, 13 Aug 2010 01:18:45 GMT

    http://www.bestchisale.comThank you for this post, really interesting. Feel free to comment on my blog, I was solving similar problem.chi hair straighteners chi flat irons chi hair tools

  18. Avatar
    Christian Louboutin Fri, 13 Aug 2010 01:40:52 GMT

    Christian shoes for gorgeous women’s is not as general in the States as his Christian Sandals shoes, but also for his distinctively styled handbags. God forgive me, I interviewed Christian Louboutin while wearing a pair of trainers. What remains most identifiably hiphoppish about it is the beat-in-the-body that serves as ground for Classic Christian Louboutin growing-and contradictory-repertoire of lyrical lambaste it leverages.Some of the dressiest elegant Christian Louboutin pumps also feature sparkling rhinestone bands layered along the raised sole and Christian Louboutin heels.

  19. Avatar
    aaabs Thu, 19 Aug 2010 16:23:20 GMT
  20. Avatar
    aaabs Thu, 19 Aug 2010 16:23:36 GMT

    Air Yeezy[/url] Flat Irons[/url] Shoes[/url]

  21. Avatar
    COWBOYS SHOP Mon, 23 Aug 2010 02:24:30 GMT

    Thanks for posting this. Saints JerseysVery nice recap of some of the key points in my talk. I hope you and your readers find it useful! Thanks again http://www.nflsaintsshop.com/saints-jerseys/drew-brees-jerseys Drew Brees Jerseys

  22. Avatar
    nike rift Tue, 24 Aug 2010 02:46:15 GMT
  23. Avatar
    ac Wed, 25 Aug 2010 02:10:18 GMT

    skype phone skype phonedell laptop battery dell laptop batterylaptop battery laptop batterylaptop batterieslaptop batteriesgateway laptop battery gateway laptop batterysony vaio laptop batterysony vaio laptop battery ac adapter ac adapterdell ac adapter dell ac adapter hp ac adapter hp ac adaptertoshiba laptop battery toshiba laptop battery, leather handbags and fashion handbags and many good aluminum briefcase, aluminum cosmetic case aluminum tool case, aluminum train case.hp laptop battery hp laptop batteryibm thinkpad battery ibm thinkpad batteryacer laptop battery acer laptop battery

  24. Avatar
    Nicole Thu, 26 Aug 2010 01:25:11 GMT

    This is a really quality post.I find this information through Google. Great job. ugg boots outlet new uggs ugg adirondack boots

  25. Avatar
    John Thu, 26 Aug 2010 01:29:16 GMT

    I am love this blog very much, i will continue to read! uggs boots on sale discount uggs ugg classic boots

  26. Avatar
    lik Thu, 26 Aug 2010 13:08:03 GMT

    Caricature Artworks ,christian louboutin Only include links you think people who have

    read your article would like to see. Avoid miscellaneous information that doesn’t really help the user at this point like recent

    comments. Manolo Blahnik uses the standard 6 125×125 ads as well as a bigger one on top. They are clearly labeled as sponsors and

    before you even see the ads you see their tagline, which shows how much they prioritize their content over their ads.I have a

    pompom in seen so long and I loved really the fun and flirty taking on the different high school-esque item. But this is just an

    element; this bag is so much more. After I exceeded moved my pompom intrigue, I found fixated on the Blue shiny Python material. This material embraced so perfectly

    that it seems as they were literally made for any other form of the small shoulder bag. I’ve mentioned it before, but I’m a little careful

    always of great bags formed from Python skin I never want the Python it too fuzzy or how was beaten on the bag.Caricaturing is the

    art of illustrating the human face and figure in a way that exaggerates their prominent features. Most caricatures are satirical in

    nature,2010 christian louboutin discount New Style, making fun of the people

    being characterized. They are often used in newspaper editorial cartoons and other similar media, although they are made just as

    often simply for their entertainment value.

    The following caricature design examples characterize a variety of personalities, from past icons to

    href=”http://www.usachristianlouboutin.com”>christian Louboutin

    superstars,christian louboutin, from famous fictional

    characters to everyday real ones.It is uncertain whether the use of the word “club” originated in its meaning of a knot of people, or

    from the fact that the members “clubbed” together to pay the expenses of their meetings. The oldest English clubs were merely

    informal periodic gatherings of friends for the purpose of dining or drinking together. Thomas Occleve (in the time of Henry IV)

    mentions such a club called La Court de Bonne Compagnie (the Court of Good Company), of which he was a member. In 1659

    John Aubrey wrote, “We now use the word clubbe for a sodality [a society, association, or fraternity of any kind] in a tavern.” If you’

    ve been looking for caricature inspiration for a while,Christian Louboutin News, we hope this post gives you that spark – and maybe

    even a smirk or two to christian louboutin sale!

  27. Avatar
    whole house fm transmitter Tue, 31 Aug 2010 02:33:56 GMT

    I agree with the post. It takes a great mind to bring such thoughts to the public, and make it so simple to read and process. Thank you for placing a lot of effort into your article. I stumbled upon a place that ya’ll might want to visit. It’s kinda strange, but seems to be really cool. What’s better than an cool surprise? Beats me, but what I do know is that over at mystery best you can score some awesome prizes in every box. Yep, every box holds something amazing. You can win money,vacations,cars and more! It’s easy to win. Just go over and enter your email for a chance to win the huge mystery box. That was the jist of the text on the site. Not too bad.

Share your thoughts... (really...I want to hear them)

Comments