Sha256: b87d8cbb67d0ae7ccbe641d2b259b7f1693915f0db752857c707ce24a4ba0a25

Contents?: true

Size: 617 Bytes

Versions: 4

Compression:

Stored size: 617 Bytes

Contents

desc "Support bundling from local source code (allows BUNDLE_GEMFILE=Gemfile.local bundle exec foo)"
task :local_gemfile do |t|

  root              = Pathname(__FILE__).dirname.parent
  datamapper        = root.parent

  source_regex     = /datamapper = 'git:\/\/github.com\/datamapper'/
  gem_source_regex = /:git => \"#\{datamapper\}\/(.+?)(?:\.git)?\"/

  root.join('Gemfile.local').open('w') do |f|
    root.join('Gemfile').open.each do |line|
      line.sub!(source_regex,     "datamapper = '#{datamapper}'")
      line.sub!(gem_source_regex, ':path => "#{datamapper}/\1"')
      f.puts line
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dm-active_model-1.0.0 tasks/local_gemfile.rake
dm-active_model-1.0.0.rc3 tasks/local_gemfile.rake
dm-active_model-1.0.0.rc2 tasks/local_gemfile.rake
dm-active_model-1.0.0.rc1 tasks/local_gemfile.rake