ohno 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +28 -0
- data/lib/ohno.rb +21 -0
- data/lib/ohno/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70e8a2140170d1dca7f9ac8f7cfe8c7d63ef93b3
|
|
4
|
+
data.tar.gz: 92471eede85b6031582a65f9dde2e90c7dd527ef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 904d8c244434a721c002b0633f2e4f2595f2e72d742c980e6333d6368192a1c427e6854645777f0739110b2816e7527f77e4bb2acf31ce4ab43b770cd7ad4037
|
|
7
|
+
data.tar.gz: 59f6ec69cb26ff0e27ad71c9678663e90a4bb3b7a380d2718f1877f695ce7186eaf7007d885eaf46e7bc54318f4639a07cc4aee95db547529642f0b985484f04
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -3,11 +3,31 @@
|
|
|
3
3
|
Do you ever feel like you don't even know where your errors are coming from? Try OhNo! With OhNo, you'll know exactly how those bugs got there - you put them there!
|
|
4
4
|
|
|
5
5
|
Have trouble with recursion? Just call stack_overflow method and call it a day!
|
|
6
|
+
|
|
6
7
|
Not so good with math? Try out divide_by_zero!
|
|
8
|
+
|
|
7
9
|
Need to buy some time? An infinite_loop is the one for you!
|
|
8
10
|
|
|
9
11
|
Try these and much, much more!
|
|
10
12
|
|
|
13
|
+
##Installation
|
|
14
|
+
|
|
15
|
+
Add this line to your application's Gemfile:
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
gem 'ohno'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
And then execute:
|
|
22
|
+
```ruby
|
|
23
|
+
$ bundle
|
|
24
|
+
```
|
|
25
|
+
Or install it yourself as:
|
|
26
|
+
```ruby
|
|
27
|
+
$ gem install ohno
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
11
31
|
##Usage
|
|
12
32
|
|
|
13
33
|
Just slip any of these methods into your code and enjoy!
|
|
@@ -19,4 +39,12 @@ OhNo::index_error
|
|
|
19
39
|
OhNo::type_error
|
|
20
40
|
OhNo::no_method_error
|
|
21
41
|
OhNo::argument_error
|
|
42
|
+
OhNo::load_error
|
|
43
|
+
OhNo::syntax_error
|
|
44
|
+
OhNo::i_wouldnt_if_i_were_you
|
|
45
|
+
|
|
22
46
|
```
|
|
47
|
+
|
|
48
|
+
## Contributing
|
|
49
|
+
|
|
50
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/DouglasTGordon/OhNo.
|
data/lib/ohno.rb
CHANGED
|
@@ -32,6 +32,27 @@ module OhNo
|
|
|
32
32
|
i_take_one_argument("Here's", "a", "bunch", "of", "arguments")
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
def self.load_error
|
|
36
|
+
require 'totally/a/real/file'
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.syntax_error
|
|
40
|
+
eval("1+1=2")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.i_wouldnt_if_i_were_you
|
|
44
|
+
begin
|
|
45
|
+
uhoh
|
|
46
|
+
rescue Exception => e
|
|
47
|
+
p "told you so!"
|
|
48
|
+
retry while true
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def self.regex_error
|
|
53
|
+
Regexp.new("?")
|
|
54
|
+
end
|
|
55
|
+
|
|
35
56
|
private
|
|
36
57
|
|
|
37
58
|
def i_take_one_argument(arg)
|
data/lib/ohno/version.rb
CHANGED