markbates-distribunaut 0.0.2.20090406 → 0.1.20090406
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.
@@ -40,25 +40,13 @@ module Distribunaut # :nodoc:
|
|
40
40
|
|
41
41
|
end
|
42
42
|
}
|
43
|
-
obj = "Distribunaut::Distributed::#{base}Proxy".constantize.instance
|
43
|
+
obj = "Distribunaut::Distributed::#{base}Proxy".constantize.instance
|
44
|
+
raise Distribunaut::Distributed::Errors::ApplicationNameUndefined.new if configatron.distribunaut.app_name.nil?
|
44
45
|
Distribunaut::Distributed::Utils::Rinda.register_or_renew(:space => "#{base}".to_sym,
|
45
|
-
|
46
|
+
:object => obj,
|
47
|
+
:app_name => configatron.distribunaut.app_name)
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
49
51
|
end # Distributable
|
50
|
-
end # Distribunaut
|
51
|
-
|
52
|
-
module DRb # :nodoc:
|
53
|
-
class DRbObject # :nodoc:
|
54
|
-
|
55
|
-
alias_method :_original_inspect, :inspect unless method_defined?(:_original_inspect)
|
56
|
-
|
57
|
-
def inspect
|
58
|
-
"#{_original_inspect}|#{method_missing(:inspect)}"
|
59
|
-
end
|
60
|
-
|
61
|
-
undef :id if method_defined?(:id)
|
62
|
-
|
63
|
-
end
|
64
|
-
end
|
52
|
+
end # Distribunaut
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module DRb # :nodoc:
|
2
|
+
class DRbObject # :nodoc:
|
3
|
+
|
4
|
+
alias_method :_original_inspect, :inspect unless method_defined?(:_original_inspect)
|
5
|
+
|
6
|
+
def inspect
|
7
|
+
"#{_original_inspect}|#{method_missing(:inspect)}"
|
8
|
+
end
|
9
|
+
|
10
|
+
undef :id if method_defined?(:id)
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -7,8 +7,8 @@ module Distribunaut
|
|
7
7
|
options = handle_options(options)
|
8
8
|
begin
|
9
9
|
ring_server.take([options[:app_name], options[:space], nil, nil], options[:timeout])
|
10
|
-
rescue
|
11
|
-
#
|
10
|
+
rescue ::Rinda::RequestExpiredError => e
|
11
|
+
# it's ok that it expired. It could be that it was never registered.
|
12
12
|
end
|
13
13
|
register(options)
|
14
14
|
end
|
@@ -39,8 +39,7 @@ module Distribunaut
|
|
39
39
|
|
40
40
|
private
|
41
41
|
def self.handle_options(options = {})
|
42
|
-
|
43
|
-
{:app_name => configatron.distribunaut.app_name,
|
42
|
+
{:app_name => nil,
|
44
43
|
:space => nil,
|
45
44
|
:object => nil,
|
46
45
|
:description => nil,
|
data/lib/distribunaut.rb
CHANGED
@@ -9,13 +9,9 @@ require 'activesupport'
|
|
9
9
|
|
10
10
|
base = File.join(File.dirname(__FILE__), 'distribunaut')
|
11
11
|
|
12
|
-
configatron.distribunaut.set_default(:share_routes, false)
|
13
12
|
configatron.distribunaut.set_default(:share_objects, false)
|
14
|
-
configatron.distribunaut.set_default(:share_views, false)
|
15
13
|
configatron.distribunaut.set_default(:app_name, nil)
|
16
|
-
configatron.distribunaut.set_default(:site_domain, nil)
|
17
14
|
configatron.distribunaut.set_default(:timeout, 0)
|
18
|
-
configatron.distribunaut.set_default(:enable_view_cache, false)
|
19
15
|
|
20
16
|
# load *.rb files
|
21
17
|
Dir.glob(File.join(base, "**", "*.rb")).each do |f|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markbates-distribunaut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.20090406
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- lib/distribunaut/distributable.rb
|
65
65
|
- lib/distribunaut/distributed.rb
|
66
66
|
- lib/distribunaut/errors/errors.rb
|
67
|
+
- lib/distribunaut/extensions/drb_object.rb
|
67
68
|
- lib/distribunaut/tasks/ring_server_tasks.rake
|
68
69
|
- lib/distribunaut/utils/rinda.rb
|
69
70
|
- lib/distribunaut.rb
|