lib/active_groonga/railties/configurable.rb in activegroonga-1.0.1 vs lib/active_groonga/railties/configurable.rb in activegroonga-1.0.3

- old
+ new

@@ -11,18 +11,20 @@ # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +require 'fileutils' + module ActiveGroonga module Railties module Configurable def groonga_configurations groonga_yml = paths.config.groonga.first unless File.exist?(groonga_yml) groonga_yml_example = "#{groonga_yml}.example" if File.exist?(groonga_yml_example) - cp(groonga_yml_example, groonga_yml) + FileUtils.cp(groonga_yml_example, groonga_yml) else File.open(groonga_yml, "w") do |yml| yml.puts(<<-EOC) development: database: db/groonga/development/db