10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/schema_dev/gemfiles.rb', line 10
def build(config)
Dir.mktmpdir do |tmpdir|
@tmpdir = Pathname.new(tmpdir).realpath
gemfiles = Pathname("gemfiles")
tmp_root = @tmpdir + gemfiles
target_root = Pathname.new(".").realpath + gemfiles
_install gemfiles + 'Gemfile.base'
config.activerecord.each do |activerecord|
activerecord_path = gemfiles + "activerecord-#{activerecord}"
_install activerecord_path + 'Gemfile.base'
config.db.each do |db|
_install activerecord_path + "Gemfile.#{db}"
end
end
if `diff -rq #{tmp_root} #{target_root} 2>&1 | grep -v lock`.length == 0
return false
end
_force_rename(tmp_root, target_root)
return true
end
end
|