Skip to content

Commit

Permalink
Updated documents with how to sign up for a key in development + prod…
Browse files Browse the repository at this point in the history
…uction.

Fixed rdoc so that eschaton docs can ge generated like so:

$ cd vendor/plugins/eschaton
$ rake rdoc
$ open rdoc/index.html
  • Loading branch information
Guilio Karadanais committed Aug 14, 2008
1 parent a2bc629 commit 948fb20
Show file tree
Hide file tree
Showing 22 changed files with 106 additions and 92 deletions.
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,3 +1,2 @@
rdoc
.DS_Store
plugin_docs
.DS_Store
41 changes: 29 additions & 12 deletions README
@@ -1,29 +1,46 @@
== eschaton => google maps on rails with hotness

Helps with writing google map[http://code.google.com/apis/maps/documentation/reference.html] mashups in rails,
brining together the power of Google Maps and Rails.
Helps with writing google map[http://code.google.com/apis/maps/documentation/reference.html] mashups in Rails
bringing together the power of Google Maps and Rails.

Check out our blog[http://eschatonmaps.blogspot.com/] for updates.
Check out our blog[http://eschatonmaps.blogspot.com/] for updates. If you have a bug or issue check the
list[http://eschaton.lighthouseapp.com/projects/12849-eschaton/tickets] or help by
reporting[http://eschaton.lighthouseapp.com/projects/12849-eschaton/tickets/new] your bug or issue.

If you have a bug or issue check the list[http://eschaton.lighthouseapp.com/projects/12849-eschaton/tickets] or
help by reporting[http://eschaton.lighthouseapp.com/projects/12849-eschaton/tickets/new] your bug or issue.
You can also check out the github page[http://github.com/yawningman/eschaton/tree/master], patches are always welcome.

== Get it...

For Rails 2.1 and up
script/plugin install git://github.com/yawningman/eschaton.git
script/plugin install git://github.com/yawningman/quiver_core.git
$ script/plugin install git://github.com/yawningman/eschaton.git
$ script/plugin install git://github.com/yawningman/quiver_core.git

Older versions of Rails
cd vendor/plugins
git clone git://github.com/yawningman/eschaton.git
git clone git://github.com/yawningman/quiver_core.git
$ cd vendor/plugins
$ git clone git://github.com/yawningman/eschaton.git
$ git clone git://github.com/yawningman/quiver_core.git

== Get going...

Generate a map, look at the files the generator created and play a bit
script/generate map
For developement if you are developing on anything other than http://localhost you will need to generate a google maps
api key here[http://code.google.com/apis/maps/signup.html] as well as for production.

# Generate a key for development and place this in your developement.rb file
GOOGLE_MAPS_API_KEY = "paste_your_developement_api_key_here"

# Generate a key for production and place this in your production.rb file
GOOGLE_MAPS_API_KEY = "paste_your_production_api_key_here"

Then generate a map, look at the files the generator created and play a bit
$ script/generate map

Then visit the map at http://localhost:3000/map

== Documentation...

Generate the eschaton docs
$ cd vendor/plugins/eschaton
$ rake rdoc
$ open rdoc/index.html

Check out the Google::Map and Google::Marker as these are the most commonly used mapping objects.
3 changes: 3 additions & 0 deletions Rakefile
Expand Up @@ -21,7 +21,10 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.title = 'eschaton'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')

rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_files.exclude("plugins/*/test/*.rb")
rdoc.rdoc_files.include("plugins/*/**/*.rb")
end

# Generate a rake task for each plugin separately
Expand Down
4 changes: 2 additions & 2 deletions lib/eschaton/core_ext.rb
@@ -1,4 +1,4 @@
class Object
class Object # :nodoc:

def _logger_debug(message)
RAILS_DEFAULT_LOGGER.debug("eschaton: #{message}") if RAILS_DEFAULT_LOGGER
Expand All @@ -18,7 +18,7 @@ def presentation_modelify

end

class String
class String # :nodoc:

# Escapes +self+ and returns the escaped string.
def escape
Expand Down
2 changes: 1 addition & 1 deletion lib/eschaton/eschaton.rb
@@ -1,5 +1,5 @@
# Provides access to global objects of interest.
class Eschaton
class Eschaton # :nodoc:
cattr_accessor :current_view

# works like rails url for only with more options!!!!
Expand Down
8 changes: 4 additions & 4 deletions lib/eschaton/javascript/core_ext.rb
@@ -1,4 +1,4 @@
class Hash
class Hash # :nodoc:

def to_js
string_keys = self.stringify_keys
Expand All @@ -11,7 +11,7 @@ def to_js

end

class String
class String # :nodoc:

def interpolate_javascript_vars
interpolated_string = self
Expand All @@ -26,7 +26,7 @@ def interpolate_javascript_vars

end

class Object
class Object # :nodoc:

def to_js
if self.is_a?(Symbol)
Expand All @@ -49,7 +49,7 @@ def to_js_method

end

class Array
class Array # :nodoc:

# Returns an argument list that can be used when calling a javascript method.
# Arguments will be converted to there javascript equivalents and seperated by a commas.
Expand Down
2 changes: 1 addition & 1 deletion lib/eschaton/plugin_loader.rb
@@ -1,4 +1,4 @@
class PluginLoader
class PluginLoader # :nodoc:

# Loads all plugins found using plugin_locations and extends relevant objects.
def self.load
Expand Down
2 changes: 1 addition & 1 deletion lib/eschaton/presentation_model.rb
@@ -1,4 +1,4 @@
class PresentationModel
class PresentationModel # :nodoc:
attr_reader :script

def initialize(script)
Expand Down
33 changes: 17 additions & 16 deletions lib/eschaton/rails_extensions/action_controller.rb
@@ -1,25 +1,26 @@
class ActionController::Base
before_filter :set_current_view
module ActionController # :nodoc:
class Base # :nodoc:
before_filter :set_current_view

# Create a presentation model using the given +model_name+
def presentation_model(model_name)
model = "#{model_name.to_s.classify}PresentationModel".constantize
# Create a presentation model using the given +model_name+
def presentation_model(model_name)
model = "#{model_name.to_s.classify}PresentationModel".constantize

render :update do |page|
Eschaton.with_global_script page do
yield model_name.presentation_modelify.new(page)
render :update do |page|
Eschaton.with_global_script page do
yield model_name.presentation_modelify.new(page)
end
end
end
end

def run_javascript(&block)
render :update do |page|
Eschaton.with_global_script page, &block
def run_javascript(&block)
render :update do |page|
Eschaton.with_global_script page, &block
end
end
end

def set_current_view
Eschaton.current_view = @template
def set_current_view
Eschaton.current_view = @template
end
end

end
11 changes: 6 additions & 5 deletions lib/eschaton/rails_extensions/action_view.rb
@@ -1,8 +1,9 @@
class ActionView::Base
module ActionView # :nodoc:
class Base # :nodoc:

# Extends the ActionView::Base by including the +extention_module+.
def self.extend_with_plugin(extention_module)
include extention_module
# Extends the ActionView::Base by including the +extention_module+.
def self.extend_with_plugin(extention_module)
include extention_module
end
end

end
73 changes: 39 additions & 34 deletions lib/eschaton/rails_extensions/javascript_generator.rb
@@ -1,43 +1,48 @@
class ActionView::Helpers::PrototypeHelper::JavaScriptGenerator
module ActionView # :nodoc:
module Helpers # :nodoc:
module PrototypeHelper # :nodoc:
class JavaScriptGenerator # :nodoc:

module GeneratorMethods
module GeneratorMethods # :nodoc:

def <<(javascript)
@recorder << javascript if @recorder
@lines << javascript
def <<(javascript)
@recorder << javascript if @recorder
@lines << javascript

javascript
end
end
javascript
end
end

# Allows for recording any script contained within the block passed to this method. This will return what was
# recorded in the form of a JavascriptGenerator.
#
# This is useful for testing and debugging output when generating script.
#
# Example:
# script << "// This is before recording"
#
# # record will containin the script generated within the block
# record = script.record_for_test do
# script << "// This is within recording"
# script << "// Again, this is within a record"
# end
#
# script << "// This is after recording"
def record_for_test(&block)
recorder = Eschaton.javascript_generator
# Allows for recording any script contained within the block passed to this method. This will return what was
# recorded in the form of a JavascriptGenerator.
#
# This is useful for testing and debugging output when generating script.
#
# Example:
# script << "// This is before recording"
#
# # record will containin the script generated within the block
# record = script.record_for_test do
# script << "// This is within recording"
# script << "// Again, this is within a record"
# end
#
# script << "// This is after recording"
def record_for_test(&block)
recorder = Eschaton.javascript_generator

@recorder = recorder
yield self
@recorder = nil
@recorder = recorder
yield self
@recorder = nil

recorder
end
recorder
end

# Extends the JavaScriptGenerator by including the +extention_module+.
def self.extend_with_plugin(extention_module)
include extention_module
# Extends the JavaScriptGenerator by including the +extention_module+.
def self.extend_with_plugin(extention_module)
include extention_module
end
end
end
end

end
12 changes: 0 additions & 12 deletions plugins/eschaton_kernel/dom_generator_ext.rb

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/google_maps/core_ext.rb
@@ -1,4 +1,4 @@
class Array
class Array # :nodoc:

# Converts the array to a google size[http://code.google.com/apis/maps/documentation/reference.html#GSize]. The +first+ element of the array
# represents the +width+ and the +second+ element represents the +height+.
Expand Down
2 changes: 1 addition & 1 deletion plugins/google_maps/google/map.rb
@@ -1,4 +1,4 @@
module Google
module Google # :nodoc:

# Represents a map. If a method or event is not documented here please see googles online[http://code.google.com/apis/maps/documentation/reference.html#GMap2]
# docs for details. See MapObject#listen_to on how to use events not listed on this object.
Expand Down

0 comments on commit 948fb20

Please sign in to comment.