tagful 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tagful.rb +15 -25
- data/lib/tagful/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: 5883fe7c03181fd6e9d52dfdbe953c20fd4c173b
|
4
|
+
data.tar.gz: bbcbcf4ccd3b0e91dc39b67f1e2a51aab4871532
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b84a691bb79d3e067b6b1d23c6340a7b13d85fbe4709c54571ec6a556f2fb890fe5e010aa7f9d65cd85a528b4e67a905f6d0901ec9c55bc429a46e547050ecf4
|
7
|
+
data.tar.gz: 9f4fce6ed1c38ec07d3db335eca5730436c53d2554e3a34f2c4d587babcab0efee4eb8c6b34004cdc4e42bf653b712282c5399183f6707041691ecf97d6bbde8
|
data/lib/tagful.rb
CHANGED
@@ -42,10 +42,18 @@ module Tagful
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
if error_class
|
46
|
-
|
45
|
+
if error_class.nil? && error_module == DEFAULT_ERROR_MODULE_NAME
|
46
|
+
error_module = class_eval(<<-CODE)
|
47
|
+
unless defined?(#{error_module})
|
48
|
+
module #{error_module}; end
|
49
|
+
end
|
50
|
+
#{error_module}
|
51
|
+
CODE
|
52
|
+
end
|
47
53
|
|
48
|
-
|
54
|
+
tagful_methods_module = class_eval('module TagfulMethods; self; end')
|
55
|
+
tagful_methods_module.module_eval do
|
56
|
+
if error_class
|
49
57
|
define_method(method_id) do |*args, &block|
|
50
58
|
begin
|
51
59
|
super(*args, &block)
|
@@ -53,24 +61,7 @@ module Tagful
|
|
53
61
|
raise error_class, e.message
|
54
62
|
end
|
55
63
|
end
|
56
|
-
|
57
|
-
end
|
58
|
-
|
59
|
-
class_eval do
|
60
|
-
prepend(m)
|
61
|
-
end
|
62
|
-
else
|
63
|
-
if error_module == DEFAULT_ERROR_MODULE_NAME
|
64
|
-
error_module = class_eval(<<-CODE)
|
65
|
-
unless defined?(#{error_module})
|
66
|
-
module #{error_module}; end
|
67
|
-
end
|
68
|
-
#{error_module}
|
69
|
-
CODE
|
70
|
-
end
|
71
|
-
|
72
|
-
m = class_eval('module TagfulMethods; end; TagfulMethods')
|
73
|
-
m.module_eval do
|
64
|
+
else
|
74
65
|
define_method(method_id) do |*args, &block|
|
75
66
|
begin
|
76
67
|
super(*args, &block)
|
@@ -78,12 +69,11 @@ module Tagful
|
|
78
69
|
e.extend(error_module) and raise
|
79
70
|
end
|
80
71
|
end
|
81
|
-
send visibility, method_id
|
82
|
-
end
|
83
|
-
class_eval do
|
84
|
-
prepend(m)
|
85
72
|
end
|
73
|
+
send visibility, method_id
|
86
74
|
end
|
75
|
+
class_eval { prepend(tagful_methods_module) }
|
76
|
+
|
87
77
|
method_id
|
88
78
|
end
|
89
79
|
end
|
data/lib/tagful/version.rb
CHANGED