andre / geokit-rails

Official Geokit plugin for Rails/ActiveRecord. Provides location-based goodness for your Rails app. Requires the Geokit gem.

This URL has Read+Write access

geokit-rails / install.rb
100644 15 lines (13 sloc) 0.828 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Display to the console the contents of the README file.
puts IO.read(File.join(File.dirname(__FILE__), 'README.markdown'))
 
# place the api_keys_template in the application's /config/initializers/geokit_config.rb
path=File.expand_path(File.join(File.dirname(__FILE__), '../../../config/initializers/geokit_config.rb'))
template_path=File.join(File.dirname(__FILE__), '/assets/api_keys_template')
if File.exists?(path)
  puts "It looks like you already have a configuration file at #{path}. We've left it as-is. Recommended: check #{template_path} to see if anything has changed, and update config file accordingly."
else
  File.open(path, "w") do |f|
    f.puts IO.read(template_path)
    puts "We created a configuration file for you in config/initializers/geokit_config.rb. Add your Google API keys, etc there."
  end
end