gmaps4rails 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -15,7 +15,7 @@ See screencasts here: http://www.youtube.com/user/TheApneadiving
15
15
  - gem 'gmaps4rails' (in your gemfile, then bundle)
16
16
  - <%= yield :head %> (in your header)
17
17
  - <%= yield :scripts %> (in your footer)
18
- - config.serve_static_assets = true (in your production.rb), or copy/paste gmaps4rails.css & gmaps4rails.js files in your app.
18
+ - config.serve_static_assets = true (in your production.rb), or run 'rails generate gmaps4rails:install' to copy the JS and CSS assets to your /public folder.
19
19
 
20
20
  == Basic configuration
21
21
  In your model, add:
@@ -0,0 +1,19 @@
1
+ module Gmaps4rails
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../../templates', __FILE__)
5
+
6
+ desc 'Creates a Gmaps4rails initializer and copies the assets to the public folder.'
7
+
8
+ def copy_locale
9
+ copy_file '../../../public/javascripts/gmaps4rails.js', 'public/javascripts/gmaps4rails.js'
10
+ copy_file '../../../public/stylesheets/gmaps4rails.css', 'public/stylesheets/gmaps4rails.css'
11
+ copy_file '../../../public/images/marker.png', 'public/images/marker.png'
12
+ end
13
+
14
+ def show_readme
15
+ readme 'README' if behavior == :invoke
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,2 @@
1
+ **************************************
2
+ Google Maps For Rails
data/lib/gmaps4rails.rb CHANGED
@@ -4,13 +4,17 @@ if defined?(Rails) && Rails::VERSION::MAJOR == 3
4
4
  #require "action_controller"
5
5
  require 'array'
6
6
  require 'hash'
7
- require 'application_helper'
7
+ #require 'application_helper'
8
8
  require 'acts_as_gmappable/base'
9
9
 
10
10
  class Engine < Rails::Engine
11
11
  initializer "static assets" do |app|
12
12
  app.middleware.use ::ActionDispatch::Static, "#{root}/public"
13
13
  end
14
+ initializer "gmaps4rails view helpers" do |app|
15
+ require 'gmaps4rails_helper'
16
+ ActionView::Base.send :include, Gmaps4railsHelper
17
+ end
14
18
  end
15
19
 
16
20
  end
@@ -1,4 +1,4 @@
1
- module ApplicationHelper
1
+ module Gmaps4railsHelper
2
2
 
3
3
  def gmaps4rails(builder, enable_css = true, enable_js = true )
4
4
  options = {
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmaps4rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 3
10
- version: 0.8.3
9
+ - 4
10
+ version: 0.8.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Benjamin Roth
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-05 00:00:00 +02:00
19
+ date: 2011-05-11 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -47,9 +47,11 @@ extra_rdoc_files:
47
47
  files:
48
48
  - app/views/gmaps4rails/_gmaps4rails.html.erb
49
49
  - lib/acts_as_gmappable/base.rb
50
- - lib/application_helper.rb
51
50
  - lib/array.rb
51
+ - lib/generators/gmaps4rails/install_generator.rb
52
+ - lib/generators/templates/README
52
53
  - lib/gmaps4rails.rb
54
+ - lib/gmaps4rails_helper.rb
53
55
  - lib/hash.rb
54
56
  - lib/rails/generators/gmaps4rails/gmaps4rails_generator.rb
55
57
  - lib/rails/generators/gmaps4rails/templates/initializer.rb