From 98c106292ec51255f4dff1d5cbe60391676d9531 Mon Sep 17 00:00:00 2001 From: Luca Guidi Date: Sat, 12 Jul 2008 14:39:41 +0200 Subject: [PATCH] rdoc formatting --- README | 50 +++++++++---------- lib/sashimi.rb | 23 +++++++++ lib/sashimi/core_ext/array.rb | 11 ++-- lib/sashimi/plugin.rb | 7 ++- .../repositories/abstract_repository.rb | 1 + 5 files changed, 57 insertions(+), 35 deletions(-) diff --git a/README b/README index 0d19bf7..4c8f9b6 100644 --- a/README +++ b/README @@ -1,82 +1,80 @@ -Sashimi -======= += Sashimi Sashimi is a Rails plugins manager. + It allows to install your favourite plugins in a local repository and add them to your Rails apps. The main goal is to allow the plugins offline installation. -Installation -============ += Installation -$ (sudo) gem install sashimi + $ (sudo) gem install sashimi or -$ (sudo) gem install jodosha-sashimi --source=http://gems.github.com + $ (sudo) gem install jodosha-sashimi --source=http://gems.github.com -Usage -===== += Usage Install a plugin from a subversion URL: -$ sashimi install http://dev.rubyonrails.com/svn/rails/plugins/continuous_builder + $ sashimi install http://dev.rubyonrails.com/svn/rails/plugins/continuous_builder Install a plugin from a git URL: -$ sashimi install git://github.com/jodosha/click-to-globalize.git + $ sashimi install git://github.com/jodosha/click-to-globalize.git Uninstall a plugin: -$ sashimi uninstall continuous_builder + $ sashimi uninstall continuous_builder Update a plugin: -$ sashimi update click-to-globalize + $ sashimi update click-to-globalize Update a plugin of a Rails app: -$ sashimi update --rails click-to-globalize + $ sashimi update --rails click-to-globalize NOTE: If your application is versioned with Svn or Git, Sashimi will automatically schedules for add/remove the added/removed files. List all installed plugins: -$ sashimi list + $ sashimi list Add installed plugin(s) to a Rails app: -$ sashimi add click-to-globalize -$ sashimi install --rails click-to-globalize + $ sashimi add click-to-globalize +or + $ sashimi install --rails click-to-globalize -Known And Common Issues -======================= += Known And Common Issues * When add a plugin to an app, make sure your current directory is the rails root. * Only Subversion and Git repositories are currently supported. -Contribute -========== += Contribute * Check out the code and test it: + $ git clone git://github.com/jodosha/sashimi.git + $ rake -* Create a ticket to: http://sushistar.lighthouseapp.com +* Create a ticket to the {Sushistar Lighthouse page}[http://sushistar.lighthouseapp.com] * Create a patch and add as attachement to the ticket. -Credits -======= += Credits Partially inspired to RaPT[http://rapt.rubyforge.org/]. -Home Page -========= -http://lucaguidi.com/pages/sashimi += Home Page + +The Sashimi homepage is http://lucaguidi.com/pages/sashimi diff --git a/lib/sashimi.rb b/lib/sashimi.rb index 783dcd5..0ad9fd7 100644 --- a/lib/sashimi.rb +++ b/lib/sashimi.rb @@ -1,3 +1,26 @@ +#-- +# Copyright (c) 2008 Luca Guidi +# +# 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. +#++ + $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) diff --git a/lib/sashimi/core_ext/array.rb b/lib/sashimi/core_ext/array.rb index a2c0af7..fb7dd2c 100644 --- a/lib/sashimi/core_ext/array.rb +++ b/lib/sashimi/core_ext/array.rb @@ -1,9 +1,10 @@ class Array # Transform the current +Array+ to a path. - # It's an alias for +File#join+ # - # %w(path to app).to_path # => path/to/app - # %w(path to app).to_path(true) # => /Users/luca/path/to/app + # It's an alias for File#join. + # + # %w(path to app).to_path # => path/to/app+ + # %w(path to app).to_path(true) # => /Users/luca/path/to/app def to_path(absolute = false) path = File.join(self) path = File.expand_path(path) if absolute @@ -12,8 +13,8 @@ def to_path(absolute = false) # Transform the current +Array+ to an absolute path. # - # %w(path to app).to_absolute_path # => /Users/luca/path/to/app - # %w(path to app).to_abs_path # => /Users/luca/path/to/app + # %w(path to app).to_absolute_path # => /Users/luca/path/to/app + # %w(path to app).to_abs_path # => /Users/luca/path/to/app def to_absolute_path to_path(true) end diff --git a/lib/sashimi/plugin.rb b/lib/sashimi/plugin.rb index 596656c..f5e00ea 100644 --- a/lib/sashimi/plugin.rb +++ b/lib/sashimi/plugin.rb @@ -30,9 +30,8 @@ def add def repository #:nodoc: @repository ||= instantiate_repository end - - # Read the content of the about.yml. - # New feature of Rails 2.1.x http:://dev.rubyonrails.org/changeset/9098 + + # Returns the informations about the plugin. def about @about ||= repository.about end @@ -52,7 +51,7 @@ def guess_name name end - # Serialize the plugin to Hash format. + # Serialize the plugin to +Hash+ format. def to_hash { self.guess_name => { 'type' => repository.scm_type, diff --git a/lib/sashimi/repositories/abstract_repository.rb b/lib/sashimi/repositories/abstract_repository.rb index b3fa856..5dd3ed3 100644 --- a/lib/sashimi/repositories/abstract_repository.rb +++ b/lib/sashimi/repositories/abstract_repository.rb @@ -223,6 +223,7 @@ def scm_type end # Read the content of the about.yml. + # # New feature of Rails 2.1.0 http://github.com/rails/rails/commit/f5b991d76dc5d21f1870da067fb3101440256fba def about with_path plugin_path do