Skip to content

Commit

Permalink
rake ya_map:install is depricated. Use script/generate ya_map
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltyk committed Jul 21, 2010
1 parent ea188e2 commit 5e9a7e2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.rdoc
Expand Up @@ -2,8 +2,8 @@
== Install
script/plugin install git@github.com:PavelTyk/ya_map.git
== Example
Run rake task to generate YML config file and JS
rake ya_map:install
Generate YML config file and JS
script/generate ya_map
Get API keys at yandex website[http://api.yandex.ru/maps/form.xml] and copy it to config/ya-map-api-key.yml
Initialize YaMap::Map object in controller
def index
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions generators/ya_map/ya_map_generator.rb
@@ -0,0 +1,8 @@
class YaMapGenerator < Rails::Generator::Base
def manifest
record do |m|
m.file "ya-map.js", "public/javascripts/ya-map.js"
m.file "ya-map-api-key.yml", "config/ya-map-api-key.yml"
end
end
end
22 changes: 3 additions & 19 deletions lib/tasks/ya_map.rake
@@ -1,22 +1,6 @@
namespace :ya_map do
namespace :copy do
desc "Copies API key YML file."
task :yml do
dest_path = "#{RAILS_ROOT}/config/ya-map-api-key.yml"
File.open dest_path, 'w' do |f|
f << File.read(File.dirname(__FILE__) + '/../../config/ya-map-api-key.yml')
end
puts "API File #{dest_path} copied successfully"
end
desc "Copies necessary JS files."
task :js do
dest_path = "#{RAILS_ROOT}/public/javascripts/ya-map.js"
File.open dest_path, 'w' do |f|
f << File.read(File.dirname(__FILE__) + '/../../public/javascripts/ya-map.js')
end
puts "JS File #{dest_path} copied successfully"
end
end
desc "Performs all necessary task to get YaMap up and running."
task :install => ['ya_map:copy:js', 'ya_map:copy:yml']
task :install do
puts "This task is depricated. Use \"script/generate ya_map\" instead."
end
end

0 comments on commit 5e9a7e2

Please sign in to comment.