mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
Merge branch 'fix_generate_command_rake_task' of https://github.com/marcisme/capybara-webkit
This commit is contained in:
commit
c15cd3a61e
1 changed files with 8 additions and 3 deletions
11
Rakefile
11
Rakefile
|
@ -49,12 +49,17 @@ task :generate_command do
|
|||
|
||||
Dir.glob("src/*.pro").each do |project_file_name|
|
||||
project = IO.read(project_file_name)
|
||||
project.gsub!(/^(HEADERS = .*)/, "\\1 #{name}.h")
|
||||
project.gsub!(/^(SOURCES = .*)/, "\\1 #{name}.cpp")
|
||||
project.gsub!(/^(HEADERS = .*)/, "\\1\n #{name}.h \\")
|
||||
project.gsub!(/^(SOURCES = .*)/, "\\1\n #{name}.cpp \\")
|
||||
File.open(project_file_name, "w") { |file| file.write(project) }
|
||||
end
|
||||
|
||||
File.open("src/find_command.h", "a") do |file|
|
||||
file.write("CHECK_COMMAND(#{name})")
|
||||
file.write("CHECK_COMMAND(#{name})\n")
|
||||
end
|
||||
|
||||
command_factory_file_name = "src/CommandFactory.cpp"
|
||||
command_factory = IO.read(command_factory_file_name)
|
||||
command_factory.sub!(/^$/, "#include \"#{name}.h\"\n")
|
||||
File.open(command_factory_file_name, "w") { |file| file.write(command_factory) }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue