acts_as_crazy 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/acts_as_crazy/crazy.rb +35 -0
- data/lib/acts_as_crazy/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ead82dec8cde4854134f84a89039eeea9b310ce48446036ef3aebaf655ad1dab
|
4
|
+
data.tar.gz: ac0243050636ba8d5b331736cd58f17b2a09dfb8cbae3cd8331ea99cbcdea0e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6551643a5c5f202d35169543c4f516f6875c5f2daf3cd447f2ad8f04118e07f0db211a5adebfe6783cbb02057b591d1f9c1c3784c9a8d208cd2322dfb2c2c3c
|
7
|
+
data.tar.gz: a92c5a9c8e8dac79780f17653c1cd3fabaab243b98e8ef888caf3d3b64fadcf0083d02fa3d702972c1fa1b6e7a48756096b10ce3a16bdc31853aabc0bd503095
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
module ActsAsCrazy
|
2
|
+
module Crazy
|
3
|
+
|
4
|
+
class << self
|
5
|
+
def included(klass)
|
6
|
+
class << klass
|
7
|
+
alias_method :__new, :new
|
8
|
+
def new(*args)
|
9
|
+
e = __new(*args)
|
10
|
+
|
11
|
+
method_names = e.methods - Object.new.methods
|
12
|
+
method_names.each do |method_name|
|
13
|
+
e.define_singleton_method :woof do |*args, &block|
|
14
|
+
do_something_crazy
|
15
|
+
super(*args, &block)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
e
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def do_something_crazy
|
28
|
+
raise ActsAsCrazy::CrazyError.new("Sorry, I'm crazy. Did you know that #{Faker::ChuckNorris.fact}") if am_i_crazy?
|
29
|
+
end
|
30
|
+
|
31
|
+
def am_i_crazy?
|
32
|
+
(rand*100) < 50
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_crazy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Israel De La Hoz
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- bin/console
|
85
85
|
- bin/setup
|
86
86
|
- lib/acts_as_crazy.rb
|
87
|
+
- lib/acts_as_crazy/crazy.rb
|
87
88
|
- lib/acts_as_crazy/version.rb
|
88
89
|
homepage: http://github.com/idelahoz
|
89
90
|
licenses: []
|