Class: Again

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/again.rb,
lib/again/extras.rb,
lib/again/version.rb

Constant Summary collapse

RELOAD_MARKER =
"--reload-temp--"
VERSION =
"1.1.4"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.joinObject



18
# File 'lib/again.rb', line 18

def self.join() instance.join end

.open_cmdObject



2
3
4
# File 'lib/again/extras.rb', line 2

def self.open_cmd()
  (`which mate` rescue nil || "open").chomp
end

.open_lib(lib, cmd = open_cmd) ⇒ Object



6
7
8
9
10
# File 'lib/again/extras.rb', line 6

def self.open_lib(lib, cmd=open_cmd)
  if lib = instance.resolve_library(lib) then
    system(cmd, lib)
  end
end

.open_libdir(lib, cmd = open_cmd) ⇒ Object



12
13
14
15
16
# File 'lib/again/extras.rb', line 12

def self.open_libdir(lib, cmd=open_cmd)
  if lib = instance.resolve_library(lib) then
    system(cmd, File.dirname(lib))
  end
end

.reloaded?Boolean

Returns:

  • (Boolean)


19
# File 'lib/again.rb', line 19

def self.reloaded?() instance.reloaded? end

.startObject



17
# File 'lib/again.rb', line 17

def self.start() self.instance end

Instance Method Details

#joinObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/again.rb', line 23

def join()
  # Can't simply join @watch_thread here as a refresh() can stop it.
  # We want to survive refreshes so we instead join a thread which
  # keeps checking for new watch_threads...
  Thread.new do
    loop do
      if @watch_thread then
        @watch_thread.alive?() ? @watch_thread.join : sleep(0.5)
      end
    end
  end.join
end

#reloaded?Boolean

Returns:

  • (Boolean)


21
# File 'lib/again.rb', line 21

def reloaded?() @reloaded end