nestegg 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +1 -0
- data/README.txt +1 -0
- data/Rakefile +2 -2
- data/examples/nestegg_example.rb +24 -0
- data/lib/nestegg/nesting_exception.rb +1 -1
- data/lib/nestegg/version.rb +1 -1
- data/test/nestegg/nesting_exception_test.rb +3 -3
- data/test/nestegg_test.rb +0 -3
- data/website/index.html +37 -12
- data/website/index.txt +36 -10
- data/website/template.rhtml +2 -1
- metadata +5 -4
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
data/Rakefile
CHANGED
@@ -13,8 +13,8 @@ include FileUtils
|
|
13
13
|
require File.join(File.dirname(__FILE__), 'lib', 'nestegg', 'version')
|
14
14
|
|
15
15
|
AUTHOR = 'John D. Hume' # can also be an array of Authors
|
16
|
-
EMAIL = ""
|
17
|
-
DESCRIPTION = "Nestegg provides a facility for nesting exceptions in Ruby"
|
16
|
+
EMAIL = "duelin dot markers at gmail"
|
17
|
+
DESCRIPTION = "Nestegg provides a facility for nesting exceptions in Ruby."
|
18
18
|
GEM_NAME = 'nestegg' # what ppl will type to install your gem
|
19
19
|
|
20
20
|
@config_file = "~/.rubyforge/user-config.yml"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'nestegg'
|
3
|
+
|
4
|
+
class ConfigurationError < StandardError
|
5
|
+
include Nestegg::NestingException
|
6
|
+
end
|
7
|
+
|
8
|
+
def read_config_file
|
9
|
+
File.open('missing_config_file') do |f|
|
10
|
+
f.readlines
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def load_config
|
15
|
+
begin
|
16
|
+
lines = read_config_file
|
17
|
+
# ... then use it to do stuff
|
18
|
+
# ... stuff that might fail for other reasons
|
19
|
+
rescue
|
20
|
+
raise ConfigurationError
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
load_config
|
data/lib/nestegg/version.rb
CHANGED
@@ -24,14 +24,14 @@ class NestingExceptionTest < Test::Unit::TestCase
|
|
24
24
|
test "includes cause in backtrace" do
|
25
25
|
cause = create_cause(StandardError)
|
26
26
|
with_exception TestNestingError.new("some message", cause) do |e|
|
27
|
-
assert_true e.backtrace.include?("
|
27
|
+
assert_true e.backtrace.include?("cause: StandardError: #{cause.message}")
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
test "includes cause and its backtrace in backtrace" do
|
32
32
|
cause = create_cause(StandardError)
|
33
33
|
with_exception TestNestingError.new("some message", cause) do |e|
|
34
|
-
assert_equal ["
|
34
|
+
assert_equal ["cause: StandardError: #{cause.message}", "line_one", "line_two"], e.backtrace[-3..-1]
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -42,7 +42,7 @@ class NestingExceptionTest < Test::Unit::TestCase
|
|
42
42
|
raise TestNestingError.new("msg", cause)
|
43
43
|
rescue TestNestingError => e
|
44
44
|
assert_match(/#{__FILE__}:\d+:in `test_.+'$/, e.backtrace[0])
|
45
|
-
assert_equal "
|
45
|
+
assert_equal "cause: StandardError: msg", e.backtrace[1]
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
data/test/nestegg_test.rb
CHANGED
@@ -2,9 +2,6 @@ require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')
|
|
2
2
|
|
3
3
|
class NesteggTest < Test::Unit::TestCase
|
4
4
|
|
5
|
-
def setup
|
6
|
-
end
|
7
|
-
|
8
5
|
def test_truth
|
9
6
|
puts "HEY! delete #{__FILE__} if the module is just a namespace, or else test that it requires the right stuff"
|
10
7
|
end
|
data/website/index.html
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
7
|
<title>
|
8
|
-
|
8
|
+
Nestegg
|
9
9
|
</title>
|
10
10
|
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
11
|
<style>
|
@@ -30,10 +30,10 @@
|
|
30
30
|
<body>
|
31
31
|
<div id="main">
|
32
32
|
|
33
|
-
<h1>
|
33
|
+
<h1>Nestegg</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/nestegg"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/nestegg" class="numbers">0.0.
|
36
|
+
<a href="http://rubyforge.org/projects/nestegg" class="numbers">0.0.2</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘nestegg’</h1>
|
39
39
|
|
@@ -47,30 +47,54 @@
|
|
47
47
|
<h2>Installing</h2>
|
48
48
|
|
49
49
|
|
50
|
-
<pre
|
50
|
+
<pre>sudo gem install nestegg</pre>
|
51
51
|
|
52
52
|
<h2>The basics</h2>
|
53
53
|
|
54
54
|
|
55
|
-
<p
|
55
|
+
<p>Sometimes exceptions cause other exceptions. Nestegg aims to make it easier to raise exceptions with useful contextual information without loss of detail about the underlying exception.</p>
|
56
56
|
|
57
57
|
|
58
58
|
<h2>Demonstration of usage</h2>
|
59
59
|
|
60
60
|
|
61
|
-
|
61
|
+
<pre syntax="ruby">require 'rubygems'
|
62
|
+
require 'nestegg'
|
62
63
|
|
64
|
+
class ConfigurationError < StandardError
|
65
|
+
include Nestegg::NestingException
|
66
|
+
end
|
63
67
|
|
64
|
-
|
68
|
+
def read_config_file
|
69
|
+
File.open('missing_config_file') do |f|
|
70
|
+
f.readlines
|
71
|
+
end
|
72
|
+
end
|
65
73
|
|
74
|
+
def load_config
|
75
|
+
begin
|
76
|
+
lines = read_config_file
|
77
|
+
# ... then use it to do stuff
|
78
|
+
# ... stuff that might fail for other reasons
|
79
|
+
rescue
|
80
|
+
raise ConfigurationError
|
81
|
+
end
|
82
|
+
end
|
66
83
|
|
67
|
-
|
84
|
+
load_config</pre>
|
68
85
|
|
86
|
+
<p>outputs</p>
|
69
87
|
|
70
|
-
<h2>How to submit patches</h2>
|
71
88
|
|
89
|
+
<pre>nestegg_example.rb:20:in `load_config': ConfigurationError (ConfigurationError)
|
90
|
+
from cause: Errno::ENOENT: No such file or directory - missing_config_file
|
91
|
+
from nestegg_example.rb:9:in `initialize'
|
92
|
+
from nestegg_example.rb:9:in `open'
|
93
|
+
from nestegg_example.rb:9:in `read_config_file'
|
94
|
+
from nestegg_example.rb:16:in `load_config'
|
95
|
+
from nestegg_example.rb:24</pre>
|
72
96
|
|
73
|
-
<
|
97
|
+
<h2>Code</h2>
|
74
98
|
|
75
99
|
|
76
100
|
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/nestegg/trunk</code> for anonymous access.</p>
|
@@ -85,9 +109,10 @@
|
|
85
109
|
<h2>Contact</h2>
|
86
110
|
|
87
111
|
|
88
|
-
<p>Comments are welcome. Contact me via <a href="http://elhumidor.blogspot.com/">my blog</a> or
|
112
|
+
<p>Comments are welcome. Contact me via <a href="http://elhumidor.blogspot.com/">my blog</a> or email.</p>
|
89
113
|
<p class="coda">
|
90
|
-
|
114
|
+
Last modified 26th June 2007<br>
|
115
|
+
This website generated by the <a href="http://newgem.rubyforge.org/">New Gem Generator</a> by <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a><br>
|
91
116
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
92
117
|
</p>
|
93
118
|
</div>
|
data/website/index.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
h1.
|
1
|
+
h1. Nestegg
|
2
2
|
|
3
3
|
h1. → 'nestegg'
|
4
4
|
|
@@ -9,23 +9,50 @@ Nestegg provides a nested exception facility for Ruby.
|
|
9
9
|
|
10
10
|
h2. Installing
|
11
11
|
|
12
|
-
<pre
|
12
|
+
<pre>sudo gem install nestegg</pre>
|
13
13
|
|
14
14
|
h2. The basics
|
15
15
|
|
16
|
-
|
16
|
+
Sometimes exceptions cause other exceptions. Nestegg aims to make it easier to raise exceptions with useful contextual information without loss of detail about the underlying exception.
|
17
17
|
|
18
18
|
h2. Demonstration of usage
|
19
19
|
|
20
|
-
|
20
|
+
<pre syntax="ruby">require 'rubygems'
|
21
|
+
require 'nestegg'
|
21
22
|
|
22
|
-
|
23
|
+
class ConfigurationError < StandardError
|
24
|
+
include Nestegg::NestingException
|
25
|
+
end
|
23
26
|
|
24
|
-
|
27
|
+
def read_config_file
|
28
|
+
File.open('missing_config_file') do |f|
|
29
|
+
f.readlines
|
30
|
+
end
|
31
|
+
end
|
25
32
|
|
26
|
-
|
33
|
+
def load_config
|
34
|
+
begin
|
35
|
+
lines = read_config_file
|
36
|
+
# ... then use it to do stuff
|
37
|
+
# ... stuff that might fail for other reasons
|
38
|
+
rescue
|
39
|
+
raise ConfigurationError
|
40
|
+
end
|
41
|
+
end
|
27
42
|
|
28
|
-
|
43
|
+
load_config</pre>
|
44
|
+
|
45
|
+
outputs
|
46
|
+
|
47
|
+
<pre>nestegg_example.rb:20:in `load_config': ConfigurationError (ConfigurationError)
|
48
|
+
from cause: Errno::ENOENT: No such file or directory - missing_config_file
|
49
|
+
from nestegg_example.rb:9:in `initialize'
|
50
|
+
from nestegg_example.rb:9:in `open'
|
51
|
+
from nestegg_example.rb:9:in `read_config_file'
|
52
|
+
from nestegg_example.rb:16:in `load_config'
|
53
|
+
from nestegg_example.rb:24</pre>
|
54
|
+
|
55
|
+
h2. Code
|
29
56
|
|
30
57
|
The trunk repository is <code>svn://rubyforge.org/var/svn/nestegg/trunk</code> for anonymous access.
|
31
58
|
|
@@ -35,6 +62,5 @@ This code is free to use under the terms of the MIT license.
|
|
35
62
|
|
36
63
|
h2. Contact
|
37
64
|
|
38
|
-
Comments are welcome. Contact me via "my blog":http://elhumidor.blogspot.com/ or
|
65
|
+
Comments are welcome. Contact me via "my blog":http://elhumidor.blogspot.com/ or email.
|
39
66
|
|
40
|
-
This site generated by newgem.
|
data/website/template.rhtml
CHANGED
@@ -37,7 +37,8 @@
|
|
37
37
|
</div>
|
38
38
|
<%= body %>
|
39
39
|
<p class="coda">
|
40
|
-
|
40
|
+
Last modified <%= modified.pretty %><br>
|
41
|
+
This website generated by the <a href="http://newgem.rubyforge.org/">New Gem Generator</a> by <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a><br>
|
41
42
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
42
43
|
</p>
|
43
44
|
</div>
|
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: nestegg
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
6
|
+
version: 0.0.2
|
7
7
|
date: 2007-06-26 00:00:00 -04:00
|
8
|
-
summary: Nestegg provides a facility for nesting exceptions in Ruby
|
8
|
+
summary: Nestegg provides a facility for nesting exceptions in Ruby.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
|
-
email:
|
11
|
+
email: duelin dot markers at gmail
|
12
12
|
homepage: http://nestegg.rubyforge.org
|
13
13
|
rubyforge_project: nestegg
|
14
|
-
description: Nestegg provides a facility for nesting exceptions in Ruby
|
14
|
+
description: Nestegg provides a facility for nesting exceptions in Ruby.
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- Manifest.txt
|
35
35
|
- README.txt
|
36
36
|
- Rakefile
|
37
|
+
- examples/nestegg_example.rb
|
37
38
|
- lib/nestegg.rb
|
38
39
|
- lib/nestegg/nesting_exception.rb
|
39
40
|
- lib/nestegg/version.rb
|