tasks/local_gemfile.rake in dm-constraints-1.0.0 vs tasks/local_gemfile.rake in dm-constraints-1.0.1
- old
+ new
@@ -1,17 +1,15 @@
desc "Support bundling from local source code (allows BUNDLE_GEMFILE=Gemfile.local bundle foo)"
task :local_gemfile do |t|
- root = Pathname(__FILE__).dirname.parent
- datamapper = root.parent
+ 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"')
+ line.sub!(/DATAMAPPER = 'git:\/\/github.com\/datamapper'/, "DATAMAPPER = '#{datamapper}'")
+ line.sub!(/:git => \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/, ':path => "#{DATAMAPPER}/\1"')
+ line.sub!(/do_options\[:git\] = \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/, 'do_options[:path] = "#{DATAMAPPER}/\1"')
f.puts line
end
end
end