dm-noisy-failures 0.1.2 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -24,27 +24,16 @@ module DataMapper
|
|
24
24
|
false
|
25
25
|
end
|
26
26
|
|
27
|
+
@@original_included_method = self.method(:included) rescue nil
|
28
|
+
|
27
29
|
def self.included(base)
|
30
|
+
@@original_included_method.call(base) unless @@original_included_method.nil?
|
31
|
+
|
28
32
|
def base.create?(*args)
|
29
33
|
self.create(*args)
|
30
34
|
rescue => e
|
31
35
|
nil
|
32
36
|
end
|
33
37
|
end
|
34
|
-
|
35
|
-
# If any library authors have overridden this, we're screwed.
|
36
|
-
# TODO: Figure out if it's possible to detect that case.
|
37
|
-
original_include_method = Class.instance_method(:include?)
|
38
|
-
|
39
|
-
# TODO: Maybe look into not just duplicating the above code here?
|
40
|
-
ObjectSpace.each_object(Class).each do |existing_class|
|
41
|
-
if original_include_method.bind(existing_class).call(Resource)
|
42
|
-
def existing_class.create?(*args)
|
43
|
-
self.create(*args)
|
44
|
-
rescue => e
|
45
|
-
nil
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
38
|
end
|
50
39
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "data_mapper/noisy_failures"
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-noisy-failures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
- 1
|
9
8
|
- 2
|
10
|
-
version: 0.
|
9
|
+
version: "0.2"
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Daniel Tao
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2013-01-28 00:00:00 -08:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -46,8 +45,8 @@ extra_rdoc_files: []
|
|
46
45
|
|
47
46
|
files:
|
48
47
|
- lib/data_mapper/noisy_failures/version.rb
|
49
|
-
- lib/data_mapper/
|
50
|
-
- lib/
|
48
|
+
- lib/data_mapper/noisy_failures.rb
|
49
|
+
- lib/dm_noisy_failures.rb
|
51
50
|
has_rdoc: true
|
52
51
|
homepage: http://github.com/dtao/dm-noisy-failures
|
53
52
|
licenses: []
|
data/lib/dm-noisy-failures.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require "data_mapper/resource"
|