Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

app template: allow plugins to specify branch or revision

#2352

There is a plugin declaration in the application template runner that can specify either an SVN or git repo. In the case of git repos, it can also specify whether to clone or use a submodule. However, to specify a branch or revision, you have to add command-line params to the repository spec:

add stable branch as a git submodule

plugin 'x', :git => '-b stable git://github.com/x/x.git', :submodule => true

add stable branch as a git clone

plugin 'x', :git => '-r stable git://github.com/x/x.git'

add rev 1234 as a subversion working copy

plugin 'x', :svn => '-r 1234 svn://svn.rubyforge.org/x/trunk'

I've attached a patch that allows the user to specify a git branch or svn revision using options:

add stable branch as a git submodule

plugin 'x', :git => 'git://github.com/x/x.git', :submodule => true, :branch => 'stable'

add stable branch as a git clone

plugin 'x', :git => 'git://github.com/x/x.git', :branch => 'stable'

add rev 1234 as a subversion working copy

plugin 'x', :svn => 'svn://svn.rubyforge.org/x/trunk', :revision => 1234

Reported by Zack Hobson · March 26th, 2009 @ 07:24 PM

State: resolved
Milestone: 2.x
Assigned to: José Valim José Valim
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from 2.3.2, 2.x, generator, git, patch, plugin, rg, subversion to 2.3.2, 2.x, bugmash, generator, git, patch, plugin, rg, subversion

    August 5th, 2009 @ 03:50 PM

  2. José Valim
    José Valim
    • Assigned user set to José Valim

    August 8th, 2009 @ 02:04 PM

  3. David Trasbo
    David Trasbo

    Patch does not apply to edge since railties/lib/rails_generator/generators/applications/app/template_runner.rb has been moved.

    August 8th, 2009 @ 05:20 PM

  4. Matt Duncan
    Matt Duncan

    I re-created the patch based on master, Zach's attached patch still looks like it applies ok to 2-3-stable.

    I've attached a patch.

    August 8th, 2009 @ 10:24 PM

  5. José Valim
    José Valim

    @Matt, awesome! Could you please just add some tests?

    August 8th, 2009 @ 10:51 PM

  6. Matt Duncan
    Matt Duncan

    I've attached a patch for master with tests.

    August 8th, 2009 @ 11:11 PM

  7. Rizwan Reza
    Rizwan Reza

    verified

    +1 This patch applies well to master.

    August 8th, 2009 @ 11:26 PM

  8. José Valim
    José Valim
    • State changed from new to resolved
    • Tag changed from 2.3.2, 2.x, bugmash, generator, git, patch, plugin, rg, subversion to 2.3.2, 2.x, generator, git, patch, plugin, rg, subversion

    August 8th, 2009 @ 11:30 PM

  9. Repository
  10. David Trasbo