Sutto-marvin 0.2.3 → 0.2.4

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.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- patch: 3
2
+ patch: 4
3
3
  major: 0
4
4
  minor: 2
@@ -15,6 +15,24 @@ module Marvin
15
15
  class RemoteInterface
16
16
  include DRbUndumped
17
17
 
18
+ # Attempts to find a running IRC server,
19
+ # returning an instance of it if it exists.
20
+ def self.primary
21
+ DRb.start_service
22
+ begin
23
+ rs = Rinda::RingFinger.primary
24
+ server = rs.read_all([:marvin_server, Marvin::Settings.distributed_namespace, nil])
25
+ if server.empty?
26
+ return nil
27
+ else
28
+ # Return the first element in the list of servers, getting it's servers instance.
29
+ return server.first.last
30
+ end
31
+ rescue
32
+ return nil
33
+ end
34
+ end
35
+
18
36
  def self.start
19
37
  DRb.start_service
20
38
  instance = self.new # Create the new instance
data/lib/marvin/loader.rb CHANGED
@@ -137,8 +137,10 @@ module Marvin
137
137
  end
138
138
 
139
139
  # Register to the Marvin::DataStore methods
140
- before_run { Marvin::DataStore.load! if Marvin::Loader.type == :client }
141
- after_stop { Marvin::DataStore.dump! if Marvin::Loader.type == :client }
140
+ if Marvin::Loader.client?
141
+ before_run { Marvin::DataStore.load! }
142
+ after_stop { Marvin::DataStore.dump! }
143
+ end
142
144
 
143
145
  end
144
146
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Sutto-marvin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darcy Laycock
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-03 00:00:00 -08:00
12
+ date: 2009-01-17 00:00:00 -08:00
13
13
  default_executable: marvin
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -79,6 +79,7 @@ files:
79
79
  - lib/marvin/exception_tracker.rb
80
80
  - lib/marvin/exceptions.rb
81
81
  - lib/marvin/handler.rb
82
+ - lib/marvin/hookable.rb
82
83
  - lib/marvin/irc
83
84
  - lib/marvin/irc/client.rb
84
85
  - lib/marvin/irc/event.rb