Skip to content

Commit

Permalink
merged with new_gen
Browse files Browse the repository at this point in the history
  • Loading branch information
apneadiving committed Apr 30, 2012
1 parent 56eac56 commit bfc3a9d
Show file tree
Hide file tree
Showing 106 changed files with 6,880 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
gemfile:
- Gemfile
before_script: 'cd spec/dummy/; rake db:migrate RAILS_ENV=test; cd ../..'
script: 'rspec spec'
after_script: 'bundle exec guard-jasmine -u http://localhost:8888/'
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source "http://rubygems.org"

# Declare your gem's dependencies in gmaps4rails.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.

gemspec

gem 'growl'
175 changes: 175 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
PATH
remote: .
specs:
gmaps4rails (1.5.0.pre)

GEM
remote: http://rubygems.org/
specs:
actionmailer (3.2.3)
actionpack (= 3.2.3)
mail (~> 2.4.4)
actionpack (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
activemodel (3.2.3)
activesupport (= 3.2.3)
builder (~> 3.0.0)
activerecord (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
activesupport (3.2.3)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
builder (3.0.0)
childprocess (0.3.1)
ffi (~> 1.0.6)
coderay (1.0.6)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
database_cleaner (0.7.2)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.3.0)
multi_json (~> 1.0)
factory_girl (2.6.1)
activesupport (>= 2.3.9)
factory_girl_rails (1.7.0)
factory_girl (~> 2.6.0)
railties (>= 3.0.0)
ffi (1.0.11)
growl (1.0.3)
guard (1.0.1)
ffi (>= 0.5.0)
thor (~> 0.14.6)
guard-coffeescript (0.5.7)
coffee-script (>= 2.2.0)
guard (>= 0.8.3)
guard-jasmine (1.1.0)
childprocess
guard (>= 0.8.3)
multi_json
thor
guard-rspec (0.5.11)
guard (>= 0.8.4)
guard-spork (0.4.1)
guard (>= 0.8.4)
spork (>= 0.8.4)
hike (1.2.1)
i18n (0.6.0)
jasmine (1.1.2)
jasmine-core (>= 1.1.0)
rack (>= 1.1)
rspec (>= 1.3.1)
selenium-webdriver (>= 0.1.3)
jasmine-core (1.1.0)
journey (1.0.3)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.6)
json_pure (1.6.5)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.7.1)
mime-types (1.18)
multi_json (1.2.0)
polyglot (0.3.3)
pry (0.9.8.4)
coderay (~> 1.0.5)
method_source (~> 0.7.1)
slop (>= 2.4.4, < 3)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.3)
actionmailer (= 3.2.3)
actionpack (= 3.2.3)
activerecord (= 3.2.3)
activeresource (= 3.2.3)
activesupport (= 3.2.3)
bundler (~> 1.0)
railties (= 3.2.3)
railties (3.2.3)
actionpack (= 3.2.3)
activesupport (= 3.2.3)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
rspec-mocks (~> 2.8.0)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
rspec-rails (2.8.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.8.0)
rubyzip (0.9.6.1)
selenium-webdriver (2.5.0)
childprocess (>= 0.2.1)
ffi (>= 1.0.7)
json_pure
rubyzip
slop (2.4.4)
spork (1.0.0rc2)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.5)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.32)

PLATFORMS
ruby

DEPENDENCIES
database_cleaner
factory_girl_rails
gmaps4rails!
growl
guard (~> 1.0.1)
guard-coffeescript
guard-jasmine
guard-rspec
guard-spork
jasmine
jquery-rails
pry
rails (~> 3.2.1)
rspec-rails
sqlite3
38 changes: 38 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb') { :rspec }
end


guard 'rspec', :cli => "-c -f d", :all_on_start => false, :all_after_pass => false do
watch(%r{^spec/.+_spec\.rb$})
watch('spec/launchers/all_specs.rb') { "spec" }
watch('spec/launchers/all_but_requests.rb') { ["spec/base", "spec/helpers", "spec/models", "spec/views"] }
watch('spec/launchers/requests.rb') { "spec/requests" }
end

guard 'jasmine', :jasmine_url => 'http://localhost:8888/', :all_on_start => false, :all_after_pass => false do
watch(%r{spec/javascripts/spec\.(js\.coffee|js|coffee)$}) { "spec/javascripts" }
watch(%r{^spec/javascripts/.+_spec\.(js\.coffee|js|coffee)$}) { "spec/javascripts" }
watch(%r{^spec/javascripts/.+_spec\.js$}) { "spec/javascripts" }
end


#--drb

guard 'coffeescript', :input => 'app/assets/javascripts/gmaps4rails', :output => 'public/javascripts/gmaps4rails'

#
#guard 'coffeescript', :input => 'spec/javascripts/coffee', :output => 'spec/javascripts'

# do
# watch(/^app\/assets\/javascripts\/gmaps4rails\/(.*).coffee/)
# end
20 changes: 20 additions & 0 deletions MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2012 Benjamin Roth

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
112 changes: 112 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
== Google Maps for Rails (gmaps4rails) {<img src="https://secure.travis-ci.org/apneadiving/Google-Maps-for-Rails.png?branch=master" alt="Build Status" />}[http://travis-ci.org/apneadiving/Google-Maps-for-Rails]

Gmaps4rails is developed to simply create a Google Map:

- directly from your model,

- from your own json

It's based on Ruby on Rails 3 Engines and uses Google Maps API V3.

See (somewhat outdated) screencasts here: http://www.youtube.com/user/TheApneadiving

== When Gmaps4rails finally means Global Maps for Rails

I've added support for other map providers: openlayers, mapquest & bing.

See: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Map-Apis

Any help would be appreciated to complete this work.

== Requirements

1) Gemfile

gem 'gmaps4rails'

2) Copy the assets to your app (and be sure to copy the fresh assets when you upgrade the gem):

rails generate gmaps4rails:install

This will copy all the coffeescript files if you're running Rails >= 3.1 or all the js files for Rails 3.0.x.

Only `gmaps4rails.base` + `gmaps4rails.your_provider` are necessary.

3) Javascript

<%= yield :scripts %> (in your footer)

This container will include the js files from map providers, the custom js to display the map, the gem's js code.

4) CSS

`gmaps4rails.css` will be copied to your app after you run the Rails generator.
Be sure to require this file in your view for your first steps.

For Rails 3.0.x or without assets pipeline:

<%= stylesheet_link_tag 'gmaps4rails' %>

For Rails >= 3.1 with assets pipeline, same principle: add the required file to your manifest.


== Basic configuration
In your model, add:

acts_as_gmappable

def gmaps4rails_address
#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki
"#{self.street}, #{self.city}, #{self.country}"
end

Create a migration and add the following fields to your table (here users):

add_column :users, :latitude, :float #you can change the name, see wiki
add_column :users, :longitude, :float #you can change the name, see wiki
add_column :users, :gmaps, :boolean #not mandatory, see wiki

== How to?
=== QuickStart!
In your controller:

@json = User.all.to_gmaps4rails

In your view:

<%= gmaps4rails(@json) %>

Done!

== Options

* Markers with Info window, Custom Picture, RichMarkers (make your own markers with custom html)

* Automatic sidebar with list of markers

* Circles, Polylines, Polygons

* Geocode directly your address and retrieve coordinates.

* Wrapper for 'Direction', giving instructions to go from point A to point B

* Auto-adjust the map to your markers

* Refresh your map on the fly with Javascript (and Ajax)

* KML support

* Easy multimap

* {More details in the Wiki}[https://github.com/apneadiving/Google-Maps-for-Rails/wiki]

== Todo?

Feel free to contact us, you have your say.

== Copyright
MIT license.

Authors: Benjamin Roth, David Ruyer

Contributors: Mircea Pricop, Kamil Śliwak, Alex Vorobiev
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'bundler'
Bundler::GemHelper.install_tasks

import 'lib/tasks/jasmine.rake'
Loading

0 comments on commit bfc3a9d

Please sign in to comment.