Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve README and gemspec

  • Loading branch information...
commit 56671ec002e11be15bf63245470630accfedc0eb 1 parent 138aa19
@khalsah authored
Showing with 31 additions and 5 deletions.
  1. +26 −5 README.rdoc
  2. +5 −0 pebkac.gemspec
View
31 README.rdoc
@@ -2,12 +2,33 @@
Raise exceptions with i18n messages
-== Example Usage
+== Usage
- require 'pebkac'
- class MyError < StandardError; end
- pebkac MyError
- pebkac MyError, :other_message
+1. Remember to setup your I18n load path!
+
+2. Require the gem:
+
+ <tt>require 'pebkac'</tt>
+
+3. Create your error classes as usual:
+
+ <tt>class MyError < StandardError; end</tt>
+
+4. Call Kernel#pebkac in place of Kernel#raise:
+
+ <tt>pebkac MyError</tt>
+
+ which is equivalent to
+
+ <tt>raise MyError, I18n.t(:my_error, :scope => :pebkac)</tt>
+
+5. Or do something more fancy
+
+ <tt>pebkac MyError, :the_msg_key, {:scope => :errors, :thing => 'Stuff'}, caller(3)</tt>
+
+ which turns into something like
+
+ <tt>raise MyError, I18n.t(:the_msg_key, :scope => :errors, :thing => 'Stuff'), caller(3)</tt>
== License
View
5 pebkac.gemspec
@@ -6,8 +6,13 @@ Gem::Specification.new do |s|
s.summary = %q{Raise exceptions with i18n messages}
s.license = 'MIT'
+ s.homepage = 'http://github.com/khalsah/pebkac'
+
s.files = `git ls-files`.split("\n")
s.require_paths = ['lib']
+ s.has_rdoc = true
+ s.extra_rdoc_files = ['README.rdoc']
+
s.add_runtime_dependency 'i18n', '~> 0.6.0'
end
Please sign in to comment.
Something went wrong with that request. Please try again.