DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone >

Rake Freezes Rails

Snippets Manager user avatar by
Snippets Manager
·
Aug. 10, 06 · · Code Snippet
Like (0)
Save
Tweet
454 Views

Join the DZone community and get the full member experience.

Join For Free
Stolen from: ZenSpider: http://blog.zenspider.com/archives/2006/08/upgrade_rails_n.html

If you prefer to freeze your rails checkout. I recommend stealing this rule:

namespace :rails do
  namespace :freeze do
    desc "Lock to a specific rails version. Defaults to 1.1.5 or specify with RELEASE=x.y.z"
    task :version do
      rel = ENV['RELEASE'] || '1.1.5'
      tag = 'rel_' + rel.split(/[.-]/).join('-')
      rails_svn = "http://dev.rubyonrails.org/svn/rails/tags/#{tag}"

      puts "Freezing to #{tag} using #{rails_svn}"
      sh "type svn"
      
      dir = 'vendor/rails'
      rm_rf dir
      mkdir_p dir
      for framework in %w( railties actionpack activerecord actionmailer activesupport actionwebservice )
        checkout = "#{dir}/#{framework}"
        sh "svn export #{rails_svn}/#{framework} #{checkout}"
        unless test ?d, checkout then
          puts "ERROR: checkout missing: #{checkout}"
          exit 1
        end
      end
    end
  end
end

and running:

rake rails:freeze:version

It'll default to 1.1.5 or you can specify the tagged version you want using RELEASE=x.y.z.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Fintech and AI: Ways Artificial Intelligence Is Used in Finance
  • How To Integrate Event Streaming Into Your Applications
  • Waterfall Vs. Agile Methodologies: Which Is Best For Project Management?
  • Choosing Between REST and GraphQL

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo