pebkac 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +26 -5
- data/pebkac.gemspec +6 -1
- metadata +6 -5
data/README.rdoc
CHANGED
@@ -2,12 +2,33 @@
|
|
2
2
|
|
3
3
|
Raise exceptions with i18n messages
|
4
4
|
|
5
|
-
==
|
5
|
+
== Usage
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
1. Remember to setup your I18n load path!
|
8
|
+
|
9
|
+
2. Require the gem:
|
10
|
+
|
11
|
+
<tt>require 'pebkac'</tt>
|
12
|
+
|
13
|
+
3. Create your error classes as usual:
|
14
|
+
|
15
|
+
<tt>class MyError < StandardError; end</tt>
|
16
|
+
|
17
|
+
4. Call Kernel#pebkac in place of Kernel#raise:
|
18
|
+
|
19
|
+
<tt>pebkac MyError</tt>
|
20
|
+
|
21
|
+
which is equivalent to
|
22
|
+
|
23
|
+
<tt>raise MyError, I18n.t(:my_error, :scope => :pebkac)</tt>
|
24
|
+
|
25
|
+
5. Or do something more fancy
|
26
|
+
|
27
|
+
<tt>pebkac MyError, :the_msg_key, {:scope => :errors, :thing => 'Stuff'}, caller(3)</tt>
|
28
|
+
|
29
|
+
which turns into something like
|
30
|
+
|
31
|
+
<tt>raise MyError, I18n.t(:the_msg_key, :scope => :errors, :thing => 'Stuff'), caller(3)</tt>
|
11
32
|
|
12
33
|
== License
|
13
34
|
|
data/pebkac.gemspec
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'pebkac'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.2'
|
4
4
|
s.authors = ['Hargobind S. Khalsa']
|
5
5
|
s.email = ['khalsah@gmail.com']
|
6
6
|
s.summary = %q{Raise exceptions with i18n messages}
|
7
7
|
s.license = 'MIT'
|
8
8
|
|
9
|
+
s.homepage = 'http://github.com/khalsah/pebkac'
|
10
|
+
|
9
11
|
s.files = `git ls-files`.split("\n")
|
10
12
|
s.require_paths = ['lib']
|
11
13
|
|
14
|
+
s.has_rdoc = true
|
15
|
+
s.extra_rdoc_files = ['README.rdoc']
|
16
|
+
|
12
17
|
s.add_runtime_dependency 'i18n', '~> 0.6.0'
|
13
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pebkac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-09-02 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
16
|
-
requirement: &
|
16
|
+
requirement: &21386620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,19 +21,20 @@ dependencies:
|
|
21
21
|
version: 0.6.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *21386620
|
25
25
|
description:
|
26
26
|
email:
|
27
27
|
- khalsah@gmail.com
|
28
28
|
executables: []
|
29
29
|
extensions: []
|
30
|
-
extra_rdoc_files:
|
30
|
+
extra_rdoc_files:
|
31
|
+
- README.rdoc
|
31
32
|
files:
|
32
33
|
- .gitignore
|
33
34
|
- README.rdoc
|
34
35
|
- lib/pebkac.rb
|
35
36
|
- pebkac.gemspec
|
36
|
-
homepage:
|
37
|
+
homepage: http://github.com/khalsah/pebkac
|
37
38
|
licenses:
|
38
39
|
- MIT
|
39
40
|
post_install_message:
|