promiscuous 0.8.5 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,8 +3,8 @@ module Promiscuous::Common::ClassHelpers
|
|
3
3
|
|
4
4
|
module ClassMethods
|
5
5
|
def guess_class_name(separator)
|
6
|
+
return nil if name.nil?
|
6
7
|
class_name = name.split("::").reverse.take_while { |name| name != separator }.reverse.join('::')
|
7
|
-
class_name = "::#{class_name}"
|
8
8
|
class_name = $1 if class_name =~ /^(.+)#{separator.singularize}$/
|
9
9
|
class_name
|
10
10
|
end
|
@@ -24,11 +24,8 @@ module Promiscuous::Publisher::Class
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def klass
|
27
|
-
if
|
28
|
-
|
29
|
-
elsif name
|
30
|
-
guess_class_name('Publishers').constantize
|
31
|
-
end
|
27
|
+
return nil if name.nil?
|
28
|
+
"::#{super ? super : guess_class_name('Publishers')}".constantize
|
32
29
|
end
|
33
30
|
end
|
34
31
|
end
|
@@ -10,11 +10,8 @@ module Promiscuous::Subscriber::Class
|
|
10
10
|
|
11
11
|
module ClassMethods
|
12
12
|
def klass
|
13
|
-
if
|
14
|
-
|
15
|
-
elsif name
|
16
|
-
guess_class_name('Subscribers').constantize
|
17
|
-
end
|
13
|
+
return nil if name.nil?
|
14
|
+
"::#{super ? super : guess_class_name('Subscribers')}".constantize
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
@@ -10,11 +10,7 @@ module Promiscuous::Subscriber::Polymorphic
|
|
10
10
|
|
11
11
|
module ClassMethods
|
12
12
|
def from_type
|
13
|
-
|
14
|
-
|
15
|
-
if name
|
16
|
-
guess_class_name('Subscribers')
|
17
|
-
end
|
13
|
+
super ? super : guess_class_name('Subscribers')
|
18
14
|
end
|
19
15
|
|
20
16
|
def from_type=(value)
|
data/lib/promiscuous/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promiscuous
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-09-
|
13
|
+
date: 2012-09-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|