Permalink
Browse files

Added gemspec and updated README.

  • Loading branch information...
1 parent e35a815 commit 7417b6bf986166f40bdc57929530b213854c4590 @josevalim committed Jan 2, 2009
Showing with 213 additions and 133 deletions.
  1. +21 −0 MIT-LICENSE
  2. +145 −0 README
  3. +0 −133 README.markdown
  4. +47 −0 rails-footnotes.gemspec
View
@@ -0,0 +1,21 @@
+Copyright (c) 2006 Coda Hale
+Copyright (c) 2008 José Valim (jose.valim at gmail dot com)
+
+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.
View
145 README
@@ -0,0 +1,145 @@
+Copyright (c) 2008 José Valim (jose.valim at gmail dot com)
+Site: http://www.pagestacker.com/
+Blog: http://josevalim.blogspot.com/
+License: MIT
+Version: 3.3
+
+You can also read this README in pretty html at the GitHub project Wiki page
+
+ http://github.com/josevalim/rails-footnotes/wikis/home
+
+
+Description
+-----------
+
+If you are developing in Rails you should know the plugin! It displays
+footnotes in your application for easy debugging, such as sessions,
+request parameters, cookies, filter chain, routes, queries, etc.
+
+Even more, it contains links to open files directly in your editor including
+your backtrace lines.
+
+
+Installation
+------------
+
+Install Rails Footnotes is very easy. It is stored in GitHub, so if you
+have never installed a gem via GitHub run the following:
+
+ gem sources -a http://gems.github.com
+
+Then install the gem:
+
+ sudo gem install josevalim-rails-footnotes
+
+In RAILS_ROOT/config/environments/development.rb (yes, you want it only in development):
+
+ config.gem "josevalim-rails-footnotes", :lib => "rails-footnotes", :source => "http://gems.github.com"
+
+If you want it as plugin, just do:
+
+ cd myapp
+ git clone git://github.com/josevalim/rails-footnotes.git
+ rm -rf vendor/plugins/rails-footnotes/.git
+
+
+Configuration
+-------------
+
+If you are not using Textmate as text editor, in your environment.rb or
+in an initializer do:
+
+ if defined?(Footnotes)
+ Footnotes::Filter.prefix = 'textmate://open?url=file://'
+ end
+
+Where you are going to choose a prefix compatible with your text editor. You can see
+how enable this behaviour in other editors in the link below:
+
+ http://josevalim.blogspot.com/2008/06/textmate-protocol-behavior-on-any.html
+
+By default, footnotes are appended at the end of the page with default stylesheet. If you want
+to change their position, you can define a div with id "footnotes_holder" or define your own stylesheet
+by turning footnotes stylesheet off:
+
+ Footnotes::Filter.no_style = true
+
+Another option is to allow multiple notes to be opened at the same time:
+
+ Footnotes::Filter.multiple_notes = true
+
+Finally, you can control which notes you want to show. The default are:
+
+ Footnotes::Filter.notes = [:session, :cookies, :params, :filters, :routes, :env, :queries, :log, :general]
+
+
+Early versions
+--------------
+
+If you are running on Rails 2.1.x, you should use Footnotes v3.2.2:
+
+ cd myapp
+ git clone git://github.com/josevalim/rails-footnotes.git
+ cd vendor/plugins/rails-footnotes
+ git checkout v3.2.2
+ rm -rf ./.git
+
+If you are using earlier than 2.1, please upgrade your app. =)
+
+
+Creating your own notes
+-----------------------
+
+Create your notes to integrate with Footnotes is easy.
+
+1. Create a Footnotes::Notes::YourExampleNote class
+
+2. Implement the necessary methods (check abstract_note.rb file in lib/notes)
+
+3. Append your example note in Footnotes::Filter.notes array (usually at the end of your environment file or in an initializer):
+
+For example, to create a note that shows info about the user logged in your application you just have to do:
+
+ module Footnotes
+ module Notes
+ class CurrentUserNote < AbstractNote
+ # This method always receives a controller
+ #
+ def initialize(controller)
+ @current_user = controller.instance_variable_get("@current_user")
+ end
+
+ # The name that will appear as legend in fieldsets
+ #
+ def legend
+ "Current user: #{@current_user.name}"
+ end
+
+ # This Note is only valid if we actually found an user
+ # If it's not valid, it won't be displayed
+ #
+ def valid?
+ @current_user
+ end
+
+ # The fieldset content
+ #
+ def content
+ escape(@current_user.inspect)
+ end
+ end
+ end
+ end
+
+Then put in your environment:
+
+ Footnotes::Filter.notes += [:current_user]
+
+
+Who?
+----
+
+Until version 2.0, this plugin was created and maintained by:
+
+Duane Johnson (duane.johnson@gmail.com)
+http://blog.inquirylabs.com/
View
@@ -1,133 +0,0 @@
-Footnotes plugin for Rails (v3.3)
----------------------------------
-
-If you are developing in Rails you should know the plugin!
-
-It displays footnotes in your application for easy debugging, such as sessions, request parameters, cookies, filter chain, routes, queries, etc.
-
-Even more, it contains links to open files directly in your editor (default is textmate). And if Rails get an error, it also appends text editor links to backtrace file lines.
-
-Installation
-============
-
-The current version is only Rails Edge (aka Rails 2.2) compatible. Scroll down to check how to install early versions.
-
-If you just want a static copy of the plugin:
-
- cd myapp
- git clone git://github.com/josevalim/rails-footnotes.git vendor/plugins/footnotes
- rm -rf vendor/plugins/footnotes/.git
-
-Early versions
-==============
-
-If you are running on Rails 2.1.x, you should use Footnotes v3.2.2:
-
- cd myapp
- git clone git://github.com/josevalim/rails-footnotes.git vendor/plugins/footnotes
- cd vendor/plugins/footnotes
- git checkout v3.2.2
- rm -rf ./.git
-
-If you are running on Rails 2.0.x, you should use Footnotes v3.0:
-
- cd myapp
- git clone git://github.com/josevalim/rails-footnotes.git vendor/plugins/footnotes
- cd vendor/plugins/footnotes
- git checkout v3.0
- rm -rf ./.git
-
-Usage
-=====
-
-* Footnotes are applied in all actions under development. If You want to change this behaviour, check the loader.rb file.
-
-* Some features only work by default if you are under MacOSX and using Textmate.
- If your editor supports out-of-the-box opening files like Textmate, e.g. txmt://open?url=file://path/to/file, you can put in your environment file the following line:
-
- Footnotes::Filter.prefix = "editor://open?file://"
-
- If it doesn't, you can enable this behavior in few steps. I've written a post about it [here](http://josevalim.blogspot.com/2008/06/textmate-protocol-behavior-on-any.html).
-
-* If you want to use your own stylesheet, you can disable the Footnotes stylesheet with:
-
- Footnotes::Filter.no_style = true
-
-* Footnotes are appended at the end of the page, but if your page has a div with id "footnotes_holder", Footnotes will be inserted into this div.
-
-* If you want to open multiple notes at the same time, just put in your enviroment:
-
- Footnotes::Filter.multiple_notes = true
-
-* Finally, you can cherry pick which notes you want to use, simply doing:
-
- Footnotes::Filter.notes = [:session, :cookies, :params, :filters, :routes, :env, :queries, :log, :general]
-
-Creating your own notes
-=======================
-
-Create your notes to integrate with Footnotes is easy.
-
-1. Create a Footnotes::Notes::YourExampleNote class
-
-2. Implement the necessary methods (check abstract_note.rb file in lib/notes)
-
-3. Append your example note in Footnotes::Filter.notes array (usually at the end of your environment file or in an initializer):
-
- Footnotes::Filter.notes += [:your_example]
-
-For example, to create a note that shows info about the user logged in your application you just have to do:
-
-<pre><code>module Footnotes
- module Notes
- class CurrentUserNote < AbstractNote
- # This method always receives a controller
- #
- def initialize(controller)
- @current_user = controller.instance_variable_get("@current_user")
- end
-
- # The name that will appear as legend in fieldsets
- #
- def legend
- "Current user: #{@current_user.name}"
- end
-
- # This Note is only valid if we actually found an user
- # If it's not valid, it won't be displayed
- #
- def valid?
- @current_user
- end
-
- # The fieldset content
- #
- def content
- escape(@current_user.inspect)
- end
- end
- end
-end</code></pre>
-
-Then put in your environment:
-
- Footnotes::Filter.notes += [:current_user]
-
-Who?
-====
-
-*Current Developer (v3.0 and above)*
-
-José Valim (jose.valim@gmail.com)
-http://josevalim.blogspot.com/
-
-
-*Original Author (v2.0)*
-
-Duane Johnson (duane.johnson@gmail.com)
-http://blog.inquirylabs.com/
-
-
-*License*
-
-See MIT License.
View
@@ -0,0 +1,47 @@
+Gem::Specification.new do |s|
+ s.name = "rails-footnoes"
+ s.version = "3.3"
+ s.date = "2009-01-02"
+ s.summary = "Every Rails page has footnotes that gives information about your application and links back to your editor."
+ s.email = "jose.valim@gmail.com"
+ s.homepage = "http://github.com/josevalim/rails-footnotes"
+ s.description = "Every Rails page has footnotes that gives information about your application and links back to your editor."
+ s.has_rdoc = true
+ s.authors = [ "José Valim" ]
+ s.files = [
+ "MIT-LICENSE",
+ "README",
+ "Rakefile",
+ "init.rb",
+ "lib/backtracer.rb",
+ "lib/footnotes.rb",
+ "lib/loader.rb",
+ "lib/notes/abstract_note.rb",
+ "lib/notes/components_note.rb",
+ "lib/notes/controller_note.rb",
+ "lib/notes/cookies_note.rb",
+ "lib/notes/env_note.rb",
+ "lib/notes/files_note.rb",
+ "lib/notes/filters_note.rb",
+ "lib/notes/general_note.rb",
+ "lib/notes/javascripts_note.rb",
+ "lib/notes/layout_note.rb",
+ "lib/notes/log_note.rb",
+ "lib/notes/params_note.rb",
+ "lib/notes/queries_note.rb",
+ "lib/notes/routes_note.rb",
+ "lib/notes/session_note.rb",
+ "lib/notes/stylesheets_note.rb",
+ "lib/notes/view_note.rb",
+ "test/footnotes_test.rb",
+ "test/test_helper.rb",
+ "test/notes/abstract_note_test.rb"
+ ]
+ s.test_files = [
+ "test/footnotes_test.rb",
+ "test/test_helper.rb",
+ "test/notes/abstract_note_test.rb"
+ ]
+ s.rdoc_options = ["--main", "README"]
+ s.extra_rdoc_files = ["README"]
+end

0 comments on commit 7417b6b

Please sign in to comment.