tasks/local_gemfile.rake in dm-active_model-1.0.0 vs tasks/local_gemfile.rake in dm-active_model-1.0.1
- old
+ new
@@ -1,17 +1,15 @@
-desc "Support bundling from local source code (allows BUNDLE_GEMFILE=Gemfile.local bundle exec foo)"
+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